Comparing version 1.2.2 to 1.2.3
{ | ||
"name": "node-caps", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "An easy-to-use module to capitalise an string or array", | ||
@@ -55,3 +55,6 @@ "module": "./src/esm/index.esm.js", | ||
} | ||
}, | ||
"dependencies": { | ||
"@types/node": "^14.14.10" | ||
} | ||
} |
@@ -94,5 +94,5 @@ # node-caps | ||
// But | ||
Caps.reg('north-us') /* Expected output: 'North-US' | ||
Caps.reg('north-us') /* Expected output: 'North-US' */ | ||
``` | ||
**_Copyright (c) 2020 simp. & Salvage_** |
import Caps from "../func"; | ||
export const { def, keep, all, array, sent, dash, reg } = Caps; | ||
export const { def, keep, all, array, sent, dash, reg, perms } = Caps; |
@@ -121,2 +121,17 @@ module.exports = { | ||
}, | ||
}; | ||
perms: (str) => { | ||
return str.map((v) =>{ | ||
if (!v || typeof v !== "string") | ||
throw new TypeError( | ||
`Parameter str must be typeof String, recieved type "${typeof str}"` | ||
); | ||
if(v.includes('_')){ | ||
return v.split(/_/g).map((s) => { | ||
return s.charAt(0)+s.slice(1).toLowerCase() | ||
}).join(' '); | ||
} else { | ||
return v.charAt(0)+v.slice(1).toLowerCase() | ||
} | ||
}); | ||
} | ||
}; |
@@ -8,2 +8,3 @@ declare function def(str: string): string; | ||
declare function reg(str: string): string; | ||
export { def, array, keep, all, sent, dash, reg }; | ||
declare function perms(str: string[]): string[] | ||
export { def, array, keep, all, sent, dash, reg, perms }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8830
150
1
+ Added@types/node@^14.14.10
+ Added@types/node@14.18.63(transitive)