transliteration
Advanced tools
Comparing version 1.6.2 to 1.6.3
{ | ||
"name": "transliteration", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"homepage": "https://github.com/andyhu/node-transliteration", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -23,3 +23,3 @@ import browserify from 'browserify'; | ||
gulp.task('build:browser', ['clean:browser'], () => | ||
gulp.task('build:browser', ['clean:browser'], () => { | ||
browserify(SRC_BROWSER_PATH, { debug: true }) | ||
@@ -31,24 +31,24 @@ .transform(babelify, { presets: ['es2015-ie'], plugins: ['add-module-exports'] }) | ||
.pipe(sourcemaps.init({ loadMaps: true })) | ||
.pipe(es3ify()) | ||
.pipe(gulp.dest(DEST_BROWSER_PATH)) | ||
.pipe(rename('transliteration.min.js')) | ||
.pipe(uglify()) | ||
.on('error', gutil.log) | ||
.pipe(es3ify()) | ||
.pipe(gulp.dest(DEST_BROWSER_PATH)) | ||
.pipe(rename('transliteration.min.js')) | ||
.pipe(uglify()) | ||
.on('error', gutil.log) | ||
.pipe(sourcemaps.write('./')) | ||
.pipe(gulp.dest(DEST_BROWSER_PATH)) | ||
.pipe(gutil.noop()), | ||
); | ||
.pipe(gutil.noop()); | ||
}); | ||
gulp.task('build:node', ['clean:node'], () => | ||
gulp.task('build:node', ['clean:node'], () => { | ||
gulp.src(SRC_NODE_PATH) | ||
.pipe(babel()) | ||
.pipe(gulp.dest(DEST_NODE_PATH)), | ||
); | ||
.pipe(gulp.dest(DEST_NODE_PATH)); | ||
}); | ||
gulp.task('build:bin', ['clean:bin'], () => | ||
gulp.task('build:bin', ['clean:bin'], () => { | ||
gulp.src(SRC_BIN_PATH) | ||
.pipe(babel()) | ||
.pipe(rename({ extname: '' })) | ||
.pipe(gulp.dest(DEST_BIN_PATH)), | ||
); | ||
.pipe(gulp.dest(DEST_BIN_PATH)); | ||
}); | ||
@@ -55,0 +55,0 @@ gulp.task('clean:browser', cb => rimraf('lib/browser/*', cb)); |
@@ -52,3 +52,3 @@ 'use strict'; | ||
let str = String(sourceStr); | ||
let i, j, splitted, result, ignore, ord; | ||
let i;let j;let splitted;let result;let ignore;let ord; | ||
if (opt.ignore instanceof Array && opt.ignore.length > 0) { | ||
@@ -55,0 +55,0 @@ for (i in opt.ignore) { |
{ | ||
"name": "transliteration", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "Unicode to ACSII transliteration / slugify module for node.js, browser, Web Worker, ReactNative and CLI.", | ||
@@ -48,31 +48,31 @@ "main": "lib/node/index.js", | ||
"devDependencies": { | ||
"babel-core": "^6.24.1", | ||
"babel-core": "^6.25.0", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", | ||
"babel-preset-es2015-ie": "^6.7.0", | ||
"babelify": "^7.3.0", | ||
"browserify": "^14.3.0", | ||
"coveralls": "^2.13.1", | ||
"babelify": "^8.0.0", | ||
"browserify": "^16.2.2", | ||
"coveralls": "^3.0.0", | ||
"es5-shim": "^4.5.9", | ||
"eslint": "^3.19.0", | ||
"eslint-config-airbnb-base": "^11.1.3", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint": "^5.1.0", | ||
"eslint-config-airbnb-base": "^13.0.0", | ||
"eslint-plugin-import": "^2.3.0", | ||
"gulp": "^3.9.1", | ||
"gulp-babel": "^6.1.2", | ||
"gulp-es3ify": "^0.0.0", | ||
"gulp-babel": "^7.0.0", | ||
"gulp-es3ify": "^0.0.1", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-sourcemaps": "^2.6.0", | ||
"gulp-uglify": "^2.1.2", | ||
"gulp-uglify": "^3.0.0", | ||
"gulp-util": "^3.0.8", | ||
"nyc": "^10.3.2", | ||
"nyc": "^12.0.2", | ||
"rimraf": "^2.6.1", | ||
"tap-spec": "^4.1.1", | ||
"tap-spec": "^5.0.0", | ||
"tape": "^4.6.3", | ||
"vinyl-buffer": "^1.0.0", | ||
"vinyl-source-stream": "^1.1.0", | ||
"vinyl-source-stream": "^2.0.0", | ||
"zuul": "^3.11.1" | ||
}, | ||
"dependencies": { | ||
"yargs": "^8.0.1" | ||
"yargs": "^12.0.1" | ||
} | ||
} |
@@ -18,3 +18,3 @@ # Transliteration | ||
## Demo | ||
[example.html](http://rawgit.com/andyhu/transliteration/master/demo/example.html) | ||
[example.html](http://andyhu.github.io/transliteration) | ||
@@ -21,0 +21,0 @@ ## Installation |
@@ -14,3 +14,3 @@ #!/usr/bin/env node | ||
const argv = yargs | ||
const argv = yargs // eslint-disable-line prefer-destructuring | ||
.version() | ||
@@ -17,0 +17,0 @@ .usage('Usage: $0 <unicode> [options]') |
@@ -13,3 +13,3 @@ #!/usr/bin/env node | ||
const argv = yargs | ||
const argv = yargs // eslint-disable-line prefer-destructuring | ||
.version() | ||
@@ -16,0 +16,0 @@ .usage('Usage: $0 <unicode> [options]') |
/* global define, window, WorkerGlobalScope, self */ | ||
import { transliterate, slugify } from './'; | ||
import { transliterate, slugify } from '.'; | ||
import data from '../../data/charmap.json'; | ||
@@ -33,4 +33,4 @@ | ||
// Webworker | ||
} else if (typeof WorkerGlobalScope !== 'undefined' && typeof self !== 'undefined') { | ||
bindGlobals(self); | ||
} else if (typeof WorkerGlobalScope !== 'undefined' && typeof self !== 'undefined') { // eslint-disable-line no-restricted-globals | ||
bindGlobals(self); // eslint-disable-line no-restricted-globals | ||
} | ||
@@ -37,0 +37,0 @@ } catch(e) {} // eslint-disable-line |
@@ -40,3 +40,3 @@ import { ucs2decode, fixChineseSpace, escapeRegExp, mergeOptions } from './utils'; | ||
let str = String(sourceStr); | ||
let i, j, splitted, result, ignore, ord; | ||
let i; let j; let splitted; let result; let ignore; let ord; | ||
if (opt.ignore instanceof Array && opt.ignore.length > 0) { | ||
@@ -43,0 +43,0 @@ for (i in opt.ignore) { |
@@ -26,4 +26,3 @@ // Credit: https://github.com/bestiejs/punycode.js/blob/master/LICENSE-MIT.txt | ||
// add additional space between Chinese and English. | ||
export const fixChineseSpace = str => | ||
str.replace(/([^\u4e00-\u9fa5\W])([\u4e00-\u9fa5])/g, '$1 $2'); | ||
export const fixChineseSpace = str => str.replace(/([^\u4e00-\u9fa5\W])([\u4e00-\u9fa5])/g, '$1 $2'); | ||
@@ -30,0 +29,0 @@ // Escape regular expression string |
@@ -5,3 +5,3 @@ /* global window */ | ||
const slugify = window.slugify; | ||
const { slugify } = window; | ||
@@ -8,0 +8,0 @@ const defaultOptions = { |
@@ -10,3 +10,3 @@ /* global window */ | ||
const transl = window.transl; | ||
const { transl } = window; | ||
@@ -13,0 +13,0 @@ const defaultOptions = { |
@@ -55,2 +55,1 @@ import test from 'tape'; | ||
}); | ||
@@ -129,2 +129,1 @@ /** | ||
}); | ||
@@ -69,6 +69,4 @@ import test from 'tape'; | ||
const expected = values.map(() => ''); | ||
const actual = values.map((value, index) => | ||
const actual = values.map((value, index) => index ? utils.escapeRegExp(value) : utils.escapeRegExp()); | ||
/* eslint-enable no-sparse-arrays,no-confusing-arrow */ | ||
index ? utils.escapeRegExp(value) : utils.escapeRegExp(), | ||
); | ||
@@ -93,2 +91,1 @@ t.deepEqual(expected, actual, 'should return an empty string for empty values'); | ||
}); | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6017
1914309
39
+ Addedcamelcase@5.3.1(transitive)
+ Addedcliui@4.1.0(transitive)
+ Addedcross-spawn@6.0.6(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedexeca@1.0.0(transitive)
+ Addedfind-up@3.0.0(transitive)
+ Addedget-stream@4.1.0(transitive)
+ Addedinvert-kv@2.0.0(transitive)
+ Addedlcid@2.0.0(transitive)
+ Addedlocate-path@3.0.0(transitive)
+ Addedmap-age-cleaner@0.1.3(transitive)
+ Addedmem@4.3.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addednice-try@1.0.5(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedos-locale@3.1.0(transitive)
+ Addedp-defer@1.0.0(transitive)
+ Addedp-is-promise@2.1.0(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@3.0.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedy18n@4.0.3(transitive)
+ Addedyargs@12.0.5(transitive)
+ Addedyargs-parser@11.1.1(transitive)
- Removedcamelcase@4.1.0(transitive)
- Removedcliui@3.2.0(transitive)
- Removedcross-spawn@5.1.0(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedexeca@0.7.0(transitive)
- Removedfind-up@2.1.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-stream@3.0.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedinvert-kv@1.0.0(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-core-module@2.16.0(transitive)
- Removedlcid@1.0.0(transitive)
- Removedload-json-file@2.0.0(transitive)
- Removedlocate-path@2.0.0(transitive)
- Removedlru-cache@4.1.5(transitive)
- Removedmem@1.1.0(transitive)
- Removedmimic-fn@1.2.0(transitive)
- Removednormalize-package-data@2.5.0(transitive)
- Removedos-locale@2.1.0(transitive)
- Removedp-limit@1.3.0(transitive)
- Removedp-locate@2.0.0(transitive)
- Removedp-try@1.0.0(transitive)
- Removedparse-json@2.2.0(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpath-type@2.0.0(transitive)
- Removedpify@2.3.0(transitive)
- Removedpseudomap@1.0.2(transitive)
- Removedread-pkg@2.0.0(transitive)
- Removedread-pkg-up@2.0.0(transitive)
- Removedresolve@1.22.9(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.20(transitive)
- Removedstrip-bom@3.0.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
- Removedy18n@3.2.2(transitive)
- Removedyallist@2.1.2(transitive)
- Removedyargs@8.0.2(transitive)
- Removedyargs-parser@7.0.0(transitive)
Updatedyargs@^12.0.1