utilitish 0.0.24 → 0.0.25
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/array/array-constructor.js +2 -2
- package/dist/array/array-prototype.d.ts +1 -1
- package/dist/array/array-prototype.js +2 -2
- package/dist/index.d.ts +7 -7
- package/dist/index.js +7 -7
- package/dist/map/map-prototype.js +1 -1
- package/dist/object/object-prototype.js +1 -1
- package/dist/set/set-prototype.js +1 -1
- package/dist/set/set-prototype.spec.d.ts +1 -1
- package/dist/set/set-prototype.spec.js +1 -1
- package/dist/string/string-prototype.d.ts +1 -1
- package/dist/string/string-prototype.js +2 -2
- package/dist/string/string-prototype.spec.d.ts +1 -1
- package/dist/string/string-prototype.spec.js +2 -2
- package/dist/utils/core.utils.spec.js +1 -1
- package/dist/utils/logic.utils.d.ts +1 -1
- package/dist/utils/logic.utils.js +1 -1
- package/dist/utils/logic.utils.spec.js +1 -1
- package/dist/utils/slugify.config.js +14 -7
- package/dist/utils/slugify.config.spec.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineStaticIfNotExists } from '../utils/core.utils';
|
|
2
|
-
import { utilitishError } from './../utils/core.utils';
|
|
1
|
+
import { defineStaticIfNotExists } from '../utils/core.utils.js';
|
|
2
|
+
import { utilitishError } from './../utils/core.utils.js';
|
|
3
3
|
/**
|
|
4
4
|
* @see Array.zip
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineIfNotExists, isNumberOrString, resolveSelector, utilitishError } from '../utils/core.utils';
|
|
2
|
-
import { sortBy } from '../utils/logic.utils';
|
|
1
|
+
import { defineIfNotExists, isNumberOrString, resolveSelector, utilitishError } from '../utils/core.utils.js';
|
|
2
|
+
import { sortBy } from '../utils/logic.utils.js';
|
|
3
3
|
/**
|
|
4
4
|
* @see Array.prototype.first
|
|
5
5
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import './array/array-constructor';
|
|
2
|
-
import './array/array-prototype';
|
|
3
|
-
import './map/map-prototype';
|
|
4
|
-
import './object/object-prototype';
|
|
5
|
-
import './set/set-prototype';
|
|
6
|
-
import './string/string-prototype';
|
|
7
|
-
export { getSlugifyConfig, resetSlugifyConfig, setSlugifyConfig, SlugifyConfig } from './utils/slugify.config';
|
|
1
|
+
import './array/array-constructor.js';
|
|
2
|
+
import './array/array-prototype.js';
|
|
3
|
+
import './map/map-prototype.js';
|
|
4
|
+
import './object/object-prototype.js';
|
|
5
|
+
import './set/set-prototype.js';
|
|
6
|
+
import './string/string-prototype.js';
|
|
7
|
+
export { getSlugifyConfig, resetSlugifyConfig, setSlugifyConfig, SlugifyConfig } from './utils/slugify.config.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import './array/array-constructor';
|
|
2
|
-
import './array/array-prototype';
|
|
3
|
-
import './map/map-prototype';
|
|
4
|
-
import './object/object-prototype';
|
|
5
|
-
import './set/set-prototype';
|
|
6
|
-
import './string/string-prototype';
|
|
1
|
+
import './array/array-constructor.js';
|
|
2
|
+
import './array/array-prototype.js';
|
|
3
|
+
import './map/map-prototype.js';
|
|
4
|
+
import './object/object-prototype.js';
|
|
5
|
+
import './set/set-prototype.js';
|
|
6
|
+
import './string/string-prototype.js';
|
|
7
7
|
// Export slugify configuration functions
|
|
8
|
-
export { getSlugifyConfig, resetSlugifyConfig, setSlugifyConfig, SlugifyConfig } from './utils/slugify.config';
|
|
8
|
+
export { getSlugifyConfig, resetSlugifyConfig, setSlugifyConfig, SlugifyConfig } from './utils/slugify.config.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '../set/set-prototype';
|
|
1
|
+
import '../set/set-prototype.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineIfNotExists, utilitishError } from '../utils/core.utils';
|
|
2
|
-
import { slugifyString } from '../utils/slugify.config';
|
|
1
|
+
import { defineIfNotExists, utilitishError } from '../utils/core.utils.js';
|
|
2
|
+
import { slugifyString } from '../utils/slugify.config.js';
|
|
3
3
|
/**
|
|
4
4
|
* @see String.prototype.splitWords
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '../string/string-prototype';
|
|
1
|
+
import '../string/string-prototype.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '../string/string-prototype';
|
|
2
|
-
import { resetSlugifyConfig, setSlugifyConfig, SlugifyConfig } from '../utils/slugify.config';
|
|
1
|
+
import '../string/string-prototype.js';
|
|
2
|
+
import { resetSlugifyConfig, setSlugifyConfig, SlugifyConfig } from '../utils/slugify.config.js';
|
|
3
3
|
describe('String.prototype', () => {
|
|
4
4
|
describe('capitalize()', () => {
|
|
5
5
|
it('should capitalize the first character', () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assertValidSelector, defineIfNotExists, defineStaticIfNotExists, isNumberOrString, resolveSelector, utilitishError, } from './core.utils';
|
|
1
|
+
import { assertValidSelector, defineIfNotExists, defineStaticIfNotExists, isNumberOrString, resolveSelector, utilitishError, } from './core.utils.js';
|
|
2
2
|
describe('core.utils', () => {
|
|
3
3
|
describe('defineIfNotExists()', () => {
|
|
4
4
|
it('should define a new method on a prototype', () => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Selector } from './core.utils';
|
|
1
|
+
import { Selector } from './core.utils.js';
|
|
2
2
|
export declare function sortBy<T>(arr: T[], direction: 'asc' | 'desc', selector?: Selector<T, number | string>): T[];
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
* Provides comprehensive customization options for URL slug generation.
|
|
4
4
|
*/
|
|
5
5
|
export class SlugifyConfig {
|
|
6
|
+
_customReplacements;
|
|
7
|
+
_separator;
|
|
8
|
+
_case;
|
|
9
|
+
_removeAccents;
|
|
10
|
+
_allowedChars;
|
|
11
|
+
_maxLength;
|
|
12
|
+
_transformers;
|
|
6
13
|
constructor(builder) {
|
|
7
14
|
this._customReplacements = builder.customReplacements;
|
|
8
15
|
this._separator = builder.separator;
|
|
@@ -133,13 +140,13 @@ export class SlugifyConfig {
|
|
|
133
140
|
}
|
|
134
141
|
}
|
|
135
142
|
export class SlugifyConfigBuilder {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
customReplacements = {};
|
|
144
|
+
separator = '-';
|
|
145
|
+
case = 'lower';
|
|
146
|
+
removeAccents = true;
|
|
147
|
+
allowedChars;
|
|
148
|
+
maxLength;
|
|
149
|
+
transformers = [];
|
|
143
150
|
withCustomReplacements(replacements) {
|
|
144
151
|
this.customReplacements = { ...replacements };
|
|
145
152
|
return this;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SlugifyConfig, assertCharClass, assertSlugifyConfig, getDefaultSlugifyConfig, getSlugifyConfig, resetSlugifyConfig, setSlugifyConfig, } from './slugify.config';
|
|
1
|
+
import { SlugifyConfig, assertCharClass, assertSlugifyConfig, getDefaultSlugifyConfig, getSlugifyConfig, resetSlugifyConfig, setSlugifyConfig, } from './slugify.config.js';
|
|
2
2
|
describe('slugify.config', () => {
|
|
3
3
|
afterEach(() => {
|
|
4
4
|
resetSlugifyConfig();
|