@skmtc/core 0.0.414 → 0.0.415
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/esm/helpers/strings.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export declare const capitalize: (str: string) => string;
|
|
2
2
|
export declare const decapitalize: (str: string) => string;
|
|
3
|
-
type
|
|
4
|
-
str: string;
|
|
3
|
+
type CamelCaseOptions = {
|
|
5
4
|
upperFirst?: boolean;
|
|
6
5
|
};
|
|
7
|
-
export declare const camelCase: (
|
|
6
|
+
export declare const camelCase: (str: string, { upperFirst }?: CamelCaseOptions) => string;
|
|
8
7
|
export {};
|
|
9
8
|
//# sourceMappingURL=strings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/helpers/strings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,MAExC,CAAA;AAED,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,MAE1C,CAAA;AAED,KAAK,
|
|
1
|
+
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/helpers/strings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,MAExC,CAAA;AAED,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,MAE1C,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,SAAS,QAAS,MAAM,mBAAkB,gBAAgB,KAAQ,MAY9E,CAAA"}
|
package/esm/helpers/strings.js
CHANGED
|
@@ -4,7 +4,7 @@ export const capitalize = (str) => {
|
|
|
4
4
|
export const decapitalize = (str) => {
|
|
5
5
|
return str.charAt(0).toLocaleLowerCase() + str.slice(1);
|
|
6
6
|
};
|
|
7
|
-
export const camelCase = (
|
|
7
|
+
export const camelCase = (str, { upperFirst } = {}) => {
|
|
8
8
|
let doCapitalize = Boolean(upperFirst);
|
|
9
9
|
return str.replace(/[^a-zA-Z0-9]+([a-zA-Z0-9]+)/g, (_, matched) => {
|
|
10
10
|
if (doCapitalize) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export declare const capitalize: (str: string) => string;
|
|
2
2
|
export declare const decapitalize: (str: string) => string;
|
|
3
|
-
type
|
|
4
|
-
str: string;
|
|
3
|
+
type CamelCaseOptions = {
|
|
5
4
|
upperFirst?: boolean;
|
|
6
5
|
};
|
|
7
|
-
export declare const camelCase: (
|
|
6
|
+
export declare const camelCase: (str: string, { upperFirst }?: CamelCaseOptions) => string;
|
|
8
7
|
export {};
|
|
9
8
|
//# sourceMappingURL=strings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/helpers/strings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,MAExC,CAAA;AAED,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,MAE1C,CAAA;AAED,KAAK,
|
|
1
|
+
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/helpers/strings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,MAExC,CAAA;AAED,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,MAE1C,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,SAAS,QAAS,MAAM,mBAAkB,gBAAgB,KAAQ,MAY9E,CAAA"}
|
|
@@ -9,7 +9,7 @@ const decapitalize = (str) => {
|
|
|
9
9
|
return str.charAt(0).toLocaleLowerCase() + str.slice(1);
|
|
10
10
|
};
|
|
11
11
|
exports.decapitalize = decapitalize;
|
|
12
|
-
const camelCase = (
|
|
12
|
+
const camelCase = (str, { upperFirst } = {}) => {
|
|
13
13
|
let doCapitalize = Boolean(upperFirst);
|
|
14
14
|
return str.replace(/[^a-zA-Z0-9]+([a-zA-Z0-9]+)/g, (_, matched) => {
|
|
15
15
|
if (doCapitalize) {
|