gm-util 5.12.10-beta.1 → 5.13.0-beta.1
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.
- package/.github/workflows/publish.yml +35 -0
- package/package.json +1 -1
- package/src/pinyin.js +2 -3
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Publish to NPM
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
id-token: write
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup Node.js
|
|
22
|
+
uses: actions/setup-node@v4
|
|
23
|
+
with:
|
|
24
|
+
node-version: '18'
|
|
25
|
+
registry-url: 'https://registry.npmjs.org'
|
|
26
|
+
cache: 'yarn'
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: yarn install --frozen-lockfile
|
|
30
|
+
|
|
31
|
+
- name: Publish to NPM
|
|
32
|
+
run: npm publish --registry='https://registry.npmjs.org'
|
|
33
|
+
env:
|
|
34
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
35
|
+
|
package/package.json
CHANGED
package/src/pinyin.js
CHANGED
|
@@ -703,9 +703,8 @@ const pinyin = (source, style) => {
|
|
|
703
703
|
if (compareResult < 0) {
|
|
704
704
|
index--
|
|
705
705
|
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
return (style === 'first_letter') ? targetPinyin.charAt(0) : targetPinyin
|
|
706
|
+
cache[target] = pinyins[index]
|
|
707
|
+
return (style === 'first_letter') ? pinyins[index].charAt(0) : pinyins[index]
|
|
709
708
|
}
|
|
710
709
|
|
|
711
710
|
const _pinyin = (source, style) => {
|