Comparing version 6.1.0 to 6.2.0
@@ -18,10 +18,4 @@ { | ||
}, | ||
"exclude": [ | ||
"coverage", | ||
"node_modules", | ||
"test" | ||
], | ||
"include": [ | ||
"**/*.js" | ||
] | ||
} | ||
"exclude": ["coverage", "node_modules", "test"], | ||
"include": ["**/*.js"] | ||
} |
'use strict'; | ||
const whitespaceSequence = /\s+/; | ||
/** | ||
@@ -67,8 +69,9 @@ * Convert a variable name string to camelback style. | ||
exports.split = function split(name) { | ||
name = name | ||
return name | ||
.replace(/[^a-z0-9]+/gi, ' ') | ||
.replace(/([A-Z0-9]+)([A-Z][a-z])/g, '$1 $2') | ||
.replace(/([a-z0-9])([A-Z])/g, '$1 $2') | ||
.toLowerCase(); | ||
return name.trim().split(/\s+/); | ||
.toLowerCase() | ||
.trim() | ||
.split(whitespaceSequence); | ||
}; | ||
@@ -75,0 +78,0 @@ |
{ | ||
"name": "varname", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"description": "Convert strings between different variable naming formats", | ||
@@ -21,16 +21,13 @@ "keywords": [ | ||
"engines": { | ||
"node": "18.x || 20.x", | ||
"npm": "8.x || 9.x || 10.x" | ||
"node": "18.x || 20.x || 22.x" | ||
}, | ||
"scripts": { | ||
"verify": "npm run verify:biome && npm run verify:types", | ||
"verify:biome": "biome check", | ||
"build": "npm run build:types", | ||
"build:types": "tsc --noEmit false --emitDeclarationOnly --project ./jsconfig.json", | ||
"verify": "npm run verify:eslint && npm run verify:types", | ||
"verify:eslint": "eslint .", | ||
"verify:types": "tsc --noEmit --project ./jsconfig.json", | ||
"test:unit": "mocha 'test/unit/**/*.test.js'", | ||
"test:unit": "cd test/unit && node --test", | ||
"test:coverage": "nyc npm run test:unit", | ||
"test": "npm run test:coverage", | ||
"project:verify": "npx --yes @rowanmanning/validate-project@3 --type git node-library", | ||
"project:fix": "npx --yes @rowanmanning/validate-project@3 --type git node-library --fix", | ||
"prepare": "husky" | ||
@@ -41,6 +38,4 @@ }, | ||
"@commitlint/config-conventional": "^18.4.2", | ||
"@rowanmanning/eslint-config": "^8.0.0", | ||
"eslint": "^8.10.0", | ||
"@rowanmanning/biome-config": "^1.2.0", | ||
"husky": "^9.0.7", | ||
"mocha": "^10.0.0", | ||
"nyc": "^15.1.0", | ||
@@ -57,6 +52,3 @@ "testdouble": "^3.16.4", | ||
] | ||
}, | ||
"mocha": { | ||
"timeout": 10000 | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
7
7971
110