@lcap/nasl-utils
Advanced tools
Comparing version 3.11.2-beta.1 to 3.11.2-beta.2
@@ -49,2 +49,22 @@ /** | ||
/** | ||
* 没下划线时,只处理首字母大写 | ||
* 有下划线时,所有字母先处理为小写,首字母大写,下划线后字母大写处理 | ||
*/ | ||
export declare const toPascalCase: (name: string) => string; | ||
/** | ||
* 没下划线时,只处理首字母小写 | ||
* 有下划线时,所有字母先处理为小写,下划线后字母大写处理 | ||
*/ | ||
export declare const toCamelCase: (name: string) => string; | ||
/** | ||
* 没下划线时,除首字母外,大写字母前增加下划线,所有字母均转换为小写 | ||
* 有下划线时,不增加下划线,仅将所有字母转换为小写 | ||
*/ | ||
export declare const toSnakeAllLowerCase: (name: string) => string; | ||
/** | ||
* 没下划线时,除首字母外,大写字母前增加下划线,所有字母均转换为大写 | ||
* 有下划线时,不增加下划线,仅将所有字母转换为大写 | ||
*/ | ||
export declare const toSnakeAllUpperCase: (name: string) => string; | ||
/** | ||
* @param key 键 | ||
@@ -51,0 +71,0 @@ * @param set 数据集合,Array | Map | Set |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDescription = exports.transAssetsToRegx = exports.attrConvertCamelCase = exports.sliceTagContent = exports.getLastOfPath = exports.uniqueMax = exports.unique = exports.firstLowerCase = exports.firstUpperCase = exports.Camel2Snake = exports.Camel2kebab = exports.snake2Camel = exports.kebab2Camel2 = exports.kebab2Pascal = exports.kebab2Camel = void 0; | ||
exports.getDescription = exports.transAssetsToRegx = exports.attrConvertCamelCase = exports.sliceTagContent = exports.getLastOfPath = exports.uniqueMax = exports.unique = exports.toSnakeAllUpperCase = exports.toSnakeAllLowerCase = exports.toCamelCase = exports.toPascalCase = exports.firstLowerCase = exports.firstUpperCase = exports.Camel2Snake = exports.Camel2kebab = exports.snake2Camel = exports.kebab2Camel2 = exports.kebab2Pascal = exports.kebab2Camel = void 0; | ||
/** | ||
@@ -60,2 +60,54 @@ * 中划线格式 转 驼峰格式 kebab-case -> camelCase | ||
/** | ||
* 没下划线时,只处理首字母大写 | ||
* 有下划线时,所有字母先处理为小写,首字母大写,下划线后字母大写处理 | ||
*/ | ||
const toPascalCase = (name) => { | ||
if (name.includes('_')) { | ||
return (0, exports.snake2Camel)(name.toLowerCase(), false); | ||
} | ||
else { | ||
return (0, exports.firstUpperCase)(name); | ||
} | ||
}; | ||
exports.toPascalCase = toPascalCase; | ||
/** | ||
* 没下划线时,只处理首字母小写 | ||
* 有下划线时,所有字母先处理为小写,下划线后字母大写处理 | ||
*/ | ||
const toCamelCase = (name) => { | ||
if (name.includes('_')) { | ||
return (0, exports.snake2Camel)(name.toLowerCase(), true); | ||
} | ||
else { | ||
return (0, exports.firstLowerCase)(name); | ||
} | ||
}; | ||
exports.toCamelCase = toCamelCase; | ||
/** | ||
* 没下划线时,除首字母外,大写字母前增加下划线,所有字母均转换为小写 | ||
* 有下划线时,不增加下划线,仅将所有字母转换为小写 | ||
*/ | ||
const toSnakeAllLowerCase = (name) => { | ||
if (name.includes('_')) { | ||
return name.toLowerCase(); | ||
} | ||
else { | ||
return (0, exports.Camel2Snake)(name).toLowerCase(); | ||
} | ||
}; | ||
exports.toSnakeAllLowerCase = toSnakeAllLowerCase; | ||
/** | ||
* 没下划线时,除首字母外,大写字母前增加下划线,所有字母均转换为大写 | ||
* 有下划线时,不增加下划线,仅将所有字母转换为大写 | ||
*/ | ||
const toSnakeAllUpperCase = (name) => { | ||
if (name.includes('_')) { | ||
return name.toUpperCase(); | ||
} | ||
else { | ||
return (0, exports.Camel2Snake)(name).toUpperCase(); | ||
} | ||
}; | ||
exports.toSnakeAllUpperCase = toSnakeAllUpperCase; | ||
/** | ||
* @param key 键 | ||
@@ -62,0 +114,0 @@ * @param set 数据集合,Array | Map | Set |
{ | ||
"name": "@lcap/nasl-utils", | ||
"description": "NetEase Application Specific Language", | ||
"version": "3.11.2-beta.1", | ||
"version": "3.11.2-beta.2", | ||
"author": "Forrest <rainforest92@126.com>", | ||
@@ -26,3 +26,3 @@ "main": "./out", | ||
"uuid": "8.3.2", | ||
"@lcap/nasl-types": "3.11.2-beta.1" | ||
"@lcap/nasl-types": "3.11.2-beta.2" | ||
}, | ||
@@ -29,0 +29,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
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
137127
2163
+ Added@lcap/nasl-types@3.11.2-beta.2(transitive)
- Removed@lcap/nasl-types@3.11.2-beta.1(transitive)