codemaker 1.111.0 → 1.113.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/case-utils.js +3 -4
- package/package.json +2 -2
package/lib/case-utils.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toCamelCase = toCamelCase;
|
|
4
|
+
exports.toPascalCase = toPascalCase;
|
|
5
|
+
exports.toSnakeCase = toSnakeCase;
|
|
4
6
|
const camelcase = require("camelcase");
|
|
5
7
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
6
8
|
const decamelize = require("decamelize");
|
|
@@ -8,11 +10,9 @@ const COMMON_ABBREVIATIONS = ['KiB', 'MiB', 'GiB'];
|
|
|
8
10
|
function toCamelCase(...args) {
|
|
9
11
|
return camelcase(args);
|
|
10
12
|
}
|
|
11
|
-
exports.toCamelCase = toCamelCase;
|
|
12
13
|
function toPascalCase(...args) {
|
|
13
14
|
return camelcase(args, { pascalCase: true });
|
|
14
15
|
}
|
|
15
|
-
exports.toPascalCase = toPascalCase;
|
|
16
16
|
const ABBREV_RE = new RegExp(`(^|[^A-Z])(${COMMON_ABBREVIATIONS.map(regexQuote).join('|')})($|[^a-z])`, 'g');
|
|
17
17
|
function toSnakeCase(s, separator = '_') {
|
|
18
18
|
// Save common abbrevations
|
|
@@ -22,7 +22,6 @@ function toSnakeCase(s, separator = '_') {
|
|
|
22
22
|
return str.slice(0, 1).toUpperCase() + str.slice(1).toLowerCase();
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
exports.toSnakeCase = toSnakeCase;
|
|
26
25
|
function regexQuote(s) {
|
|
27
26
|
return s.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&');
|
|
28
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codemaker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.113.0",
|
|
4
4
|
"description": "A tiny utility for generating source code",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"main": "lib/index.js",
|
|
23
23
|
"types": "lib/index.d.ts",
|
|
24
24
|
"scripts": {
|
|
25
|
-
"build": "tsc --build &&
|
|
25
|
+
"build": "tsc --build && yarn lint",
|
|
26
26
|
"watch": "tsc --build -w",
|
|
27
27
|
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .js,.ts --ignore-path=.gitignore",
|
|
28
28
|
"lint:fix": "yarn lint --fix",
|