@excofy/utils 1.0.3 → 1.0.4
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/dist/index.cjs +9 -2
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +7 -1
- package/package.json +1 -1
- package/src/helpers/string.ts +4 -0
- package/src/index.ts +8 -1
package/dist/index.cjs
CHANGED
|
@@ -33,7 +33,8 @@ __export(index_exports, {
|
|
|
33
33
|
createValidator: () => createValidator,
|
|
34
34
|
htmlEntityDecode: () => htmlEntityDecode,
|
|
35
35
|
numberUtils: () => number_exports,
|
|
36
|
-
slugUtils: () => slug_exports
|
|
36
|
+
slugUtils: () => slug_exports,
|
|
37
|
+
stringUtils: () => stringUtils
|
|
37
38
|
});
|
|
38
39
|
module.exports = __toCommonJS(index_exports);
|
|
39
40
|
|
|
@@ -480,6 +481,11 @@ function createValidator() {
|
|
|
480
481
|
};
|
|
481
482
|
}
|
|
482
483
|
|
|
484
|
+
// src/helpers/string.ts
|
|
485
|
+
var stringUtils = {
|
|
486
|
+
removeFileExtension: (fileName) => fileName.replace(/\.[^/.]+$/, "")
|
|
487
|
+
};
|
|
488
|
+
|
|
483
489
|
// src/helpers/slug.ts
|
|
484
490
|
var slug_exports = {};
|
|
485
491
|
__export(slug_exports, {
|
|
@@ -522,5 +528,6 @@ var toDecimal = (value) => {
|
|
|
522
528
|
createValidator,
|
|
523
529
|
htmlEntityDecode,
|
|
524
530
|
numberUtils,
|
|
525
|
-
slugUtils
|
|
531
|
+
slugUtils,
|
|
532
|
+
stringUtils
|
|
526
533
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -93,6 +93,10 @@ declare function createValidator<TRaw extends Record<string, TInputValue>, TPars
|
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
+
declare const stringUtils: {
|
|
97
|
+
removeFileExtension: (fileName: string) => string;
|
|
98
|
+
};
|
|
99
|
+
|
|
96
100
|
/**
|
|
97
101
|
* Generates a unique slug by appending a numeric suffix to the base slug if necessary.
|
|
98
102
|
*
|
|
@@ -155,4 +159,4 @@ declare namespace number {
|
|
|
155
159
|
export { number_toCents as toCents, number_toDecimal as toDecimal };
|
|
156
160
|
}
|
|
157
161
|
|
|
158
|
-
export { createValidator, htmlEntityDecode, number as numberUtils, slug as slugUtils };
|
|
162
|
+
export { createValidator, htmlEntityDecode, number as numberUtils, slug as slugUtils, stringUtils };
|
package/dist/index.d.ts
CHANGED
|
@@ -93,6 +93,10 @@ declare function createValidator<TRaw extends Record<string, TInputValue>, TPars
|
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
+
declare const stringUtils: {
|
|
97
|
+
removeFileExtension: (fileName: string) => string;
|
|
98
|
+
};
|
|
99
|
+
|
|
96
100
|
/**
|
|
97
101
|
* Generates a unique slug by appending a numeric suffix to the base slug if necessary.
|
|
98
102
|
*
|
|
@@ -155,4 +159,4 @@ declare namespace number {
|
|
|
155
159
|
export { number_toCents as toCents, number_toDecimal as toDecimal };
|
|
156
160
|
}
|
|
157
161
|
|
|
158
|
-
export { createValidator, htmlEntityDecode, number as numberUtils, slug as slugUtils };
|
|
162
|
+
export { createValidator, htmlEntityDecode, number as numberUtils, slug as slugUtils, stringUtils };
|
package/dist/index.js
CHANGED
|
@@ -447,6 +447,11 @@ function createValidator() {
|
|
|
447
447
|
};
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
+
// src/helpers/string.ts
|
|
451
|
+
var stringUtils = {
|
|
452
|
+
removeFileExtension: (fileName) => fileName.replace(/\.[^/.]+$/, "")
|
|
453
|
+
};
|
|
454
|
+
|
|
450
455
|
// src/helpers/slug.ts
|
|
451
456
|
var slug_exports = {};
|
|
452
457
|
__export(slug_exports, {
|
|
@@ -488,5 +493,6 @@ export {
|
|
|
488
493
|
createValidator,
|
|
489
494
|
htmlEntityDecode,
|
|
490
495
|
number_exports as numberUtils,
|
|
491
|
-
slug_exports as slugUtils
|
|
496
|
+
slug_exports as slugUtils,
|
|
497
|
+
stringUtils
|
|
492
498
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { createValidator } from './helpers/validator';
|
|
2
2
|
import { htmlEntityDecode } from './helpers/sanitize';
|
|
3
|
+
import { stringUtils } from './helpers/string';
|
|
3
4
|
import * as slugUtils from './helpers/slug';
|
|
4
5
|
import * as numberUtils from './helpers/number';
|
|
5
6
|
|
|
6
|
-
export {
|
|
7
|
+
export {
|
|
8
|
+
createValidator,
|
|
9
|
+
htmlEntityDecode,
|
|
10
|
+
slugUtils,
|
|
11
|
+
numberUtils,
|
|
12
|
+
stringUtils,
|
|
13
|
+
};
|