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 2021.3.0-1 to 2022.2.5-3

lib/data/server-to-client-data-type.js

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();
}

13

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

@@ -27,15 +27,6 @@ "main": "commonjs/src/index.js",

"devDependencies": {
"chai": "^3.5.0",
"glob": "^7.1.3",
"istanbul": "^0.4.5",
"mkdirp": "^0.5.1",
"mocha": "^6.1.4",
"mocha-teamcity-reporter": "^2.5.1",
"nyc": "^14.0.0",
"pragma-testing": "^1.0.6",
"puppeteer": "^1.11.0",
"puppeteer-to-istanbul": "^1.2.2",
"sinon": "^2.4.1",
"local-web-server": "2.6.1"
"pragma-testing": "2022.4.0-1"
}
}
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