New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tiny-pinyin

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-pinyin - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

tiny-pinyin.d.ts

5

dist/core.js

@@ -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];

6

dist/patchers/56l.js

@@ -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`可以是数组,数组的每个元素为函数类型。

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc