tiny-pinyin
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -49,6 +49,5 @@ 'use strict'; | ||
source: ch | ||
}; | ||
// First check EXCEPTIONS map, then search with UNIHANS table. | ||
if (ch in EXCEPTIONS) { | ||
// First check EXCEPTIONS map, then search with UNIHANS table. | ||
};if (ch in EXCEPTIONS) { | ||
token.type = PINYIN; | ||
@@ -55,0 +54,0 @@ token.target = EXCEPTIONS[ch]; |
@@ -22,6 +22,6 @@ 'use strict'; | ||
'\u94B6': 'KE' // 钶 | ||
}; | ||
// Update UNIHANS dict. | ||
DICT.UNIHANS[91] = '\u4F15'; // FU: 夫 --> 伕 | ||
// Update UNIHANS dict. | ||
};DICT.UNIHANS[91] = '\u4F15'; // FU: 夫 --> 伕 | ||
DICT.UNIHANS[347] = '\u4EDA'; // XIAN: 仙 --> 仚 | ||
@@ -28,0 +28,0 @@ DICT.UNIHANS[393] = '\u8BCC'; // ZHOU: 州 --> 诌 |
{ | ||
"name": "tiny-pinyin", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "convert hanzi to pinyin", | ||
"main": "dist/index.js", | ||
"typings": "tiny-pinyin.d.ts", | ||
"files": [ | ||
"dist", | ||
"src" | ||
"src", | ||
"tiny-pinyin.d.ts" | ||
], | ||
@@ -45,3 +47,3 @@ "directories": { | ||
"pretest": "babel --presets=power-assert,es2015 test --out-dir test-compiled", | ||
"test": "npm run lint && npm run test-notsupport && npm run test-common && npm run test:sauce", | ||
"test": "npm run lint && npm run test-notsupport && npm run test-common", | ||
"test-common": "NODE_ICU_DATA='node_modules/full-icu' mocha test-compiled/index.spec.js", | ||
@@ -48,0 +50,0 @@ "test-notsupport": "mocha test-compiled/notSupport.spec.js", |
@@ -11,3 +11,3 @@ # tiny-pinyin [![Build Status](https://travis-ci.org/creeperyang/pinyin.svg?branch=master)](https://travis-ci.org/creeperyang/pinyin) [![npm version](https://badge.fury.io/js/tiny-pinyin.svg)](https://badge.fury.io/js/tiny-pinyin) | ||
2. 可以轻松处理 **6763** 个的常用汉字,其它汉字未测试,但应该有相当正确率,欢迎测试。 | ||
3. 同时支持 **`node.js (4-7)` 和 浏览器 (safari/chrome/firefox/android 6+/ios)** 。 | ||
3. 同时支持 **`node.js (4-10)` 和 浏览器 (safari/chrome/firefox/android 6+/ios)** 。 | ||
@@ -51,2 +51,4 @@ **注意:不支持多音字;`ie/edge` 测试未通过。** | ||
*已通过 [c6b3ba9](https://github.com/creeperyang/pinyin/commit/c6b3ba9fcd66e0d1225ddbc95fc84c6fa75e664e)@zhanba 支持 typescript typings。* | ||
### 1. `pinyin.isSupported([forceRedetect])` | ||
@@ -78,3 +80,3 @@ | ||
### 3. `pinyin.convertToPinyin(string, separator, lowerCase)` | ||
### 3. `pinyin.convertToPinyin(string[, separator[, lowerCase]])` | ||
@@ -91,3 +93,3 @@ - `string`,待转成拼音的字符串。 | ||
### 4. `pinyin.patchDict(fn)` | ||
### 4. `pinyin.patchDict(fn|[fn])` | ||
@@ -94,0 +96,0 @@ - `fn`,`function`类型,接受参数为当前使用的字典对象`DICT`,可以修改`DICT.UNIHANS/DICT.PINYINS/DICT.EXCEPTIONS`来修改字典。另外,`fn`可以是数组,数组的每个元素为函数类型。 |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
101
0
36832
12
647