utilitish 0.0.23 → 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.
@@ -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,4 +1,4 @@
1
- import { Selector } from '../utils/core.utils';
1
+ import { Selector } from '../utils/core.utils.js';
2
2
  declare global {
3
3
  interface Array<T> {
4
4
  /**
@@ -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, type 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 } from './utils/slugify.config';
8
+ export { getSlugifyConfig, resetSlugifyConfig, setSlugifyConfig, SlugifyConfig } from './utils/slugify.config.js';
@@ -1,4 +1,4 @@
1
- import { defineIfNotExists, utilitishError } from '../utils/core.utils';
1
+ import { defineIfNotExists, utilitishError } from '../utils/core.utils.js';
2
2
  /**
3
3
  * @see Map.prototype.toList
4
4
  */
@@ -1,4 +1,4 @@
1
- import { defineIfNotExists, utilitishError } from '../utils/core.utils';
1
+ import { defineIfNotExists, utilitishError } from '../utils/core.utils.js';
2
2
  /**
3
3
  * @see Object.prototype.deepClone
4
4
  */
@@ -1,4 +1,4 @@
1
- import { defineIfNotExists, utilitishError } from '../utils/core.utils';
1
+ import { defineIfNotExists, utilitishError } from '../utils/core.utils.js';
2
2
  /**
3
3
  * @see Set.prototype.toList
4
4
  */
@@ -1 +1 @@
1
- import '../set/set-prototype';
1
+ import '../set/set-prototype.js';
@@ -1,4 +1,4 @@
1
- import '../set/set-prototype';
1
+ import '../set/set-prototype.js';
2
2
  describe('Set.prototype', () => {
3
3
  describe('toList()', () => {
4
4
  it('should return array with all values in insertion order', () => {
@@ -69,10 +69,17 @@ describe('Set.prototype', () => {
69
69
  const b = new Set([2, 3]);
70
70
  expect(a.union(b)).toEqual(new Set([1, 2, 3]));
71
71
  });
72
+ it('should work with multiple inputs', () => {
73
+ const a = new Set([1, 2]);
74
+ const b = new Set([2, 3]);
75
+ const c = new Set([2, 4]);
76
+ expect(a.union(b, c)).toEqual(new Set([1, 2, 3, 4]));
77
+ });
72
78
  });
73
79
  describe('with no arguments', () => {
74
80
  it('should return a copy of the Set when no arguments provided', () => {
75
81
  const a = new Set([1, 2]);
82
+ // @ts-nocheck
76
83
  expect(a.union()).toEqual(new Set([1, 2]));
77
84
  });
78
85
  });
@@ -1,4 +1,4 @@
1
- import { SlugifyConfig } from '../utils/slugify.config';
1
+ import { SlugifyConfig } from '../utils/slugify.config.js';
2
2
  declare global {
3
3
  interface String {
4
4
  /**
@@ -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[];
@@ -1,4 +1,4 @@
1
- import { isNumberOrString, resolveSelector } from './core.utils';
1
+ import { isNumberOrString, resolveSelector } from './core.utils.js';
2
2
  export function sortBy(arr, direction, selector) {
3
3
  if (arr.length === 0)
4
4
  return arr.slice();
@@ -1,4 +1,4 @@
1
- import { sortBy } from './logic.utils';
1
+ import { sortBy } from './logic.utils.js';
2
2
  describe('logic.utils', () => {
3
3
  describe('sortBy()', () => {
4
4
  describe('with primitive arrays', () => {
@@ -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
- constructor() {
137
- this.customReplacements = {};
138
- this.separator = '-';
139
- this.case = 'lower';
140
- this.removeAccents = true;
141
- this.transformers = [];
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilitish",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/FDonovan12/utilitish.git"