Skip to content

Commit

Permalink
update dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jun 27, 2019
1 parent b5fdf46 commit cca6582
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ slugify('你好, world!');

```html
<!-- UMD build -->
<script async defer src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/browser/bundle.umd.min.js"></script>
<script async defer src="https://cdn.jsdelivr.net/npm/[email protected].4/dist/browser/bundle.umd.min.js"></script>
<script>
console.log(transliterate('你好'));
</script>
Expand All @@ -51,7 +51,7 @@ slugify('你好, world!');
```html
<!-- ESM build -->
<script type="module">
import { transliterate } from 'https://cdn.jsdelivr.net/npm/[email protected].3/dist/browser/bundle.esm.min.js';
import { transliterate } from 'https://cdn.jsdelivr.net/npm/[email protected].4/dist/browser/bundle.esm.min.js';
console.log(transliterate('你好'));
</script>
```
Expand Down
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "transliteration",
"version": "2.1.3",
"version": "2.1.4",
"description": "Unicode to ACSII transliteration / slugify module for node.js, browser, Web Worker, ReactNative and CLI.",
"main": "dist/node/src/node/index.js",
"module": "dist/browser/bundle.esm.min.js",
Expand Down Expand Up @@ -52,36 +52,36 @@
"node": ">=6.0.0"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/plugin-proposal-class-properties": "^7.3.0",
"@babel/plugin-proposal-object-rest-spread": "^7.3.2",
"@babel/preset-env": "^7.3.1",
"@babel/preset-typescript": "^7.1.0",
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/plugin-proposal-object-rest-spread": "^7.4.4",
"@babel/preset-env": "^7.4.5",
"@babel/preset-typescript": "^7.3.3",
"@types/execa": "^0.9.0",
"@types/tape": "^4.2.33",
"@types/yargs": "^13.0.0",
"codecov": "^3.2.0",
"coveralls": "^3.0.2",
"execa": "^1.0.0",
"codecov": "^3.5.0",
"coveralls": "^3.0.4",
"execa": "^2.0.1",
"json5": "^2.1.0",
"nyc": "^13.2.0",
"nyc": "^14.1.1",
"rimraf": "^2.6.3",
"rollup": "^1.1.2",
"rollup": "^1.16.2",
"rollup-plugin-babel": "^5.0.0-alpha.0",
"rollup-plugin-hashbang": "^2.2.2",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^4.0.4",
"rollup-plugin-typescript2": "^0.19.2",
"rollup-plugin-terser": "^5.0.0",
"rollup-plugin-typescript2": "^0.21.2",
"rollup-plugin-uglify": "^6.0.2",
"tap-spec": "^5.0.0",
"tape": "^4.10.0",
"ts-loader": "^5.3.3",
"ts-node": "^8.0.2",
"tslint": "^5.12.1",
"tape": "^4.10.2",
"ts-loader": "^6.0.4",
"ts-node": "^8.3.0",
"tslint": "^5.18.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.3.3"
"typescript": "^3.5.2"
},
"dependencies": {
"yargs": "^13.1.0"
"yargs": "^13.2.4"
}
}
34 changes: 17 additions & 17 deletions test/cli/slugify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ const slugify = (str: string, options: OptionsSlugify = {}): string => {
args += ` -s "${escape(options.separator)}"`;
}
const [trailingSpaces] = str.match(/[\r\n]+$/) || [''];
const { stdout } = execa.shellSync(`${execPath} "${str}"${args}`, cmdOptions);
const { stdout } = execa.sync(`${execPath} "${str}"${args}`, cmdOptions);
return stdout + trailingSpaces;
}

test('#slugify()', tt => {
const tests: Array<[string, object, string]> = [
['你好, 世界!', {}, 'ni-hao-shi-jie'],
['你好, 世界!', { separator: '_' }, 'ni_hao_shi_jie'],
['你好, 世界!', { uppercase: true }, 'NI-HAO-SHI-JIE'],
['你好, 世界!', { ignore: ['!', ','] }, 'ni-hao,-shi-jie!'],
['你好, 世界!', { replace: [['世界', '未来']] }, 'ni-hao-wei-lai'],
['你好, 世界!', { replace: [['你好', 'Hello'], ['世界', 'World']] }, 'hello-world'],
['你好, 世界!', { separator: ', ', replace: [['你好', 'Hola'], ['世界', 'mundo']], ignore: ['¡', '!'], lowercase: false }, 'hola, mundo!'],
['你好, 世界!', {}, 'ni-hao-shi-jie'],
['你好, 世界!', { separator: '_' }, 'ni_hao_shi_jie'],
['你好, 世界!', { ignore: ['!', ','] }, 'ni-hao,-shi-jie!'],
['你好, 世界!', { replace: [['世界', '未来']] }, 'ni-hao-wei-lai'],
['你好, 世界!', { replace: [['你好', 'Hello '], ['世界', 'World ']] }, 'hello-world'],
['你好, 世界!', { separator: ', ', replace: [['你好', 'Hola'], ['世界', 'mundo']], ignore: ['¡', '!'], lowercase: false }, 'hola, mundo!'],
['你好, 世界!', {}, 'ni-hao-shi-jie\n'],
['你好, 世界!', { separator: '_' }, 'ni_hao_shi_jie\n'],
['你好, 世界!', { uppercase: true }, 'NI-HAO-SHI-JIE\n'],
['你好, 世界!', { ignore: ['!', ','] }, 'ni-hao,-shi-jie!\n'],
['你好, 世界!', { replace: [['世界', '未来']] }, 'ni-hao-wei-lai\n'],
['你好, 世界!', { replace: [['你好', 'Hello'], ['世界', 'World']] }, 'hello-world\n'],
['你好, 世界!', { separator: ', ', replace: [['你好', 'Hola'], ['世界', 'mundo']], ignore: ['¡', '!'], lowercase: false }, 'hola, mundo!\n'],
['你好, 世界!', {}, 'ni-hao-shi-jie\n'],
['你好, 世界!', { separator: '_' }, 'ni_hao_shi_jie\n'],
['你好, 世界!', { ignore: ['!', ','] }, 'ni-hao,-shi-jie!\n'],
['你好, 世界!', { replace: [['世界', '未来']] }, 'ni-hao-wei-lai\n'],
['你好, 世界!', { replace: [['你好', 'Hello '], ['世界', 'World ']] }, 'hello-world\n'],
['你好, 世界!', { separator: ', ', replace: [['你好', 'Hola'], ['世界', 'mundo']], ignore: ['¡', '!'], lowercase: false }, 'hola, mundo!\n'],
];

test('Generate slugs', t => {
Expand All @@ -63,14 +63,14 @@ test('#slugify()', tt => {
test('- Stream input', t => {
const filename = join(tmpdir(), Math.floor(Math.random() * 10000000).toString(16) + '.txt');
writeFileSync(filename, '你好,世界!');
const { stdout } = execa.shellSync(`${execPath} -S < ${filename}`, { ...cmdOptions });
const { stdout } = execa.sync(`${execPath} -S < ${filename}`, { ...cmdOptions });
unlinkSync(filename);
t.equal(stdout, "ni-hao-shi-jie");
t.equal(stdout, "ni-hao-shi-jie\n");
t.end();
});

test('- Invalid argument', t => {
const { stderr } = execa.shellSync(`${execPath} -abc`, { ...cmdOptions });
const { stderr } = execa.sync(`${execPath} -abc`, { ...cmdOptions });
t.true(/Invalid argument\. Please type '.*? --help' for help\./.test(stderr));
t.end();
});
Expand Down
8 changes: 4 additions & 4 deletions test/cli/transliterate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const tr = (str: string, options: OptionsTransliterate = {}): string => {
args += options.replace.map((s: [string | RegExp, string]): string => ` -r "${escape(s[0] as string)}=${escape(s[1])}"`).join('');
}
const [trailingSpaces] = str.match(/[\r\n]+$/) || [''];
const { stdout } = execa.shellSync(`${execPath} "${str}"${args}`, cmdOptions);
const { stdout } = execa.sync(`${execPath} "${str}"${args}`, cmdOptions);
return stdout.replace(/[\r\n]+$/, '') + trailingSpaces;
}

Expand Down Expand Up @@ -107,14 +107,14 @@ test('#transliterate()', tt => {
test('- Stream input', t => {
const filename = join(tmpdir(), Math.floor(Math.random() * 10000000).toString(16) + '.txt');
writeFileSync(filename, '你好,世界!');
const { stdout } = execa.shellSync(`${execPath} -S < ${filename}`, { ...cmdOptions });
const { stdout } = execa.sync(`${execPath} -S < ${filename}`, { ...cmdOptions });
unlinkSync(filename);
t.equal(stdout, "Ni Hao, Shi Jie!");
t.equal(stdout, "Ni Hao, Shi Jie!\n");
t.end();
});

test('- Invalid argument', t => {
const { stderr } = execa.shellSync(`${execPath} -abc`, { ...cmdOptions });
const { stderr } = execa.sync(`${execPath} -abc`, { ...cmdOptions });
t.true(/Invalid argument\. Please type '.*? --help' for help\./.test(stderr));
t.end();
});
Expand Down

0 comments on commit cca6582

Please sign in to comment.