Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-caps

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-caps - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

src/index.ts

5

package.json
{
"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"
}
}

2

README.md

@@ -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 };
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc