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

@microsoft/fast-web-utilities

Package Overview
Dependencies
Maintainers
6
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/fast-web-utilities - npm Package Compare versions

Comparing version 5.2.0 to 5.3.0

17

CHANGELOG.json

@@ -5,3 +5,18 @@ {

{
"date": "Sun, 03 Apr 2022 07:09:53 GMT",
"date": "Sun, 17 Apr 2022 07:09:43 GMT",
"tag": "@microsoft/fast-web-utilities_v5.3.0",
"version": "5.3.0",
"comments": {
"minor": [
{
"comment": "Instead of matchAll, used regex replace for pascalCase and added number to add to spinalCase",
"author": "74849806+wannieman98@users.noreply.github.com",
"commit": "14bc5d5f2ae608328eb16ad7e619bab00415f60a",
"package": "@microsoft/fast-web-utilities"
}
]
}
},
{
"date": "Sun, 03 Apr 2022 07:12:01 GMT",
"tag": "@microsoft/fast-web-utilities_v5.2.0",

@@ -8,0 +23,0 @@ "version": "5.2.0",

# Change Log - @microsoft/fast-web-utilities
This log was last generated on Sun, 03 Apr 2022 07:09:53 GMT and should not be manually modified.
This log was last generated on Sun, 17 Apr 2022 07:09:43 GMT and should not be manually modified.
<!-- Start content -->
## 5.3.0
Sun, 17 Apr 2022 07:09:43 GMT
### Minor changes
- Instead of matchAll, used regex replace for pascalCase and added number to add to spinalCase (74849806+wannieman98@users.noreply.github.com)
## 5.2.0
Sun, 03 Apr 2022 07:09:53 GMT
Sun, 03 Apr 2022 07:12:01 GMT

@@ -11,0 +19,0 @@ ### Minor changes

@@ -20,2 +20,3 @@ /**

* Converts a string to Pascal Case
* where the first letter of each compound word is capitalized.
*/

@@ -22,0 +23,0 @@ export declare function pascalCase(value: string): string;

@@ -32,2 +32,3 @@ let uniqueIdCounter = 0;

}
const wordRe = /([A-Z]+[a-z0-9]*|[A-Z]*[a-z0-9]+)/g;
/**

@@ -54,10 +55,28 @@ * Matches all instances of the RegExp in the string. Operates similarly to the

}
const wordRe = /([A-Z]+[a-z0-9]*|[A-Z]*[a-z0-9]+)/g;
/**
* Converts a string to Pascal Case
* where the first letter of each compound word is capitalized.
*/
export function pascalCase(value) {
return matchAll(wordRe, value)
.map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1).toLowerCase()}`)
.join("");
let newValue = `${value}`
.replace(new RegExp(/[-_]+/, "g"), " ")
.replace(new RegExp(/[^\w\s]/, "g"), "")
.replace(/^\s+|\s+$|\s+(?=\s)/g, "")
.replace(new RegExp(/\s+(.)(\w*)/, "g"), ($1, $2, $3) => `${$2.toUpperCase() + $3.toLowerCase()}`)
.replace(new RegExp(/\w/), s => s.toUpperCase());
let firstLowerIdx = 0;
for (let i = 0; i < newValue.length; i++) {
const currChar = newValue.charAt(i);
if (currChar == currChar.toLowerCase()) {
firstLowerIdx = i;
break;
}
}
if (firstLowerIdx > 1) {
newValue =
`${newValue.charAt(0).toUpperCase()}${newValue
.slice(1, firstLowerIdx - 1)
.toLowerCase()}` + newValue.slice(firstLowerIdx - 1);
}
return newValue;
}

@@ -74,5 +93,5 @@ /**

.toLowerCase()}${value.slice(1)}`;
return valueWithLowerCaseFirstLetter.replace(/([A-Z])/g, function (match, group1) {
return valueWithLowerCaseFirstLetter.replace(/([A-Z]|[0-9])/g, function (match, group1) {
return `-${group1.toLowerCase()}`;
});
}

2

package.json
{
"name": "@microsoft/fast-web-utilities",
"description": "FAST web utilities",
"version": "5.2.0",
"version": "5.3.0",
"sideEffects": false,

@@ -6,0 +6,0 @@ "author": {

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