toolbox-x 2.4.1 → 2.4.2

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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to **toolbox-x** will be documented in this file.
4
4
 
5
5
  > Auto-generated from git history using [changelog-maker](https://github.com/nodejs/changelog-maker).
6
6
 
7
+ ## [v2.4.2](https://github.com/nazmul-nhb/toolbox-x/releases/tag/v2.4.2) — 2026-06-17
8
+
9
+ [Compare changes](https://github.com/nazmul-nhb/toolbox-x/compare/v2.4.1...v2.4.2)
10
+
11
+ * \[[`9ce8196718`](https://github.com/nazmul-nhb/toolbox-x/commit/9ce8196718)] - 🔧 update(string-diff): updated type defs and docs for diff utils (Nazmul Hassan)
12
+ * \[[`6bd96bf45d`](https://github.com/nazmul-nhb/toolbox-x/commit/6bd96bf45d)] - 📚 docs: updated CHANGELOG.md for v2.4.1 (github-actions\[bot])
13
+
7
14
  ## [v2.4.1](https://github.com/nazmul-nhb/toolbox-x/releases/tag/v2.4.1) — 2026-06-17
8
15
 
9
16
  [Compare changes](https://github.com/nazmul-nhb/toolbox-x/compare/v2.4.0...v2.4.1)
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { I as RandomIdOptions } from "./string-GQsmDdYa.mjs";
17
+ import { z as RandomIdOptions } from "./string-edtZyJHf.mjs";
18
18
 
19
19
  //#region src/string/basics.d.ts
20
20
  /**
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { I as RandomIdOptions } from "./string-EMT7czsU.cjs";
17
+ import { z as RandomIdOptions } from "./string-Ok_IMpHP.cjs";
18
18
 
19
19
  //#region src/string/basics.d.ts
20
20
  /**
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { A as KebabCase, B as StringCaseOptions, E as DotCase, H as TrainCase, L as SentenceCase, M as PascalCase, N as PascalSnakeCase, P as PathCase, R as SnakeCase, V as TitleCase, _ as ConstantCase, h as CaseFormat, m as CapitalizeOptions, p as CamelCase, u as $WidenEmpty } from "./string-GQsmDdYa.mjs";
17
+ import { F as PascalCase, G as TitleCase, H as SnakeCase, I as PascalSnakeCase, K as TrainCase, L as PathCase, N as KebabCase, V as SentenceCase, W as StringCaseOptions, g as CaseFormat, h as CapitalizeOptions, k as DotCase, m as CamelCase, u as $WidenEmpty, v as ConstantCase } from "./string-Ok_IMpHP.cjs";
18
18
 
19
19
  //#region src/string/case.d.ts
20
20
  /**
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { A as KebabCase, B as StringCaseOptions, E as DotCase, H as TrainCase, L as SentenceCase, M as PascalCase, N as PascalSnakeCase, P as PathCase, R as SnakeCase, V as TitleCase, _ as ConstantCase, h as CaseFormat, m as CapitalizeOptions, p as CamelCase, u as $WidenEmpty } from "./string-EMT7czsU.cjs";
17
+ import { F as PascalCase, G as TitleCase, H as SnakeCase, I as PascalSnakeCase, K as TrainCase, L as PathCase, N as KebabCase, V as SentenceCase, W as StringCaseOptions, g as CaseFormat, h as CapitalizeOptions, k as DotCase, m as CamelCase, u as $WidenEmpty, v as ConstantCase } from "./string-edtZyJHf.mjs";
18
18
 
19
19
  //#region src/string/case.d.ts
20
20
  /**
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { a as toDotCase, c as toPascalSnakeCase, d as toSnakeCase, f as toTitleCase, i as toConstantCase, l as toPathCase, n as convertStringCase, o as toKebabCase, p as toTrainCase, r as toCamelCase, s as toPascalCase, t as capitalizeString, u as toSentenceCase } from "./case-DMCkxWbW.cjs";
17
+ import { a as toDotCase, c as toPascalSnakeCase, d as toSnakeCase, f as toTitleCase, i as toConstantCase, l as toPathCase, n as convertStringCase, o as toKebabCase, p as toTrainCase, r as toCamelCase, s as toPascalCase, t as capitalizeString, u as toSentenceCase } from "./case-BmB2aGyp.cjs";
18
18
  export { capitalizeString, convertStringCase, toCamelCase, toConstantCase, toDotCase, toKebabCase, toPascalCase, toPascalSnakeCase, toPathCase, toSentenceCase, toSnakeCase, toTitleCase, toTrainCase };
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { a as toDotCase, c as toPascalSnakeCase, d as toSnakeCase, f as toTitleCase, i as toConstantCase, l as toPathCase, n as convertStringCase, o as toKebabCase, p as toTrainCase, r as toCamelCase, s as toPascalCase, t as capitalizeString, u as toSentenceCase } from "./case-CcoD-jFV.mjs";
17
+ import { a as toDotCase, c as toPascalSnakeCase, d as toSnakeCase, f as toTitleCase, i as toConstantCase, l as toPathCase, n as convertStringCase, o as toKebabCase, p as toTrainCase, r as toCamelCase, s as toPascalCase, t as capitalizeString, u as toSentenceCase } from "./case-Ce8HJI8I.mjs";
18
18
  export { capitalizeString, convertStringCase, toCamelCase, toConstantCase, toDotCase, toKebabCase, toPascalCase, toPascalSnakeCase, toPathCase, toSentenceCase, toSnakeCase, toTitleCase, toTrainCase };
@@ -15,8 +15,8 @@
15
15
  */
16
16
 
17
17
  import { J as Deserializer, ft as Serializer, y as GenericObject } from "../object-DyVg8BFt.cjs";
18
- import { a as updateQueryParam, i as parseQueryStringLiteral, n as getQueryParams, r as parseQueryString, t as generateQueryParams } from "../query-BLsaWi3q.cjs";
19
- import { a as OriginFileObj, i as FormDataConfigs, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "../form-DA-YShnM.cjs";
18
+ import { a as updateQueryParam, i as parseQueryStringLiteral, n as getQueryParams, r as parseQueryString, t as generateQueryParams } from "../query-BMtRmMSC.cjs";
19
+ import { a as OriginFileObj, i as FormDataConfigs, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "../form-DhsFvo_D.cjs";
20
20
 
21
21
  //#region src/dom/storage.d.ts
22
22
  /**
@@ -15,8 +15,8 @@
15
15
  */
16
16
 
17
17
  import { J as Deserializer, ft as Serializer, y as GenericObject } from "../object-DyVg8BFt.mjs";
18
- import { a as updateQueryParam, i as parseQueryStringLiteral, n as getQueryParams, r as parseQueryString, t as generateQueryParams } from "../query-Bi_ofCBp.mjs";
19
- import { a as OriginFileObj, i as FormDataConfigs, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "../form-DIYoIS0E.mjs";
18
+ import { a as updateQueryParam, i as parseQueryStringLiteral, n as getQueryParams, r as parseQueryString, t as generateQueryParams } from "../query-C-r5ZbO-.mjs";
19
+ import { a as OriginFileObj, i as FormDataConfigs, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "../form-D_5I437n.mjs";
20
20
 
21
21
  //#region src/dom/storage.d.ts
22
22
  /**
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { S as KeyForObject, T as NestedKeyString, ai as RequireExactly, at as NormalPrimitive, u as DotNotationKey, x as KeyForArray } from "./object-DyVg8BFt.mjs";
18
- import { F as QueryString } from "./string-GQsmDdYa.mjs";
18
+ import { R as QueryString } from "./string-edtZyJHf.mjs";
19
19
  import { f as TypeOrArray } from "./array-CbAKXvhH.mjs";
20
20
 
21
21
  //#region src/types/form.d.ts
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { S as KeyForObject, T as NestedKeyString, ai as RequireExactly, at as NormalPrimitive, u as DotNotationKey, x as KeyForArray } from "./object-DyVg8BFt.cjs";
18
- import { F as QueryString } from "./string-EMT7czsU.cjs";
18
+ import { R as QueryString } from "./string-Ok_IMpHP.cjs";
19
19
  import { f as TypeOrArray } from "./array-EVkwcL_k.cjs";
20
20
 
21
21
  //#region src/types/form.d.ts
@@ -17,7 +17,7 @@
17
17
  import { nt as Maybe, y as GenericObject } from "../object-DyVg8BFt.cjs";
18
18
  import { _ as VerifiedToken, d as SignetPayload, l as SignOptions, p as TokenString, s as DecodedToken, v as VerifyOptions } from "../hash-DHawpylk.cjs";
19
19
  import { a as isUUIDv4, c as isUUIDv7, i as isUUIDv3, l as isUUIDv8, n as isUUIDv1, o as isUUIDv5, r as isUUIDv2, s as isUUIDv6, t as decodeUUID, u as uuid, w as isUUID } from "../uuid-CMNRM9NO.cjs";
20
- import { t as generateRandomID } from "../basics-DlwGpXu-.cjs";
20
+ import { t as generateRandomID } from "../basics-CLwtIxap.cjs";
21
21
 
22
22
  //#region src/hash/Cipher.d.ts
23
23
  /**
@@ -17,7 +17,7 @@
17
17
  import { nt as Maybe, y as GenericObject } from "../object-DyVg8BFt.mjs";
18
18
  import { _ as VerifiedToken, d as SignetPayload, l as SignOptions, p as TokenString, s as DecodedToken, v as VerifyOptions } from "../hash-2mygGWLk.mjs";
19
19
  import { a as isUUIDv4, c as isUUIDv7, i as isUUIDv3, l as isUUIDv8, n as isUUIDv1, o as isUUIDv5, r as isUUIDv2, s as isUUIDv6, t as decodeUUID, u as uuid, w as isUUID } from "../uuid-DvQsIl9p.mjs";
20
- import { t as generateRandomID } from "../basics-DY7AX7D4.mjs";
20
+ import { t as generateRandomID } from "../basics-BuHQJCNG.mjs";
21
21
 
22
22
  //#region src/hash/Cipher.d.ts
23
23
  /**
package/dist/index.cjs CHANGED
@@ -274,10 +274,8 @@ function computeTextDiff(originalText, modifiedText) {
274
274
  usedIndices.add(idx);
275
275
  }
276
276
  } else if (line.type !== "added" || !usedIndices.has(idx)) {
277
- if (line.type !== "added" || !usedIndices.has(idx)) {
278
- processedLines.push(line);
279
- usedIndices.add(idx);
280
- }
277
+ processedLines.push(line);
278
+ usedIndices.add(idx);
281
279
  }
282
280
  }
283
281
  let linesAdded = 0;
package/dist/index.d.cts CHANGED
@@ -15,12 +15,12 @@
15
15
  */
16
16
 
17
17
  import { $n as NumberType, Bn as DecimalOptions, D as NumericDotKey, E as NestedPrimitiveKey, F as SanitizeOptions, I as SanitizedData, In as BnDigitResult, Ln as ConvertOptions, O as ObjectEntry, Q as FlattenPartial, Rn as ConvertedDecimal, Un as FrankFurterCurrency, V as BasicPrimitive, Xn as LocaleCode, Zn as LooseRomanNumeral, a as ConvertObjectOptions, ar as RomanCapital, c as DeepKeys, ci as Tuple, ct as Numeric, g as FlattenDotValue, ir as RangedNumbers, k as Objects, lt as OwnKeys, nr as RandomNumberOptions, nt as Maybe, o as ConvertedObject, p as ExpandAll, pi as Unit, rr as RangeOptions, s as CountryDetails, tr as PercentageOptions, u as DotNotationKey, ut as PartialOrRequired, v as FlattenLeafValue, w as MergeAll, y as GenericObject, z as Any, zn as CurrencyCode } from "./object-DyVg8BFt.cjs";
18
- import { T as DiffResult, f as AnagramOptions, g as CharDiffResult, j as MaskOptions } from "./string-EMT7czsU.cjs";
19
- import { n as convertStringCase, t as capitalizeString } from "./case-DMCkxWbW.cjs";
20
- import { i as parseQueryStringLiteral, r as parseQueryString, t as generateQueryParams } from "./query-BLsaWi3q.cjs";
18
+ import { D as DiffResult, P as MaskOptions, _ as CharDiffResult, p as AnagramOptions } from "./string-Ok_IMpHP.cjs";
19
+ import { n as convertStringCase, t as capitalizeString } from "./case-BmB2aGyp.cjs";
20
+ import { i as parseQueryStringLiteral, r as parseQueryString, t as generateQueryParams } from "./query-BMtRmMSC.cjs";
21
21
  import { c as OrderOption, l as SortByOption, n as FindOptions, s as OptionsConfig, t as FieldValue, u as SortNature } from "./array-EVkwcL_k.cjs";
22
22
  import { C as shuffleArray, S as isInvalidOrEmptyArray, _ as findPrimeNumbers, a as deepParsePrimitives, b as flattenArray, c as getInstanceGetterNames, d as getStaticMethodNames, f as isDeepEqual, g as throttleAction, h as stripJsonEdgeGarbage, i as debounceAction, l as getInstanceMethodNames, m as stableStringify, n as countInstanceMethods, o as definePrototypeMethod, p as parseJSON, r as countStaticMethods, s as getClassDetails, t as convertArrayToString, u as getStaticGetterNames, v as isPrime, x as getLastArrayElement, y as filterArrayOfObjects } from "./index-D00Uqm9S.cjs";
23
- import { n as trimString, r as truncateString, t as generateRandomID } from "./basics-DlwGpXu-.cjs";
23
+ import { n as trimString, r as truncateString, t as generateRandomID } from "./basics-CLwtIxap.cjs";
24
24
 
25
25
  //#region src/string/anagram.d.ts
26
26
  /**
package/dist/index.d.mts CHANGED
@@ -15,12 +15,12 @@
15
15
  */
16
16
 
17
17
  import { $n as NumberType, Bn as DecimalOptions, D as NumericDotKey, E as NestedPrimitiveKey, F as SanitizeOptions, I as SanitizedData, In as BnDigitResult, Ln as ConvertOptions, O as ObjectEntry, Q as FlattenPartial, Rn as ConvertedDecimal, Un as FrankFurterCurrency, V as BasicPrimitive, Xn as LocaleCode, Zn as LooseRomanNumeral, a as ConvertObjectOptions, ar as RomanCapital, c as DeepKeys, ci as Tuple, ct as Numeric, g as FlattenDotValue, ir as RangedNumbers, k as Objects, lt as OwnKeys, nr as RandomNumberOptions, nt as Maybe, o as ConvertedObject, p as ExpandAll, pi as Unit, rr as RangeOptions, s as CountryDetails, tr as PercentageOptions, u as DotNotationKey, ut as PartialOrRequired, v as FlattenLeafValue, w as MergeAll, y as GenericObject, z as Any, zn as CurrencyCode } from "./object-DyVg8BFt.mjs";
18
- import { T as DiffResult, f as AnagramOptions, g as CharDiffResult, j as MaskOptions } from "./string-GQsmDdYa.mjs";
19
- import { n as convertStringCase, t as capitalizeString } from "./case-CcoD-jFV.mjs";
20
- import { i as parseQueryStringLiteral, r as parseQueryString, t as generateQueryParams } from "./query-Bi_ofCBp.mjs";
18
+ import { D as DiffResult, P as MaskOptions, _ as CharDiffResult, p as AnagramOptions } from "./string-edtZyJHf.mjs";
19
+ import { n as convertStringCase, t as capitalizeString } from "./case-Ce8HJI8I.mjs";
20
+ import { i as parseQueryStringLiteral, r as parseQueryString, t as generateQueryParams } from "./query-C-r5ZbO-.mjs";
21
21
  import { c as OrderOption, l as SortByOption, n as FindOptions, s as OptionsConfig, t as FieldValue, u as SortNature } from "./array-CbAKXvhH.mjs";
22
22
  import { C as shuffleArray, S as isInvalidOrEmptyArray, _ as findPrimeNumbers, a as deepParsePrimitives, b as flattenArray, c as getInstanceGetterNames, d as getStaticMethodNames, f as isDeepEqual, g as throttleAction, h as stripJsonEdgeGarbage, i as debounceAction, l as getInstanceMethodNames, m as stableStringify, n as countInstanceMethods, o as definePrototypeMethod, p as parseJSON, r as countStaticMethods, s as getClassDetails, t as convertArrayToString, u as getStaticGetterNames, v as isPrime, x as getLastArrayElement, y as filterArrayOfObjects } from "./index-BbBnKdBb.mjs";
23
- import { n as trimString, r as truncateString, t as generateRandomID } from "./basics-DY7AX7D4.mjs";
23
+ import { n as trimString, r as truncateString, t as generateRandomID } from "./basics-BuHQJCNG.mjs";
24
24
 
25
25
  //#region src/string/anagram.d.ts
26
26
  /**
package/dist/index.mjs CHANGED
@@ -273,10 +273,8 @@ function computeTextDiff(originalText, modifiedText) {
273
273
  usedIndices.add(idx);
274
274
  }
275
275
  } else if (line.type !== "added" || !usedIndices.has(idx)) {
276
- if (line.type !== "added" || !usedIndices.has(idx)) {
277
- processedLines.push(line);
278
- usedIndices.add(idx);
279
- }
276
+ processedLines.push(line);
277
+ usedIndices.add(idx);
280
278
  }
281
279
  }
282
280
  let linesAdded = 0;
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { M as ParsedQueryGeneric, N as QueryObject, j as ParsedQuery } from "./object-DyVg8BFt.cjs";
18
- import { F as QueryString } from "./string-EMT7czsU.cjs";
18
+ import { R as QueryString } from "./string-Ok_IMpHP.cjs";
19
19
 
20
20
  //#region src/dom/query.d.ts
21
21
  /**
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { M as ParsedQueryGeneric, N as QueryObject, j as ParsedQuery } from "./object-DyVg8BFt.mjs";
18
- import { F as QueryString } from "./string-GQsmDdYa.mjs";
18
+ import { R as QueryString } from "./string-edtZyJHf.mjs";
19
19
 
20
20
  //#region src/dom/query.d.ts
21
21
  /**
@@ -221,36 +221,57 @@ type IsAlphabet<T extends string> = T extends `${infer Head}${infer Tail}` ? Hea
221
221
  type Alphabet<T extends string> = IsAlphabet<T> extends true ? T : never;
222
222
  /** Types related to string diffing and similarity calculations. */
223
223
  type DiffLineType = 'added' | 'removed' | 'unchanged' | 'modified';
224
- /** A single line difference between two strings, including the type of difference and the content of the line in both original and modified strings. */
225
- interface DiffLine {
226
- /** The type of difference: 'added', 'removed', 'unchanged', or 'modified'. */
227
- type: DiffLineType;
228
- /** The content of the original line. Undefined for added lines. */
229
- original?: string;
230
- /** The content of the modified line. Undefined for removed lines. */
231
- modified?: string;
232
- /** The line number in the original string (1-based). Undefined for added lines. */
233
- originalLineNum?: number;
234
- /** The line number in the modified string (1-based). Undefined for removed lines. */
235
- modifiedLineNum?: number;
224
+ /** Represents a single line's diff status between two strings, including the type of difference and the content of the line in both original and modified strings. */
225
+ type DiffLine = UnchangedOrModifiedDiffLine | AddedDiffLine | RemovedDiffLine;
226
+ /** Represents the details of a single line in the diff, including its content and line number. */
227
+ interface DiffLineDetails {
228
+ /** The content of the original line, omitted for `added` lines. */
229
+ original: string;
230
+ /** The content of the modified line, omitted for `removed` lines. */
231
+ modified: string;
232
+ /** The line number in the original string (1-based), omitted for `added` lines. */
233
+ originalLineNum: number;
234
+ /** The line number in the modified string (1-based), omitted for `removed` lines. */
235
+ modifiedLineNum: number;
236
+ }
237
+ /** Represents an unchanged or modified line, including both original and modified content and their respective line numbers. */
238
+ interface UnchangedOrModifiedDiffLine extends DiffLineDetails {
239
+ /** The type of difference, either `'unchanged'` or `'modified'`. */
240
+ type: 'unchanged' | 'modified';
241
+ }
242
+ /** Represents an added line, including only its content and line number in the modified string. */
243
+ interface AddedDiffLine extends Omit<DiffLineDetails, 'originalLineNum' | 'original'> {
244
+ /** The type of difference, fixed to `'added'`. */
245
+ type: 'added';
246
+ }
247
+ /** Represents a removed line, including only its content and line number in the original string. */
248
+ interface RemovedDiffLine extends Omit<DiffLineDetails, 'modifiedLineNum' | 'modified'> {
249
+ /** The type of difference, fixed to `'removed'`. */
250
+ type: 'removed';
251
+ }
252
+ /** Statistics summarizing the diff results, including counts of added, removed, changed, and unchanged lines. */
253
+ interface DiffStats {
254
+ /** Total number of lines that were added in the modified string compared to the original. */
255
+ linesAdded: number;
256
+ /** Total number of lines that were removed from the original string in the modified version. */
257
+ linesRemoved: number;
258
+ /** Total number of lines that were modified (changed content) between the original and modified strings. */
259
+ linesChanged: number;
260
+ /** Total number of lines that remained unchanged between the original and modified strings. */
261
+ linesUnchanged: number;
236
262
  }
237
263
  /** The result of a line-level diff operation, including an array of line differences and summary statistics. */
238
264
  interface DiffResult {
239
265
  /** An array of line differences, where each line is categorized as 'added', 'removed', 'unchanged', or 'modified'. */
240
266
  lines: DiffLine[];
241
267
  /** Statistics summarizing the diff results, including counts of added, removed, changed, and unchanged lines. */
242
- stats: {
243
- /** Total number of lines that were added in the modified string compared to the original. */linesAdded: number; /** Total number of lines that were removed from the original string in the modified version. */
244
- linesRemoved: number; /** Total number of lines that were modified (changed content) between the original and modified strings. */
245
- linesChanged: number; /** Total number of lines that remained unchanged between the original and modified strings. */
246
- linesUnchanged: number;
247
- };
268
+ stats: DiffStats;
248
269
  }
249
270
  /** A single character annotated with a `highlighted` flag indicating whether it differs from the other string in a diff operation. */
250
271
  interface HighlightedText {
251
- /** Character text. */
272
+ /** The text content of the character. */
252
273
  text: string;
253
- /** Whether the character is different from the other string. */
274
+ /** Whether the character is different from the other string in a diff operation. */
254
275
  highlighted: boolean;
255
276
  }
256
277
  /** Result of a character-level diff, mapping each character in both strings to a `highlighted` flag. */
@@ -261,4 +282,4 @@ interface CharDiffResult {
261
282
  modified: HighlightedText[];
262
283
  }
263
284
  //#endregion
264
- export { KebabCase as A, StringCaseOptions as B, DiffLine as C, HighlightedText as D, DotCase as E, QueryString as F, TrainCase as H, RandomIdOptions as I, SentenceCase as L, PascalCase as M, PascalSnakeCase as N, Includes as O, PathCase as P, SnakeCase as R, CountryShortISO as S, DiffResult as T, Trim as U, TitleCase as V, ConstantCase as _, $NormalizeString as a, CountryISO as b, $TrimRight as c, Alphabet as d, AnagramOptions as f, CharDiffResult as g, CaseFormat as h, $LowercaseWords as i, MaskOptions as j, IsAlphabet as k, $UppercaseWords as l, CapitalizeOptions as m, $EnsureString as n, $TitleCaseWords as o, CamelCase as p, $LowerCaseWord as r, $TrimLeft as s, $CapitalizeWords as t, $WidenEmpty as u, Country as v, DiffLineType as w, CountryName as x, CountryCode as y, SpecialCharacter as z };
285
+ export { HighlightedText as A, RemovedDiffLine as B, CountryShortISO as C, DiffResult as D, DiffLineType as E, PascalCase as F, TitleCase as G, SnakeCase as H, PascalSnakeCase as I, UnchangedOrModifiedDiffLine as J, TrainCase as K, PathCase as L, IsAlphabet as M, KebabCase as N, DiffStats as O, MaskOptions as P, QueryString as R, CountryName as S, DiffLineDetails as T, SpecialCharacter as U, SentenceCase as V, StringCaseOptions as W, CharDiffResult as _, $NormalizeString as a, CountryCode as b, $TrimRight as c, AddedDiffLine as d, Alphabet as f, CaseFormat as g, CapitalizeOptions as h, $LowercaseWords as i, Includes as j, DotCase as k, $UppercaseWords as l, CamelCase as m, $EnsureString as n, $TitleCaseWords as o, AnagramOptions as p, Trim as q, $LowerCaseWord as r, $TrimLeft as s, $CapitalizeWords as t, $WidenEmpty as u, ConstantCase as v, DiffLine as w, CountryISO as x, Country as y, RandomIdOptions as z };
@@ -221,36 +221,57 @@ type IsAlphabet<T extends string> = T extends `${infer Head}${infer Tail}` ? Hea
221
221
  type Alphabet<T extends string> = IsAlphabet<T> extends true ? T : never;
222
222
  /** Types related to string diffing and similarity calculations. */
223
223
  type DiffLineType = 'added' | 'removed' | 'unchanged' | 'modified';
224
- /** A single line difference between two strings, including the type of difference and the content of the line in both original and modified strings. */
225
- interface DiffLine {
226
- /** The type of difference: 'added', 'removed', 'unchanged', or 'modified'. */
227
- type: DiffLineType;
228
- /** The content of the original line. Undefined for added lines. */
229
- original?: string;
230
- /** The content of the modified line. Undefined for removed lines. */
231
- modified?: string;
232
- /** The line number in the original string (1-based). Undefined for added lines. */
233
- originalLineNum?: number;
234
- /** The line number in the modified string (1-based). Undefined for removed lines. */
235
- modifiedLineNum?: number;
224
+ /** Represents a single line's diff status between two strings, including the type of difference and the content of the line in both original and modified strings. */
225
+ type DiffLine = UnchangedOrModifiedDiffLine | AddedDiffLine | RemovedDiffLine;
226
+ /** Represents the details of a single line in the diff, including its content and line number. */
227
+ interface DiffLineDetails {
228
+ /** The content of the original line, omitted for `added` lines. */
229
+ original: string;
230
+ /** The content of the modified line, omitted for `removed` lines. */
231
+ modified: string;
232
+ /** The line number in the original string (1-based), omitted for `added` lines. */
233
+ originalLineNum: number;
234
+ /** The line number in the modified string (1-based), omitted for `removed` lines. */
235
+ modifiedLineNum: number;
236
+ }
237
+ /** Represents an unchanged or modified line, including both original and modified content and their respective line numbers. */
238
+ interface UnchangedOrModifiedDiffLine extends DiffLineDetails {
239
+ /** The type of difference, either `'unchanged'` or `'modified'`. */
240
+ type: 'unchanged' | 'modified';
241
+ }
242
+ /** Represents an added line, including only its content and line number in the modified string. */
243
+ interface AddedDiffLine extends Omit<DiffLineDetails, 'originalLineNum' | 'original'> {
244
+ /** The type of difference, fixed to `'added'`. */
245
+ type: 'added';
246
+ }
247
+ /** Represents a removed line, including only its content and line number in the original string. */
248
+ interface RemovedDiffLine extends Omit<DiffLineDetails, 'modifiedLineNum' | 'modified'> {
249
+ /** The type of difference, fixed to `'removed'`. */
250
+ type: 'removed';
251
+ }
252
+ /** Statistics summarizing the diff results, including counts of added, removed, changed, and unchanged lines. */
253
+ interface DiffStats {
254
+ /** Total number of lines that were added in the modified string compared to the original. */
255
+ linesAdded: number;
256
+ /** Total number of lines that were removed from the original string in the modified version. */
257
+ linesRemoved: number;
258
+ /** Total number of lines that were modified (changed content) between the original and modified strings. */
259
+ linesChanged: number;
260
+ /** Total number of lines that remained unchanged between the original and modified strings. */
261
+ linesUnchanged: number;
236
262
  }
237
263
  /** The result of a line-level diff operation, including an array of line differences and summary statistics. */
238
264
  interface DiffResult {
239
265
  /** An array of line differences, where each line is categorized as 'added', 'removed', 'unchanged', or 'modified'. */
240
266
  lines: DiffLine[];
241
267
  /** Statistics summarizing the diff results, including counts of added, removed, changed, and unchanged lines. */
242
- stats: {
243
- /** Total number of lines that were added in the modified string compared to the original. */linesAdded: number; /** Total number of lines that were removed from the original string in the modified version. */
244
- linesRemoved: number; /** Total number of lines that were modified (changed content) between the original and modified strings. */
245
- linesChanged: number; /** Total number of lines that remained unchanged between the original and modified strings. */
246
- linesUnchanged: number;
247
- };
268
+ stats: DiffStats;
248
269
  }
249
270
  /** A single character annotated with a `highlighted` flag indicating whether it differs from the other string in a diff operation. */
250
271
  interface HighlightedText {
251
- /** Character text. */
272
+ /** The text content of the character. */
252
273
  text: string;
253
- /** Whether the character is different from the other string. */
274
+ /** Whether the character is different from the other string in a diff operation. */
254
275
  highlighted: boolean;
255
276
  }
256
277
  /** Result of a character-level diff, mapping each character in both strings to a `highlighted` flag. */
@@ -261,4 +282,4 @@ interface CharDiffResult {
261
282
  modified: HighlightedText[];
262
283
  }
263
284
  //#endregion
264
- export { KebabCase as A, StringCaseOptions as B, DiffLine as C, HighlightedText as D, DotCase as E, QueryString as F, TrainCase as H, RandomIdOptions as I, SentenceCase as L, PascalCase as M, PascalSnakeCase as N, Includes as O, PathCase as P, SnakeCase as R, CountryShortISO as S, DiffResult as T, Trim as U, TitleCase as V, ConstantCase as _, $NormalizeString as a, CountryISO as b, $TrimRight as c, Alphabet as d, AnagramOptions as f, CharDiffResult as g, CaseFormat as h, $LowercaseWords as i, MaskOptions as j, IsAlphabet as k, $UppercaseWords as l, CapitalizeOptions as m, $EnsureString as n, $TitleCaseWords as o, CamelCase as p, $LowerCaseWord as r, $TrimLeft as s, $CapitalizeWords as t, $WidenEmpty as u, Country as v, DiffLineType as w, CountryName as x, CountryCode as y, SpecialCharacter as z };
285
+ export { HighlightedText as A, RemovedDiffLine as B, CountryShortISO as C, DiffResult as D, DiffLineType as E, PascalCase as F, TitleCase as G, SnakeCase as H, PascalSnakeCase as I, UnchangedOrModifiedDiffLine as J, TrainCase as K, PathCase as L, IsAlphabet as M, KebabCase as N, DiffStats as O, MaskOptions as P, QueryString as R, CountryName as S, DiffLineDetails as T, SpecialCharacter as U, SentenceCase as V, StringCaseOptions as W, CharDiffResult as _, $NormalizeString as a, CountryCode as b, $TrimRight as c, AddedDiffLine as d, Alphabet as f, CaseFormat as g, CapitalizeOptions as h, $LowercaseWords as i, Includes as j, DotCase as k, $UppercaseWords as l, CamelCase as m, $EnsureString as n, $TitleCaseWords as o, AnagramOptions as p, Trim as q, $LowerCaseWord as r, $TrimLeft as s, $CapitalizeWords as t, $WidenEmpty as u, ConstantCase as v, DiffLine as w, CountryISO as x, Country as y, RandomIdOptions as z };
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { a as OriginFileObj, i as FormDataConfigs, n as FileError, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "../form-DA-YShnM.cjs";
17
+ import { a as OriginFileObj, i as FormDataConfigs, n as FileError, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "../form-DhsFvo_D.cjs";
18
18
  export { CustomFile, FileError, FileUpload, FormDataConfigs, OriginFileObj, ParsedFormData, SerializedForm };
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { a as OriginFileObj, i as FormDataConfigs, n as FileError, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "../form-DIYoIS0E.mjs";
17
+ import { a as OriginFileObj, i as FormDataConfigs, n as FileError, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "../form-D_5I437n.mjs";
18
18
  export { CustomFile, FileError, FileUpload, FormDataConfigs, OriginFileObj, ParsedFormData, SerializedForm };
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { A as KebabCase, B as StringCaseOptions, C as DiffLine, D as HighlightedText, E as DotCase, F as QueryString, H as TrainCase, I as RandomIdOptions, L as SentenceCase, M as PascalCase, N as PascalSnakeCase, O as Includes, P as PathCase, R as SnakeCase, S as CountryShortISO, T as DiffResult, U as Trim, V as TitleCase, _ as ConstantCase, a as $NormalizeString, b as CountryISO, c as $TrimRight, d as Alphabet, f as AnagramOptions, g as CharDiffResult, h as CaseFormat, i as $LowercaseWords, j as MaskOptions, k as IsAlphabet, l as $UppercaseWords, m as CapitalizeOptions, n as $EnsureString, o as $TitleCaseWords, p as CamelCase, r as $LowerCaseWord, s as $TrimLeft, t as $CapitalizeWords, u as $WidenEmpty, v as Country, w as DiffLineType, x as CountryName, y as CountryCode, z as SpecialCharacter } from "../string-EMT7czsU.cjs";
18
- export { $CapitalizeWords, $EnsureString, $LowerCaseWord, $LowercaseWords, $NormalizeString, $TitleCaseWords, $TrimLeft, $TrimRight, $UppercaseWords, $WidenEmpty, Alphabet, AnagramOptions, CamelCase, CapitalizeOptions, CaseFormat, CharDiffResult, ConstantCase, Country, CountryCode, CountryISO, CountryName, CountryShortISO, DiffLine, DiffLineType, DiffResult, DotCase, HighlightedText, Includes, IsAlphabet, KebabCase, MaskOptions, PascalCase, PascalSnakeCase, PathCase, QueryString, RandomIdOptions, SentenceCase, SnakeCase, SpecialCharacter, StringCaseOptions, TitleCase, TrainCase, Trim };
17
+ import { A as HighlightedText, B as RemovedDiffLine, C as CountryShortISO, D as DiffResult, E as DiffLineType, F as PascalCase, G as TitleCase, H as SnakeCase, I as PascalSnakeCase, J as UnchangedOrModifiedDiffLine, K as TrainCase, L as PathCase, M as IsAlphabet, N as KebabCase, O as DiffStats, P as MaskOptions, R as QueryString, S as CountryName, T as DiffLineDetails, U as SpecialCharacter, V as SentenceCase, W as StringCaseOptions, _ as CharDiffResult, a as $NormalizeString, b as CountryCode, c as $TrimRight, d as AddedDiffLine, f as Alphabet, g as CaseFormat, h as CapitalizeOptions, i as $LowercaseWords, j as Includes, k as DotCase, l as $UppercaseWords, m as CamelCase, n as $EnsureString, o as $TitleCaseWords, p as AnagramOptions, q as Trim, r as $LowerCaseWord, s as $TrimLeft, t as $CapitalizeWords, u as $WidenEmpty, v as ConstantCase, w as DiffLine, x as CountryISO, y as Country, z as RandomIdOptions } from "../string-Ok_IMpHP.cjs";
18
+ export { $CapitalizeWords, $EnsureString, $LowerCaseWord, $LowercaseWords, $NormalizeString, $TitleCaseWords, $TrimLeft, $TrimRight, $UppercaseWords, $WidenEmpty, AddedDiffLine, Alphabet, AnagramOptions, CamelCase, CapitalizeOptions, CaseFormat, CharDiffResult, ConstantCase, Country, CountryCode, CountryISO, CountryName, CountryShortISO, DiffLine, DiffLineDetails, DiffLineType, DiffResult, DiffStats, DotCase, HighlightedText, Includes, IsAlphabet, KebabCase, MaskOptions, PascalCase, PascalSnakeCase, PathCase, QueryString, RandomIdOptions, RemovedDiffLine, SentenceCase, SnakeCase, SpecialCharacter, StringCaseOptions, TitleCase, TrainCase, Trim, UnchangedOrModifiedDiffLine };
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { A as KebabCase, B as StringCaseOptions, C as DiffLine, D as HighlightedText, E as DotCase, F as QueryString, H as TrainCase, I as RandomIdOptions, L as SentenceCase, M as PascalCase, N as PascalSnakeCase, O as Includes, P as PathCase, R as SnakeCase, S as CountryShortISO, T as DiffResult, U as Trim, V as TitleCase, _ as ConstantCase, a as $NormalizeString, b as CountryISO, c as $TrimRight, d as Alphabet, f as AnagramOptions, g as CharDiffResult, h as CaseFormat, i as $LowercaseWords, j as MaskOptions, k as IsAlphabet, l as $UppercaseWords, m as CapitalizeOptions, n as $EnsureString, o as $TitleCaseWords, p as CamelCase, r as $LowerCaseWord, s as $TrimLeft, t as $CapitalizeWords, u as $WidenEmpty, v as Country, w as DiffLineType, x as CountryName, y as CountryCode, z as SpecialCharacter } from "../string-GQsmDdYa.mjs";
18
- export { $CapitalizeWords, $EnsureString, $LowerCaseWord, $LowercaseWords, $NormalizeString, $TitleCaseWords, $TrimLeft, $TrimRight, $UppercaseWords, $WidenEmpty, Alphabet, AnagramOptions, CamelCase, CapitalizeOptions, CaseFormat, CharDiffResult, ConstantCase, Country, CountryCode, CountryISO, CountryName, CountryShortISO, DiffLine, DiffLineType, DiffResult, DotCase, HighlightedText, Includes, IsAlphabet, KebabCase, MaskOptions, PascalCase, PascalSnakeCase, PathCase, QueryString, RandomIdOptions, SentenceCase, SnakeCase, SpecialCharacter, StringCaseOptions, TitleCase, TrainCase, Trim };
17
+ import { A as HighlightedText, B as RemovedDiffLine, C as CountryShortISO, D as DiffResult, E as DiffLineType, F as PascalCase, G as TitleCase, H as SnakeCase, I as PascalSnakeCase, J as UnchangedOrModifiedDiffLine, K as TrainCase, L as PathCase, M as IsAlphabet, N as KebabCase, O as DiffStats, P as MaskOptions, R as QueryString, S as CountryName, T as DiffLineDetails, U as SpecialCharacter, V as SentenceCase, W as StringCaseOptions, _ as CharDiffResult, a as $NormalizeString, b as CountryCode, c as $TrimRight, d as AddedDiffLine, f as Alphabet, g as CaseFormat, h as CapitalizeOptions, i as $LowercaseWords, j as Includes, k as DotCase, l as $UppercaseWords, m as CamelCase, n as $EnsureString, o as $TitleCaseWords, p as AnagramOptions, q as Trim, r as $LowerCaseWord, s as $TrimLeft, t as $CapitalizeWords, u as $WidenEmpty, v as ConstantCase, w as DiffLine, x as CountryISO, y as Country, z as RandomIdOptions } from "../string-edtZyJHf.mjs";
18
+ export { $CapitalizeWords, $EnsureString, $LowerCaseWord, $LowercaseWords, $NormalizeString, $TitleCaseWords, $TrimLeft, $TrimRight, $UppercaseWords, $WidenEmpty, AddedDiffLine, Alphabet, AnagramOptions, CamelCase, CapitalizeOptions, CaseFormat, CharDiffResult, ConstantCase, Country, CountryCode, CountryISO, CountryName, CountryShortISO, DiffLine, DiffLineDetails, DiffLineType, DiffResult, DiffStats, DotCase, HighlightedText, Includes, IsAlphabet, KebabCase, MaskOptions, PascalCase, PascalSnakeCase, PathCase, QueryString, RandomIdOptions, RemovedDiffLine, SentenceCase, SnakeCase, SpecialCharacter, StringCaseOptions, TitleCase, TrainCase, Trim, UnchangedOrModifiedDiffLine };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolbox-x",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions, classes and types for everyday development needs.",
5
5
  "main": "./dist/index.cjs",
6
6
  "type": "module",