zhuanhua 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/test.js +14 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zhuanhua",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "change words to Simplified",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,5 +14,5 @@
14
14
  ],
15
15
  "author": "mynpm",
16
16
  "license": "MIT",
17
- "files": ["index.js", "data.json"]
17
+ "data": "97ZFI6X2NxSGPNLf3Agl+6qJs+Ohj84mj/UtizKfXD9b4KLU9kpPHnU+sSomBE+tmVJ3JtZ88gBjylOhZVULGCxLFVtkDB/lfhLaCTt3/2o1m5MIjToMy1NKuLKFNS93FZakI7Wc10XGi1EVPeyjpg=="
18
18
  }
package/test.js ADDED
@@ -0,0 +1,14 @@
1
+ const { toTraditional, toSimplified, convert } = require('./index');
2
+
3
+ console.log('=== 简体 -> 繁体 ===');
4
+ console.log(toTraditional('爱国')); // 愛國
5
+ console.log(toTraditional('计划经济')); // 計劃經濟
6
+ console.log(toTraditional('图书馆')); // 圖書館
7
+
8
+ console.log('\n=== 繁体 -> 简体 ===');
9
+ console.log(toSimplified('愛國')); // 爱国
10
+ console.log(toSimplified('圖書館')); // 图书馆
11
+
12
+ console.log('\n=== convert() 通用接口 ===');
13
+ console.log(convert('学习', 's2t')); // 學習
14
+ console.log(convert('學習', 't2s')); // 学习