+2
-2
| { | ||
| "name": "frog-lib", | ||
| "version": "1.0.2", | ||
| "version": "1.0.3", | ||
| "description": "super-frog library", | ||
@@ -26,2 +26,2 @@ "main": "index.js", | ||
| } | ||
| } | ||
| } |
+25
-6
@@ -12,3 +12,3 @@ /** | ||
| pinyin.underline = (str) => { | ||
| let o = nodePinyin(str, {style: 'normal'}); | ||
| let o = sp(str); | ||
| let output = []; | ||
@@ -22,3 +22,3 @@ for (let k in o) { | ||
| pinyin.bar = (str) => { | ||
| let o = nodePinyin(str, {style: 'normal'}); | ||
| let o = sp(str); | ||
| let output = []; | ||
@@ -32,7 +32,12 @@ for (let k in o) { | ||
| pinyin.camel = (str, studlyCaps = false) => { | ||
| let o = nodePinyin(str, {style: 'normal'}); | ||
| let o = sp(str) | ||
| // if(str.includes('_')){ | ||
| // | ||
| // }else { | ||
| // o = nodePinyin(str, {style: 'normal'}); | ||
| // } | ||
| let output = []; | ||
| for (let k in o) { | ||
| let arr = Array.from(o[k][0]); | ||
| (k > 0 || studlyCaps === true) && (arr[0] = arr[0].toLocaleUpperCase()); | ||
| (k > 0 || studlyCaps == true) && (arr[0] = arr[0].toLocaleUpperCase()); | ||
| output.push(arr.join('')); | ||
@@ -43,8 +48,22 @@ } | ||
| function sp(str) { | ||
| let separator = ' '; | ||
| if(str.includes('_')){ | ||
| separator = '_'; | ||
| }else if(str.includes('-')){ | ||
| separator = '-'; | ||
| } | ||
| let output = []; | ||
| let pieces = str.split(separator); | ||
| for(let k in pieces){ | ||
| output = output.concat(nodePinyin(pieces[k], {style: 'normal'})); | ||
| } | ||
| return output; | ||
| } | ||
| module.exports = pinyin; | ||
| // TEST CASE | ||
| //console.log(pinyin.underline('阿瓜')); | ||
| // console.log(pinyin.underline('阿瓜')); | ||
| // console.log(pinyin.bar('阿瓜')); | ||
| //console.log(pinyin.camel('阿瓜')); | ||
| //console.log(pinyin.camel('阿瓜', true)); |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
4817
6.43%183
11.59%