Skip to content

Commit

Permalink
Migrate to @napi-rs/pinyin, drop Windows x86 (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn authored Jan 26, 2021
1 parent f16c10d commit bf5e3de
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Provided to support backwards-compatibility with the `slug` module.
const underscore = slug('i ♥ unicode', '_'); // i_love_unicode
```

## Test [![Build Status](https://travis-ci.org/lovell/limax.png?branch=master)](https://travis-ci.org/lovell/limax)
## Test ![.github/workflows/ci.yml](https://github.com/lovell/limax/workflows/.github/workflows/ci.yml/badge.svg)

Run the unit tests with:

Expand Down
15 changes: 0 additions & 15 deletions appveyor.yml

This file was deleted.

4 changes: 2 additions & 2 deletions lib/limax.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const speakingurl = require('speakingurl');
const pinyin = require('pinyin');
const { pinyin, PINYIN_STYLE } = require('@napi-rs/pinyin');
const hepburn = require('hepburn');

function customCharsAsArray (custom) {
Expand Down Expand Up @@ -39,7 +39,7 @@ module.exports = function (text, opt) {
const tone = (typeof options.tone === 'boolean') ? options.tone : true;
mergeDigitSuffixes = tone;
text = pinyin(text, {
style: tone ? pinyin.STYLE_TONE2 : pinyin.STYLE_NORMAL
style: tone ? PINYIN_STYLE.WithToneNumEnd : PINYIN_STYLE.Plain
}).join(' ');
// Remove punctuation symbols
const customNonPunctuation = customCharsAsArray(options.custom).map(function (c) { return `\\${c}`; }).join('');
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
],
"license": "Apache-2.0",
"dependencies": {
"@napi-rs/pinyin": "^1.5.0",
"hepburn": "^1.2.0",
"pinyin": "^2.9.1",
"speakingurl": "^14.0.1"
},
"devDependencies": {
"ava": "^3.13.0",
"nyc": "^15.1.0",
"semistandard": "^16.0.0"
}
}
}

0 comments on commit bf5e3de

Please sign in to comment.