New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pragma-core

Package Overview
Dependencies
Maintainers
7
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pragma-core - npm Package Compare versions

Comparing version 2022.4.0-4 to 2022.4.0-5

37

lib/utils.js

@@ -22,1 +22,38 @@

}
/**
* Split a camel case string into individual words.
* @param {string} word Word to split
* @param {boolean} capitalise Uppercase first letter (default: true)
* @param {string} ignoreFromChar Ignore character and subseqent string
* @returns {string|*}
*/
export function splitWord(word, capitalise = true, ignoreFromChar = null) {
if (word == null)
return word;
/** Ignore character and subseqent string*/
if (ignoreFromChar != null && ignoreFromChar.length > 0 && word.includes(ignoreFromChar)) {
word = word.split(ignoreFromChar)[0];
}
/** Uppercase first letter */
if (capitalise === true) {
word = `${word.charAt(0).toUpperCase()}${word.slice(1)}`;
}
/** Define expression to identify words */
const expression = /(^[a-z]|[A-Z0-9])[a-z]*/g;
const matches = word.match(expression);
if (matches == null)
return word;
const result = [];
for(const match of matches) {
match.length > 1 ? result.push( ` ${match}`) : result.push(match);
}
return result.join("").trim();
}

2

package.json
{
"name": "pragma-core",
"version": "2022.4.0-4",
"version": "2022.4.0-5",
"description": "The purpose of this module is to provide classes and utility functions that can be reused by the various other pragma modules.",

@@ -5,0 +5,0 @@ "main": "commonjs/src/index.js",

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