Skip to content

Commit b061b0a

Browse files
committedJan 2, 2015
integrated with Grunt
1 parent b3a06d3 commit b061b0a

File tree

5 files changed

+71
-9
lines changed

5 files changed

+71
-9
lines changed
 

‎.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# node-waf configuration
20+
.lock-wscript
21+
22+
# Compiled binary addons (http://nodejs.org/api/addons.html)
23+
build/Release
24+
25+
# Dependency directory
26+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
27+
node_modules
28+

‎Gruntfile.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = function(grunt) {
2+
grunt.initConfig({
3+
pkg: grunt.file.readJSON('package.json'),
4+
uglify: {
5+
options: {
6+
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
7+
},
8+
build: {
9+
src: 'hangul.js',
10+
dest: 'hangul.min.js'
11+
}
12+
},
13+
qunit: {
14+
files: ['test/index.html']
15+
},
16+
jshint: {
17+
files: ['Gruntfile.js', 'hangul.js']
18+
}
19+
});
20+
21+
grunt.loadNpmTasks('grunt-contrib-uglify');
22+
grunt.loadNpmTasks('grunt-contrib-jshint');
23+
grunt.loadNpmTasks('grunt-contrib-qunit');
24+
25+
26+
grunt.registerTask('test', ['jshint', 'qunit']);
27+
grunt.registerTask('default', ['jshint', 'uglify', 'qunit']);
28+
};

‎hangul.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@
153153
cho,
154154
jung,
155155
jong,
156-
code
156+
code,
157+
r
157158
;
158159

159160
for (var i = 0; i < length; i++) {
@@ -177,7 +178,6 @@
177178
}
178179
}
179180
} else if (_isConsonant(code)) { //자음이면
180-
var r;
181181
if (_isCho(code)) {
182182
r = CHO[CHO_HASH[code]];
183183
} else {
@@ -189,7 +189,7 @@
189189
result = result.concat(r);
190190
}
191191
} else if (_isJung(code)) {
192-
var r = JUNG[JUNG_HASH[code]];
192+
r = JUNG[JUNG_HASH[code]];
193193
if (typeof r == 'string') {
194194
result.push(r);
195195
} else {
@@ -236,7 +236,7 @@
236236
complete_index = index;
237237
return;
238238
} else {
239-
result.push(array[complete_index + step])
239+
result.push(array[complete_index + step]);
240240
complete_index = index;
241241
return;
242242
}
@@ -296,7 +296,7 @@
296296
continue;
297297
}
298298
//console.log(stage, array[i]);
299-
if (stage == 0) { // 초성이 올 차례
299+
if (stage === 0) { // 초성이 올 차례
300300
if (_isCho(code)) { // 초성이 오면 아무 문제 없다.
301301
stage = 1;
302302
} else if (_isJung(code)) {
@@ -446,6 +446,6 @@
446446
module.exports = hangul;
447447
} else {
448448
window.Hangul = hangul;
449-
};
449+
}
450450
})();
451451

‎hangul.min.js

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hangul-js",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "Hangul (Korean alphabet) manipulating library",
55
"homepage": "https://github.com/e-/Hangul.js",
66
"author": "Jaemin Jo",
@@ -13,5 +13,10 @@
1313
"type": "git",
1414
"url": "git://github.com/e-/Hangul.js.git"
1515
},
16-
"main": "hangul.js"
16+
"main": "hangul.js",
17+
"devDependencies": {
18+
"grunt": "^0.4.5",
19+
"grunt-contrib-jshint": "^0.10.0",
20+
"grunt-contrib-uglify": "^0.7.0"
21+
}
1722
}

0 commit comments

Comments
 (0)
Please sign in to comment.