🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

frog-lib

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frog-lib - npm Package Compare versions

Comparing version
1.0.2
to
1.0.3
+2
-2
package.json
{
"name": "frog-lib",
"version": "1.0.2",
"version": "1.0.3",
"description": "super-frog library",

@@ -26,2 +26,2 @@ "main": "index.js",

}
}
}

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