Comparing version 4.1.1 to 4.1.2
@@ -5,4 +5,7 @@ { | ||
"checkJs": true, | ||
"declaration": true, | ||
"declarationMap": true, | ||
"maxNodeModuleJsDepth": 0, | ||
"module": "commonjs", | ||
"removeComments": true, | ||
"resolveJsonModule": true, | ||
@@ -9,0 +12,0 @@ "strictBindCallApply": true, |
@@ -1,18 +0,7 @@ | ||
/** | ||
* @module varname | ||
*/ | ||
'use strict'; | ||
const varname = module.exports = { | ||
camelback, | ||
camelcase, | ||
dash, | ||
underscore, | ||
split | ||
}; | ||
/** | ||
* Convert a variable name string to camelback style. | ||
* | ||
* @access public | ||
* @public | ||
* @param {string} name | ||
@@ -23,6 +12,6 @@ * The variable name to convert. | ||
*/ | ||
function camelback(name) { | ||
const parts = varname.split(name); | ||
exports.camelback = function camelback(name) { | ||
const parts = exports.split(name); | ||
return parts.shift() + parts.map(titleCase).join(''); | ||
} | ||
}; | ||
@@ -32,3 +21,3 @@ /** | ||
* | ||
* @access public | ||
* @public | ||
* @param {string} name | ||
@@ -39,6 +28,6 @@ * The variable name to convert. | ||
*/ | ||
function camelcase(name) { | ||
const parts = varname.split(name); | ||
exports.camelcase = function camelcase(name) { | ||
const parts = exports.split(name); | ||
return parts.map(titleCase).join(''); | ||
} | ||
}; | ||
@@ -48,3 +37,3 @@ /** | ||
* | ||
* @access public | ||
* @public | ||
* @param {string} name | ||
@@ -55,5 +44,5 @@ * The variable name to convert. | ||
*/ | ||
function dash(name) { | ||
return varname.split(name).join('-'); | ||
} | ||
exports.dash = function dash(name) { | ||
return exports.split(name).join('-'); | ||
}; | ||
@@ -63,3 +52,3 @@ /** | ||
* | ||
* @access public | ||
* @public | ||
* @param {string} name | ||
@@ -70,5 +59,5 @@ * The variable name to convert. | ||
*/ | ||
function underscore(name) { | ||
return varname.split(name).join('_'); | ||
} | ||
exports.underscore = function underscore(name) { | ||
return exports.split(name).join('_'); | ||
}; | ||
@@ -78,3 +67,3 @@ /** | ||
* | ||
* @access public | ||
* @public | ||
* @param {string} name | ||
@@ -85,3 +74,3 @@ * The variable name to split. | ||
*/ | ||
function split(name) { | ||
exports.split = function split(name) { | ||
name = name | ||
@@ -93,3 +82,3 @@ .replace(/[^a-z0-9]+/gi, ' ') | ||
return name.trim().split(/\s+/); | ||
} | ||
}; | ||
@@ -99,3 +88,3 @@ /** | ||
* | ||
* @access private | ||
* @private | ||
* @param {string} string | ||
@@ -109,1 +98,3 @@ * The string to title-case. | ||
} | ||
exports.default = exports; |
{ | ||
"name": "varname", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "Convert strings between different variable naming formats", | ||
@@ -21,6 +21,8 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=14", | ||
"npm": ">=7" | ||
"node": "14.x || 16.x || 18.x", | ||
"npm": "7.x || 8.x" | ||
}, | ||
"scripts": { | ||
"build": "npm run build:types", | ||
"build:types": "tsc --noEmit false --emitDeclarationOnly --project ./jsconfig.json", | ||
"verify": "npm run verify:eslint && npm run verify:types", | ||
@@ -39,3 +41,3 @@ "verify:eslint": "eslint .", | ||
"@commitlint/config-conventional": "^17.0.0", | ||
"@rowanmanning/eslint-config": "^4.0.2", | ||
"@rowanmanning/eslint-config": "^5.0.0", | ||
"chai": "^4.3.6", | ||
@@ -42,0 +44,0 @@ "eslint": "^8.10.0", |
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
8290
7
113