toolbox-x 1.2.1 → 2.0.1
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/{Color-Dsut0Bex.d.cts → Color-BCsnSEmt.d.cts} +1 -1
- package/dist/{Color-DCfoQk_-.d.mts → Color-CKmhtXdG.d.mts} +1 -1
- package/dist/{Stylog-DXZtHAbp.d.mts → Stylog-CXpN-oeY.d.mts} +5 -5
- package/dist/{Stylog-TyLCTRtT.d.cts → Stylog-DJOVxym_.d.cts} +5 -5
- package/dist/{area-CcRQ6TfR.d.cts → area-CHhwLR12.d.cts} +3 -3
- package/dist/{area-CvSC96va.d.mts → area-DOqFLNcr.d.mts} +3 -3
- package/dist/{array-B6jWzJ4F.d.mts → array-BNbTIBni.d.mts} +1 -1
- package/dist/{array-CqDu610k.d.cts → array-CL3apdfa.d.cts} +1 -1
- package/dist/{basics-KobRNhV-.d.cts → basics-B9aytOct.d.cts} +5 -5
- package/dist/{basics-V5M2oltn.d.mts → basics-BNQqY5WD.d.mts} +5 -5
- package/dist/{basics-K8BDSYD6.cjs → basics-CJmdhXoo.cjs} +567 -14
- package/dist/{basics-1_M7UvCn.mjs → basics-CebgkY-n.mjs} +449 -16
- package/dist/{case-uKFzt5TY.cjs → case-Bd7QLHYw.cjs} +3 -3
- package/dist/{case-KdrBKjjK.d.mts → case-Bkkm6Mqi.d.mts} +12 -12
- package/dist/{case-BQwn5N-k.mjs → case-DBC4Rj0h.mjs} +3 -3
- package/dist/{case--Vjea9DS.d.cts → case-DFD3Ml1p.d.cts} +12 -12
- package/dist/change-case.cjs +1 -1
- package/dist/change-case.d.cts +1 -1
- package/dist/change-case.d.mts +1 -1
- package/dist/change-case.mjs +1 -1
- package/dist/colors.d.cts +2 -2
- package/dist/colors.d.mts +2 -2
- package/dist/{constants-C4RW7Lei.cjs → constants-Dz5vxNQ9.cjs} +37 -0
- package/dist/{constants-rNhoy4DH.mjs → constants-j-iXjwDl.mjs} +32 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/converter.cjs +2 -2
- package/dist/converter.d.cts +2 -2
- package/dist/converter.d.mts +2 -2
- package/dist/converter.mjs +2 -2
- package/dist/date.cjs +51 -10
- package/dist/date.d.cts +22 -5
- package/dist/date.d.mts +22 -5
- package/dist/date.mjs +49 -11
- package/dist/dom.cjs +5 -6
- package/dist/dom.d.cts +3 -3
- package/dist/dom.d.mts +3 -3
- package/dist/dom.mjs +4 -5
- package/dist/{form-DoQGMTOc.d.mts → form-CC9T9WnX.d.cts} +2 -2
- package/dist/{form-mP-nl8EC.d.cts → form-CheKmgjj.d.mts} +2 -2
- package/dist/guards-B2s2wlVN.mjs +425 -0
- package/dist/{guards-C0smSAKC.mjs → guards-BK1QuvFZ.mjs} +2 -2
- package/dist/{guards-ClGDJrQp.cjs → guards-Bsh6Bfdq.cjs} +2 -2
- package/dist/{guards-0VjySrPM.cjs → guards-DMJcjPDt.cjs} +279 -3
- package/dist/guards.cjs +9 -8
- package/dist/guards.d.cts +6 -5
- package/dist/guards.d.mts +6 -5
- package/dist/guards.mjs +5 -5
- package/dist/{hash-BcoFHSu1.d.cts → hash-C0Wr7H8v.d.mts} +1 -1
- package/dist/{hash-GYRx2ee_.d.mts → hash-DJ8b9VHB.d.cts} +1 -1
- package/dist/hash.cjs +8 -8
- package/dist/hash.d.cts +8 -8
- package/dist/hash.d.mts +8 -8
- package/dist/hash.mjs +4 -5
- package/dist/{http-status-xrlR-LlB.d.mts → http-status-BSee6mB5.d.mts} +1 -1
- package/dist/{http-status-C0DOpCDf.d.cts → http-status-DJn87B_Y.d.cts} +1 -1
- package/dist/http-status.cjs +4 -4
- package/dist/http-status.d.cts +6 -6
- package/dist/http-status.d.mts +6 -6
- package/dist/http-status.mjs +4 -4
- package/dist/index-01oaUuP6.d.mts +292 -0
- package/dist/index-CgwlWrZM.d.cts +292 -0
- package/dist/index.cjs +67 -248
- package/dist/index.d.cts +25 -280
- package/dist/index.d.mts +25 -280
- package/dist/index.mjs +11 -194
- package/dist/{object-ChFVh95z.d.cts → object-Mglyg4AW.d.cts} +28 -1
- package/dist/{object-ChFVh95z.d.mts → object-Mglyg4AW.d.mts} +28 -1
- package/dist/{objectify-DEnFpPt1.mjs → objectify-CQa8gQib.mjs} +3 -4
- package/dist/{objectify-DewBSJP_.cjs → objectify-xQvZS3UI.cjs} +5 -6
- package/dist/paginator.d.cts +1 -1
- package/dist/paginator.d.mts +1 -1
- package/dist/{parse-DovagZFA.cjs → parse-BWu3UbOk.cjs} +4 -4
- package/dist/{parse-BhZ6-tKg.mjs → parse-CNDdS-sy.mjs} +4 -4
- package/dist/{pluralizer-CdG-VJ6t.d.cts → pluralizer-BGMC8LLz.d.cts} +1 -1
- package/dist/{pluralizer-D2Lh8CdU.d.mts → pluralizer-CQNzRhwR.d.mts} +1 -1
- package/dist/pluralizer.cjs +6 -6
- package/dist/pluralizer.d.cts +6 -6
- package/dist/pluralizer.d.mts +6 -6
- package/dist/pluralizer.mjs +6 -6
- package/dist/{specials-Cye93-uo.mjs → specials-Hq5Ncd6y.mjs} +2 -2
- package/dist/{specials-BM6cx43o.cjs → specials-dkYP1Nh2.cjs} +2 -2
- package/dist/{string-Dq2b8rcN.d.cts → string-BDwBuik3.d.cts} +4 -2
- package/dist/{string-CkwTVFeL.d.mts → string-_1ImwUJT.d.mts} +4 -2
- package/dist/stylog.cjs +5 -5
- package/dist/stylog.d.cts +2 -2
- package/dist/stylog.d.mts +2 -2
- package/dist/stylog.mjs +5 -5
- package/dist/types/array.d.cts +1 -1
- package/dist/types/array.d.mts +1 -1
- package/dist/types/colors.d.cts +1 -1
- package/dist/types/colors.d.mts +1 -1
- package/dist/types/converter.d.cts +1 -1
- package/dist/types/converter.d.mts +1 -1
- package/dist/types/date.d.cts +2 -2
- package/dist/types/date.d.mts +2 -2
- package/dist/types/form.d.cts +1 -1
- package/dist/types/form.d.mts +1 -1
- package/dist/types/hash.d.cts +1 -1
- package/dist/types/hash.d.mts +1 -1
- package/dist/types/http-status.d.cts +1 -1
- package/dist/types/http-status.d.mts +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/number.d.cts +1 -1
- package/dist/types/number.d.mts +1 -1
- package/dist/types/object.d.cts +2 -2
- package/dist/types/object.d.mts +2 -2
- package/dist/types/pluralizer.d.cts +1 -1
- package/dist/types/pluralizer.d.mts +1 -1
- package/dist/types/string.d.cts +2 -2
- package/dist/types/string.d.mts +2 -2
- package/dist/types/stylog.d.cts +1 -1
- package/dist/types/stylog.d.mts +1 -1
- package/dist/types/utils.d.cts +1 -1
- package/dist/types/utils.d.mts +1 -1
- package/dist/{utilities-CzyXCRHM.cjs → utilities-CWV1GPGY.cjs} +1 -1
- package/dist/{utilities-B9axOvOX.mjs → utilities-DPscNbS1.mjs} +1 -1
- package/dist/{uuid-DgTBxcVu.d.cts → uuid-CiJtSUbo.d.cts} +3 -3
- package/dist/{uuid-Yc3Uu8qr.d.mts → uuid-D-gjPs4Q.d.mts} +3 -3
- package/dist/verbalizer.cjs +3 -3
- package/dist/verbalizer.d.cts +3 -3
- package/dist/verbalizer.d.mts +3 -3
- package/dist/verbalizer.mjs +3 -3
- package/package.json +7 -6
- package/dist/guards-DeO4ukiK.mjs +0 -221
- package/dist/utils-BxguWSoa.cjs +0 -568
- package/dist/utils-DXovsTKs.mjs +0 -449
|
@@ -7774,6 +7774,21 @@ type $TimeUnitVar<U extends $TimeUnitKey = $TimeUnitKey> = $TimeUnitVarMap[U][nu
|
|
|
7774
7774
|
type $UnitAnyCase = Capitalize<$TimeUnitVar> | Uppercase<$TimeUnitVar> | $TimeUnitVar;
|
|
7775
7775
|
/** Number (time value) with variants of different time units */
|
|
7776
7776
|
type TimeWithUnit = `${number}${$UnitAnyCase}` | `${number} ${$UnitAnyCase}`;
|
|
7777
|
+
/**
|
|
7778
|
+
* * Interface for defining options for relative date formatting.
|
|
7779
|
+
*
|
|
7780
|
+
* @remarks This interface is an extension of {@link Intl.RelativeTimeFormatOptions} and is used by `formatRelativeDateNative` function to format dates relative to a given date.
|
|
7781
|
+
*/
|
|
7782
|
+
interface RelativeDateFormatOptions extends Intl.RelativeTimeFormatOptions {
|
|
7783
|
+
/**
|
|
7784
|
+
* * The date to compare against. Defaults to {@link Date new Date()}. Can be any type of {@link DateArgs}.
|
|
7785
|
+
*/
|
|
7786
|
+
fromDate?: DateArgs;
|
|
7787
|
+
/**
|
|
7788
|
+
* * The locale to use for formatting. Defaults to `'en'`.
|
|
7789
|
+
*/
|
|
7790
|
+
locale?: LocalesArguments;
|
|
7791
|
+
}
|
|
7777
7792
|
//#endregion
|
|
7778
7793
|
//#region src/types/index.d.ts
|
|
7779
7794
|
/** Uncontrolled any to use for edge cases */
|
|
@@ -7832,6 +7847,14 @@ type VoidFn = (...args: any[]) => void;
|
|
|
7832
7847
|
type DelayedFn<T extends VoidFn> = (...args: Parameters<T>) => void;
|
|
7833
7848
|
/** Asynchronous function type */
|
|
7834
7849
|
type AsyncFunction<T> = (...args: any[]) => Promise<T>;
|
|
7850
|
+
/** * A property descriptor that represents a method (a function-valued property). */
|
|
7851
|
+
interface MethodDescriptor<Fn extends GenericFn = GenericFn> extends Omit<PropertyDescriptor, 'value'> {
|
|
7852
|
+
value: Fn;
|
|
7853
|
+
}
|
|
7854
|
+
/** A function type that accepts a value and returns a boolean. */
|
|
7855
|
+
type ConditionFn<T = unknown> = (value: Maybe<T>) => boolean;
|
|
7856
|
+
/** An object type for storing multiple {@link ConditionFn condition} functions. */
|
|
7857
|
+
type ConditionFns<T extends GenericObject> = { [K in keyof T]?: ConditionFn<T[K]> };
|
|
7835
7858
|
/** Advanced types to exclude from counting as object key */
|
|
7836
7859
|
type AdvancedTypes = Array<unknown> | File | FileList | DateLike | Blob | Date | RegExp | WeakMap<WeakKey, unknown> | WeakSet<WeakKey> | Map<unknown, unknown> | Set<unknown> | Function | GenericFn | VoidFn | AsyncFunction<unknown> | Promise<unknown> | Error | EvalError | RangeError | ReferenceError | SyntaxError | TypeError | URIError | bigint | symbol;
|
|
7837
7860
|
/** Helper to detect if a type has methods */
|
|
@@ -8121,5 +8144,9 @@ type $Countries = (typeof COUNTRIES)[number];
|
|
|
8121
8144
|
type $Record<Key extends PropertyKey = string, T = any> = { [K in Key]: T } extends infer O ? { [K in keyof O]: O[K] } : { [K in Key]: T };
|
|
8122
8145
|
/** * Represents the details (read-only) of a country, including its name, country code, and ISO codes. */
|
|
8123
8146
|
type CountryDetails = Readonly<$Record<'country_name' | 'country_code' | 'iso_code_short' | 'iso_code', string>>;
|
|
8147
|
+
/**
|
|
8148
|
+
* Converts an object into a union of key-value tuples.
|
|
8149
|
+
*/
|
|
8150
|
+
type ObjectEntry<T extends GenericObject> = { [K in keyof T]: [K, T[K]] }[keyof T];
|
|
8124
8151
|
//#endregion
|
|
8125
|
-
export {
|
|
8152
|
+
export { GenericFn as $, Percent as $n, Repeat as $r, Milliseconds as $t, OmitPath as A, ZodiacPreset as An, Immutable as Ar, ClockSecond as At, AsyncFunction as B, Enumerate as Bn, OneOf as Br, DayPartConfig as Bt, LeafValue as C, TIME_ZONE_LABELS as Ci, TimeZoneName as Cn, Cast as Cr, $TimeUnitVarMap as Ct, NumericDotKey as D, WESTERN_ZODIAC_SIGNS as Di, UTCOffset as Dn, ExtractOptional as Dr, AcademicYear as Dt, NestedPrimitiveKey as E, VEDIC_ZODIAC_SIGNS as Ei, UTCMinute as En, DeepPartialAll as Er, $UnitAnyCase as Et, SanitizeOptions as F, BnDigitResult as Fn, LooseLiteral as Fr, DateLike as Ft, ConditionFns as G, GetOriginalOptions as Gn, Pop as Gr, GreetingConfigs as Gt, Branded as H, FrankFurterCurrency as Hn, PaginatorMeta as Hr, FormatOptions as Ht, SanitizedData as I, ConvertOptions as In, MapObjectValues as Ir, DateString as It, Deserializer as J, InversePercentageOptions as Jn, PropertyRequired as Jr, ISODateFormat as Jt, Constructor as K, GetPercentOptions as Kn, Prettify as Kr, HourMinutes as Kt, StrictObject as L, ConvertedDecimal as Ln, Merge as Lr, DateTimeFormatOptions as Lt, ParsedQueryGeneric as M, $BnOnes as Mn, Join as Mr, DateArgs as Mt, QueryObject as N, ApplyChangeOptions as Nn, Keyof as Nr, DateFormatOptions as Nt, ObjectEntry as O, COUNTRIES as Oi, WeekDay as On, ExtractRequired as Or, ClockHour as Ot, QueryObjectValue as P, BanglaDigit as Pn, KeysOfUnion as Pr, DateFormatToken as Pt, FlattenPartial as Q, NumberType as Qn, RenameKeys as Qr, MSToken as Qt, AdvancedTypes as R, CurrencyCode as Rn, Mutable as Rr, DateToken as Rt, KeyForObject as S, TIME_ZONE_IDS as Si, TimeZoneIdentifier as Sn, ArrayToTuple as Sr, $TimeUnitVar as St, NestedKeyString as T, MONTHS as Ti, TimestampOptions as Tn, DeepPartial as Tr, $UTCOffset as Tt, ClassDetails as U, GetChangeOptions as Un, PaginatorOptions as Ur, FormatToken as Ut, BasicPrimitive as V, FrankFurter as Vn, PageListOptions as Vr, DayToken as Vt, ConditionFn as W, GetDifferenceOptions as Wn, PickByValue as Wr, FromNowUnit as Wt, Expect as X, LooseRomanNumeral as Xn, RangeTuple as Xr, LocaleCalendar as Xt, Equal as Y, LocaleCode as Yn, ProtoMethodOptions as Yr, ISODateTimeString as Yt, FalsyPrimitive as Z, NumberRange as Zn, RemoveNever as Zr, LocalesArguments as Zt, FlattenLeafKey as _, UNITS as _i, TimeWithUnit as _n, $UnionToIntersection as _r, $ISOTimeString as _t, ConvertObjectOptions as a, RequireOnly as ai, NegativeUTCHour as an, RomanNumeral as ar, NormalPrimitive as at, GenericObjectPrimitive as b, TIME_ZONES as bi, TimeZoneId as bn, ArrayOfPrimitivesToStringOptions as br, $TZLabelKey as bt, DeepKeys as c, TupleOf as ci, Quarter as cn, UnitLabel as cr, Numeric as ct, DotNotationKeyStrict as d, ValueOptional as di, SecondToken as dn, $DeepPartial as dr, Primitive as dt, Replace as ei, MinuteToken as en, PercentageOptions as er, HasMethods as et, DotValue as f, Unit as fi, TimeFormatToken as fn, $Expand as fr, Serializer as ft, FlattenDotValue as g, LOCALE_CODES as gi, TimeUnitValue as gn, $Subtract as gr, $GMTOffset as gt, FlattenDotKey as h, FRANKFURTER_CURRENCIES as hi, TimeUnit as hn, $Range as hr, $DateUnit as ht, $Record as i, RequireExactly as ii, MonthToken as in, RomanCapital as ir, NonNullishPrimitiveKey as it, ParsedQuery as j, ZodiacSign as jn, IsStrictObject as jr, ClockTime as jt, Objects as k, YearToken as kn, FromMetaOptions as kr, ClockMinute as kt, DeepKeysTuple as l, TupleToUnion as li, RelativeDateFormatOptions as ln, UnitNumberMethods as lr, OwnKeys as lt, ExtractStringKey as m, CURRENCY_LOCALES as mi, TimeToken as mn, $JoinRepeat as mr, VoidFn as mt, $DoesPathStartWith as n, RequireAtLeast as ni, MonthName as nn, RangeOptions as nr, Maybe as nt, ConvertedObject as o, Split as oi, NumberingSystem as on, SIPrefix as or, NormalPrimitiveKey as ot, ExpandAll as p, CURRENCY_CODES as pi, TimeOnlyFormat as pn, $Forbid as pr, ValidArray as pt, DelayedFn as q, GetValueOptions as qn, PropertyOptional as qr, HourToken as qt, $JoinDotKey as r, RequireBetween as ri, MonthString as rn, RangedNumbers as rr, MethodDescriptor as rt, CountryDetails as s, Tuple as si, PositiveUTCHour as sn, UnitKey as sr, NullOrUndefined as st, $Countries as t, ReplaceFirst as ti, MonthDateString as tn, RandomNumberOptions as tr, List as tt, DotNotationKey as u, ValueOf as ui, SafeFormat as un, $BuildTuple as ur, PartialOrRequired as ut, FlattenLeafValue as v, IANA_TZ_IDS as vi, TimeZone as vn, $Without as vr, $LocalArguments as vt, MergeAll as w, DAYS as wi, TimeZoneNameNative as wn, DeepKeyof as wr, $TimeZoneIdentifier as wt, KeyForArray as x, TIME_ZONES_NATIVE as xi, TimeZoneIdNative as xn, ArrayToStringOptions as xr, $TimeUnitKey as xt, GenericObject as y, NATIVE_TZ_IDS as yi, TimeZoneDetails as yn, ArrayOfObjectsToStringOptions as yr, $NativeTzNameOrId as yt, Any as z, DecimalOptions as zn, OmitByValue as zr, DayPart as zt };
|
|
@@ -7774,6 +7774,21 @@ type $TimeUnitVar<U extends $TimeUnitKey = $TimeUnitKey> = $TimeUnitVarMap[U][nu
|
|
|
7774
7774
|
type $UnitAnyCase = Capitalize<$TimeUnitVar> | Uppercase<$TimeUnitVar> | $TimeUnitVar;
|
|
7775
7775
|
/** Number (time value) with variants of different time units */
|
|
7776
7776
|
type TimeWithUnit = `${number}${$UnitAnyCase}` | `${number} ${$UnitAnyCase}`;
|
|
7777
|
+
/**
|
|
7778
|
+
* * Interface for defining options for relative date formatting.
|
|
7779
|
+
*
|
|
7780
|
+
* @remarks This interface is an extension of {@link Intl.RelativeTimeFormatOptions} and is used by `formatRelativeDateNative` function to format dates relative to a given date.
|
|
7781
|
+
*/
|
|
7782
|
+
interface RelativeDateFormatOptions extends Intl.RelativeTimeFormatOptions {
|
|
7783
|
+
/**
|
|
7784
|
+
* * The date to compare against. Defaults to {@link Date new Date()}. Can be any type of {@link DateArgs}.
|
|
7785
|
+
*/
|
|
7786
|
+
fromDate?: DateArgs;
|
|
7787
|
+
/**
|
|
7788
|
+
* * The locale to use for formatting. Defaults to `'en'`.
|
|
7789
|
+
*/
|
|
7790
|
+
locale?: LocalesArguments;
|
|
7791
|
+
}
|
|
7777
7792
|
//#endregion
|
|
7778
7793
|
//#region src/types/index.d.ts
|
|
7779
7794
|
/** Uncontrolled any to use for edge cases */
|
|
@@ -7832,6 +7847,14 @@ type VoidFn = (...args: any[]) => void;
|
|
|
7832
7847
|
type DelayedFn<T extends VoidFn> = (...args: Parameters<T>) => void;
|
|
7833
7848
|
/** Asynchronous function type */
|
|
7834
7849
|
type AsyncFunction<T> = (...args: any[]) => Promise<T>;
|
|
7850
|
+
/** * A property descriptor that represents a method (a function-valued property). */
|
|
7851
|
+
interface MethodDescriptor<Fn extends GenericFn = GenericFn> extends Omit<PropertyDescriptor, 'value'> {
|
|
7852
|
+
value: Fn;
|
|
7853
|
+
}
|
|
7854
|
+
/** A function type that accepts a value and returns a boolean. */
|
|
7855
|
+
type ConditionFn<T = unknown> = (value: Maybe<T>) => boolean;
|
|
7856
|
+
/** An object type for storing multiple {@link ConditionFn condition} functions. */
|
|
7857
|
+
type ConditionFns<T extends GenericObject> = { [K in keyof T]?: ConditionFn<T[K]> };
|
|
7835
7858
|
/** Advanced types to exclude from counting as object key */
|
|
7836
7859
|
type AdvancedTypes = Array<unknown> | File | FileList | DateLike | Blob | Date | RegExp | WeakMap<WeakKey, unknown> | WeakSet<WeakKey> | Map<unknown, unknown> | Set<unknown> | Function | GenericFn | VoidFn | AsyncFunction<unknown> | Promise<unknown> | Error | EvalError | RangeError | ReferenceError | SyntaxError | TypeError | URIError | bigint | symbol;
|
|
7837
7860
|
/** Helper to detect if a type has methods */
|
|
@@ -8121,5 +8144,9 @@ type $Countries = (typeof COUNTRIES)[number];
|
|
|
8121
8144
|
type $Record<Key extends PropertyKey = string, T = any> = { [K in Key]: T } extends infer O ? { [K in keyof O]: O[K] } : { [K in Key]: T };
|
|
8122
8145
|
/** * Represents the details (read-only) of a country, including its name, country code, and ISO codes. */
|
|
8123
8146
|
type CountryDetails = Readonly<$Record<'country_name' | 'country_code' | 'iso_code_short' | 'iso_code', string>>;
|
|
8147
|
+
/**
|
|
8148
|
+
* Converts an object into a union of key-value tuples.
|
|
8149
|
+
*/
|
|
8150
|
+
type ObjectEntry<T extends GenericObject> = { [K in keyof T]: [K, T[K]] }[keyof T];
|
|
8124
8151
|
//#endregion
|
|
8125
|
-
export {
|
|
8152
|
+
export { GenericFn as $, Percent as $n, Repeat as $r, Milliseconds as $t, OmitPath as A, ZodiacPreset as An, Immutable as Ar, ClockSecond as At, AsyncFunction as B, Enumerate as Bn, OneOf as Br, DayPartConfig as Bt, LeafValue as C, TIME_ZONE_LABELS as Ci, TimeZoneName as Cn, Cast as Cr, $TimeUnitVarMap as Ct, NumericDotKey as D, WESTERN_ZODIAC_SIGNS as Di, UTCOffset as Dn, ExtractOptional as Dr, AcademicYear as Dt, NestedPrimitiveKey as E, VEDIC_ZODIAC_SIGNS as Ei, UTCMinute as En, DeepPartialAll as Er, $UnitAnyCase as Et, SanitizeOptions as F, BnDigitResult as Fn, LooseLiteral as Fr, DateLike as Ft, ConditionFns as G, GetOriginalOptions as Gn, Pop as Gr, GreetingConfigs as Gt, Branded as H, FrankFurterCurrency as Hn, PaginatorMeta as Hr, FormatOptions as Ht, SanitizedData as I, ConvertOptions as In, MapObjectValues as Ir, DateString as It, Deserializer as J, InversePercentageOptions as Jn, PropertyRequired as Jr, ISODateFormat as Jt, Constructor as K, GetPercentOptions as Kn, Prettify as Kr, HourMinutes as Kt, StrictObject as L, ConvertedDecimal as Ln, Merge as Lr, DateTimeFormatOptions as Lt, ParsedQueryGeneric as M, $BnOnes as Mn, Join as Mr, DateArgs as Mt, QueryObject as N, ApplyChangeOptions as Nn, Keyof as Nr, DateFormatOptions as Nt, ObjectEntry as O, COUNTRIES as Oi, WeekDay as On, ExtractRequired as Or, ClockHour as Ot, QueryObjectValue as P, BanglaDigit as Pn, KeysOfUnion as Pr, DateFormatToken as Pt, FlattenPartial as Q, NumberType as Qn, RenameKeys as Qr, MSToken as Qt, AdvancedTypes as R, CurrencyCode as Rn, Mutable as Rr, DateToken as Rt, KeyForObject as S, TIME_ZONE_IDS as Si, TimeZoneIdentifier as Sn, ArrayToTuple as Sr, $TimeUnitVar as St, NestedKeyString as T, MONTHS as Ti, TimestampOptions as Tn, DeepPartial as Tr, $UTCOffset as Tt, ClassDetails as U, GetChangeOptions as Un, PaginatorOptions as Ur, FormatToken as Ut, BasicPrimitive as V, FrankFurter as Vn, PageListOptions as Vr, DayToken as Vt, ConditionFn as W, GetDifferenceOptions as Wn, PickByValue as Wr, FromNowUnit as Wt, Expect as X, LooseRomanNumeral as Xn, RangeTuple as Xr, LocaleCalendar as Xt, Equal as Y, LocaleCode as Yn, ProtoMethodOptions as Yr, ISODateTimeString as Yt, FalsyPrimitive as Z, NumberRange as Zn, RemoveNever as Zr, LocalesArguments as Zt, FlattenLeafKey as _, UNITS as _i, TimeWithUnit as _n, $UnionToIntersection as _r, $ISOTimeString as _t, ConvertObjectOptions as a, RequireOnly as ai, NegativeUTCHour as an, RomanNumeral as ar, NormalPrimitive as at, GenericObjectPrimitive as b, TIME_ZONES as bi, TimeZoneId as bn, ArrayOfPrimitivesToStringOptions as br, $TZLabelKey as bt, DeepKeys as c, TupleOf as ci, Quarter as cn, UnitLabel as cr, Numeric as ct, DotNotationKeyStrict as d, ValueOptional as di, SecondToken as dn, $DeepPartial as dr, Primitive as dt, Replace as ei, MinuteToken as en, PercentageOptions as er, HasMethods as et, DotValue as f, Unit as fi, TimeFormatToken as fn, $Expand as fr, Serializer as ft, FlattenDotValue as g, LOCALE_CODES as gi, TimeUnitValue as gn, $Subtract as gr, $GMTOffset as gt, FlattenDotKey as h, FRANKFURTER_CURRENCIES as hi, TimeUnit as hn, $Range as hr, $DateUnit as ht, $Record as i, RequireExactly as ii, MonthToken as in, RomanCapital as ir, NonNullishPrimitiveKey as it, ParsedQuery as j, ZodiacSign as jn, IsStrictObject as jr, ClockTime as jt, Objects as k, YearToken as kn, FromMetaOptions as kr, ClockMinute as kt, DeepKeysTuple as l, TupleToUnion as li, RelativeDateFormatOptions as ln, UnitNumberMethods as lr, OwnKeys as lt, ExtractStringKey as m, CURRENCY_LOCALES as mi, TimeToken as mn, $JoinRepeat as mr, VoidFn as mt, $DoesPathStartWith as n, RequireAtLeast as ni, MonthName as nn, RangeOptions as nr, Maybe as nt, ConvertedObject as o, Split as oi, NumberingSystem as on, SIPrefix as or, NormalPrimitiveKey as ot, ExpandAll as p, CURRENCY_CODES as pi, TimeOnlyFormat as pn, $Forbid as pr, ValidArray as pt, DelayedFn as q, GetValueOptions as qn, PropertyOptional as qr, HourToken as qt, $JoinDotKey as r, RequireBetween as ri, MonthString as rn, RangedNumbers as rr, MethodDescriptor as rt, CountryDetails as s, Tuple as si, PositiveUTCHour as sn, UnitKey as sr, NullOrUndefined as st, $Countries as t, ReplaceFirst as ti, MonthDateString as tn, RandomNumberOptions as tr, List as tt, DotNotationKey as u, ValueOf as ui, SafeFormat as un, $BuildTuple as ur, PartialOrRequired as ut, FlattenLeafValue as v, IANA_TZ_IDS as vi, TimeZone as vn, $Without as vr, $LocalArguments as vt, MergeAll as w, DAYS as wi, TimeZoneNameNative as wn, DeepKeyof as wr, $TimeZoneIdentifier as wt, KeyForArray as x, TIME_ZONES_NATIVE as xi, TimeZoneIdNative as xn, ArrayToStringOptions as xr, $TimeUnitKey as xt, GenericObject as y, NATIVE_TZ_IDS as yi, TimeZoneDetails as yn, ArrayOfObjectsToStringOptions as yr, $NativeTzNameOrId as yt, Any as z, DecimalOptions as zn, OmitByValue as zr, DayPart as zt };
|
|
@@ -15,10 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { d as isString } from "./primitives-Djsevc69.mjs";
|
|
18
|
-
import { E as isObjectWithKeys, T as isObject, g as isArrayOfType, j as isValidArray, v as isEmptyObject, w as isNotEmptyObject } from "./specials-
|
|
19
|
-
import { t as isDateLike } from "./guards-
|
|
20
|
-
import { n as trimString } from "./basics-
|
|
21
|
-
import { f as isDeepEqual } from "./utils-DXovsTKs.mjs";
|
|
18
|
+
import { E as isObjectWithKeys, T as isObject, g as isArrayOfType, j as isValidArray, v as isEmptyObject, w as isNotEmptyObject } from "./specials-Hq5Ncd6y.mjs";
|
|
19
|
+
import { t as isDateLike } from "./guards-BK1QuvFZ.mjs";
|
|
20
|
+
import { U as isDeepEqual, n as trimString } from "./basics-CebgkY-n.mjs";
|
|
22
21
|
|
|
23
22
|
//#region src/form/guards.ts
|
|
24
23
|
/**
|
|
@@ -15,10 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
const require_primitives = require('./primitives-CBGICrDR.cjs');
|
|
18
|
-
const require_specials = require('./specials-
|
|
19
|
-
const require_guards = require('./guards-
|
|
20
|
-
const require_basics = require('./basics-
|
|
21
|
-
const require_utils = require('./utils-BxguWSoa.cjs');
|
|
18
|
+
const require_specials = require('./specials-dkYP1Nh2.cjs');
|
|
19
|
+
const require_guards = require('./guards-Bsh6Bfdq.cjs');
|
|
20
|
+
const require_basics = require('./basics-CJmdhXoo.cjs');
|
|
22
21
|
|
|
23
22
|
//#region src/form/guards.ts
|
|
24
23
|
/**
|
|
@@ -339,7 +338,7 @@ const flattenObjectDotNotation = (object) => {
|
|
|
339
338
|
*/
|
|
340
339
|
const extractUpdatedFields = (baseObject, updatedObject) => {
|
|
341
340
|
const updatedFields = {};
|
|
342
|
-
for (const key in updatedObject) if (key in baseObject && !
|
|
341
|
+
for (const key in updatedObject) if (key in baseObject && !require_basics.isDeepEqual(updatedObject[key], baseObject[key])) if (updatedObject[key] && require_specials.isNotEmptyObject(updatedObject[key])) {
|
|
343
342
|
updatedFields[key] = extractUpdatedFields(baseObject[key], updatedObject[key]);
|
|
344
343
|
if (updatedFields[key] && require_specials.isEmptyObject(updatedFields[key])) delete updatedFields[key];
|
|
345
344
|
} else updatedFields[key] = updatedObject[key];
|
|
@@ -372,7 +371,7 @@ const extractUpdatedAndNewFields = (baseObject, updatedObject) => {
|
|
|
372
371
|
const updatedFields = {};
|
|
373
372
|
const newFields = {};
|
|
374
373
|
for (const key in updatedObject) if (!(key in baseObject)) newFields[key] = updatedObject[key];
|
|
375
|
-
else if (!
|
|
374
|
+
else if (!require_basics.isDeepEqual(updatedObject[key], baseObject[key])) if (updatedObject[key] && require_specials.isNotEmptyObject(updatedObject[key])) {
|
|
376
375
|
updatedFields[key] = extractUpdatedAndNewFields(baseObject[key], updatedObject[key]);
|
|
377
376
|
if (updatedFields[key] && require_specials.isEmptyObject(updatedFields[key])) delete updatedFields[key];
|
|
378
377
|
} else updatedFields[key] = updatedObject[key];
|
package/dist/paginator.d.cts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { Hr as PaginatorMeta, Ur as PaginatorOptions, Vr as PageListOptions, kr as FromMetaOptions } from "./object-Mglyg4AW.cjs";
|
|
18
18
|
|
|
19
19
|
//#region src/utils/Paginator.d.ts
|
|
20
20
|
/** @class Generates pagination logic, offsets, metadata and other pagination logic(s) for APIs and UIs. */
|
package/dist/paginator.d.mts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { Hr as PaginatorMeta, Ur as PaginatorOptions, Vr as PageListOptions, kr as FromMetaOptions } from "./object-Mglyg4AW.mjs";
|
|
18
18
|
|
|
19
19
|
//#region src/utils/Paginator.d.ts
|
|
20
20
|
/** @class Generates pagination logic, offsets, metadata and other pagination logic(s) for APIs and UIs. */
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
const require_primitives = require('./primitives-CBGICrDR.cjs');
|
|
18
|
-
const require_constants = require('./constants-
|
|
19
|
-
const require_specials = require('./specials-
|
|
20
|
-
const require_utilities = require('./utilities-
|
|
21
|
-
const require_guards = require('./guards-
|
|
18
|
+
const require_constants = require('./constants-Dz5vxNQ9.cjs');
|
|
19
|
+
const require_specials = require('./specials-dkYP1Nh2.cjs');
|
|
20
|
+
const require_utilities = require('./utilities-CWV1GPGY.cjs');
|
|
21
|
+
const require_guards = require('./guards-Bsh6Bfdq.cjs');
|
|
22
22
|
|
|
23
23
|
//#region src/date/helpers.ts
|
|
24
24
|
/** Core formatting logic shared by `formatDate` and `Chronos`, `BanglaCalendar` classes */
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { a as isNonEmptyString, c as isNumber, d as isString } from "./primitives-Djsevc69.mjs";
|
|
18
|
-
import {
|
|
19
|
-
import { d as isNumericString } from "./specials-
|
|
20
|
-
import { r as getOrdinal } from "./utilities-
|
|
21
|
-
import { i as isTimeWithUnit } from "./guards-
|
|
18
|
+
import { a as SORTED_TIME_FORMATS, n as MONTHS, r as MS_MAP, t as DAYS } from "./constants-j-iXjwDl.mjs";
|
|
19
|
+
import { d as isNumericString } from "./specials-Hq5Ncd6y.mjs";
|
|
20
|
+
import { r as getOrdinal } from "./utilities-DPscNbS1.mjs";
|
|
21
|
+
import { i as isTimeWithUnit } from "./guards-BK1QuvFZ.mjs";
|
|
22
22
|
|
|
23
23
|
//#region src/date/helpers.ts
|
|
24
24
|
/** Core formatting logic shared by `formatDate` and `Chronos`, `BanglaCalendar` classes */
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { ct as Numeric } from "./object-Mglyg4AW.cjs";
|
|
18
18
|
|
|
19
19
|
//#region src/types/pluralizer.d.ts
|
|
20
20
|
/** A pair of RegExp and replacement for pluralization rules */
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { ct as Numeric } from "./object-Mglyg4AW.mjs";
|
|
18
18
|
|
|
19
19
|
//#region src/types/pluralizer.d.ts
|
|
20
20
|
/** A pair of RegExp and replacement for pluralization rules */
|
package/dist/pluralizer.cjs
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
18
|
const require_primitives = require('./primitives-CBGICrDR.cjs');
|
|
19
|
-
const require_utilities = require('./utilities-
|
|
19
|
+
const require_utilities = require('./utilities-CWV1GPGY.cjs');
|
|
20
20
|
|
|
21
21
|
//#region src/pluralizer/rules.ts
|
|
22
22
|
/** Irregular singular → plural mappings */
|
|
@@ -453,9 +453,9 @@ const uncountables = /* @__PURE__ */ Object.freeze(new Set([
|
|
|
453
453
|
* - This class is useful for applications that need to handle natural language processing, such as chatbots, content management systems, or any text processing tasks that require accurate pluralization.
|
|
454
454
|
*
|
|
455
455
|
* @remarks
|
|
456
|
-
* - For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/
|
|
456
|
+
* - For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utils/string/format-unit-with-plural formatUnitWithPlural} instead.
|
|
457
457
|
*
|
|
458
|
-
* - For ready to use instance, please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/
|
|
458
|
+
* - For ready to use instance, please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utils/string/pluralizer pluralizer} instead.
|
|
459
459
|
*
|
|
460
460
|
* @example
|
|
461
461
|
* const pluralizer = new Pluralizer();
|
|
@@ -649,12 +649,12 @@ var Pluralizer = class {
|
|
|
649
649
|
}
|
|
650
650
|
};
|
|
651
651
|
/**
|
|
652
|
-
* Default shared instance of {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/
|
|
652
|
+
* Default shared instance of {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/pluralizer Pluralizer}.
|
|
653
653
|
*
|
|
654
654
|
* - _Use this when you don’t need multiple configurations._
|
|
655
655
|
* - _It comes preloaded with standard pluralization rules, irregular forms, and uncountable nouns._
|
|
656
656
|
*
|
|
657
|
-
* @remarks For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utilities/string/
|
|
657
|
+
* @remarks For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utilities/string/format-unit-with-plural formatUnitWithPlural} instead.
|
|
658
658
|
*
|
|
659
659
|
* * Handles English word pluralization and singularization with support for irregular forms and uncountable nouns.
|
|
660
660
|
*
|
|
@@ -665,7 +665,7 @@ var Pluralizer = class {
|
|
|
665
665
|
* - Supports options for count-based pluralization, allowing for inclusive formatting.
|
|
666
666
|
* - This is useful for applications that need to handle natural language processing, such as chatbots, content management systems, or any text processing tasks that require accurate pluralization.
|
|
667
667
|
* @example
|
|
668
|
-
* import { pluralizer } from '
|
|
668
|
+
* import { pluralizer } from 'toolbox-x/pluralizer';
|
|
669
669
|
*
|
|
670
670
|
* pluralizer.pluralize('child'); // "children"
|
|
671
671
|
* pluralizer.toSingular('geese'); // "goose"
|
package/dist/pluralizer.d.cts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { n as PluralizeOptions } from "./pluralizer-
|
|
17
|
+
import { n as PluralizeOptions } from "./pluralizer-BGMC8LLz.cjs";
|
|
18
18
|
|
|
19
19
|
//#region src/pluralizer/Pluralizer.d.ts
|
|
20
20
|
/**
|
|
@@ -28,9 +28,9 @@ import { n as PluralizeOptions } from "./pluralizer-CdG-VJ6t.cjs";
|
|
|
28
28
|
* - This class is useful for applications that need to handle natural language processing, such as chatbots, content management systems, or any text processing tasks that require accurate pluralization.
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
|
-
* - For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/
|
|
31
|
+
* - For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utils/string/format-unit-with-plural formatUnitWithPlural} instead.
|
|
32
32
|
*
|
|
33
|
-
* - For ready to use instance, please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/
|
|
33
|
+
* - For ready to use instance, please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utils/string/pluralizer pluralizer} instead.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* const pluralizer = new Pluralizer();
|
|
@@ -125,12 +125,12 @@ declare class Pluralizer {
|
|
|
125
125
|
isSingular(word: string): boolean;
|
|
126
126
|
}
|
|
127
127
|
/**
|
|
128
|
-
* Default shared instance of {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/
|
|
128
|
+
* Default shared instance of {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/pluralizer Pluralizer}.
|
|
129
129
|
*
|
|
130
130
|
* - _Use this when you don’t need multiple configurations._
|
|
131
131
|
* - _It comes preloaded with standard pluralization rules, irregular forms, and uncountable nouns._
|
|
132
132
|
*
|
|
133
|
-
* @remarks For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utilities/string/
|
|
133
|
+
* @remarks For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utilities/string/format-unit-with-plural formatUnitWithPlural} instead.
|
|
134
134
|
*
|
|
135
135
|
* * Handles English word pluralization and singularization with support for irregular forms and uncountable nouns.
|
|
136
136
|
*
|
|
@@ -141,7 +141,7 @@ declare class Pluralizer {
|
|
|
141
141
|
* - Supports options for count-based pluralization, allowing for inclusive formatting.
|
|
142
142
|
* - This is useful for applications that need to handle natural language processing, such as chatbots, content management systems, or any text processing tasks that require accurate pluralization.
|
|
143
143
|
* @example
|
|
144
|
-
* import { pluralizer } from '
|
|
144
|
+
* import { pluralizer } from 'toolbox-x/pluralizer';
|
|
145
145
|
*
|
|
146
146
|
* pluralizer.pluralize('child'); // "children"
|
|
147
147
|
* pluralizer.toSingular('geese'); // "goose"
|
package/dist/pluralizer.d.mts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { n as PluralizeOptions } from "./pluralizer-
|
|
17
|
+
import { n as PluralizeOptions } from "./pluralizer-CQNzRhwR.mjs";
|
|
18
18
|
|
|
19
19
|
//#region src/pluralizer/Pluralizer.d.ts
|
|
20
20
|
/**
|
|
@@ -28,9 +28,9 @@ import { n as PluralizeOptions } from "./pluralizer-D2Lh8CdU.mjs";
|
|
|
28
28
|
* - This class is useful for applications that need to handle natural language processing, such as chatbots, content management systems, or any text processing tasks that require accurate pluralization.
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
|
-
* - For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/
|
|
31
|
+
* - For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utils/string/format-unit-with-plural formatUnitWithPlural} instead.
|
|
32
32
|
*
|
|
33
|
-
* - For ready to use instance, please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/
|
|
33
|
+
* - For ready to use instance, please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utils/string/pluralizer pluralizer} instead.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* const pluralizer = new Pluralizer();
|
|
@@ -125,12 +125,12 @@ declare class Pluralizer {
|
|
|
125
125
|
isSingular(word: string): boolean;
|
|
126
126
|
}
|
|
127
127
|
/**
|
|
128
|
-
* Default shared instance of {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/
|
|
128
|
+
* Default shared instance of {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/pluralizer Pluralizer}.
|
|
129
129
|
*
|
|
130
130
|
* - _Use this when you don’t need multiple configurations._
|
|
131
131
|
* - _It comes preloaded with standard pluralization rules, irregular forms, and uncountable nouns._
|
|
132
132
|
*
|
|
133
|
-
* @remarks For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utilities/string/
|
|
133
|
+
* @remarks For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utilities/string/format-unit-with-plural formatUnitWithPlural} instead.
|
|
134
134
|
*
|
|
135
135
|
* * Handles English word pluralization and singularization with support for irregular forms and uncountable nouns.
|
|
136
136
|
*
|
|
@@ -141,7 +141,7 @@ declare class Pluralizer {
|
|
|
141
141
|
* - Supports options for count-based pluralization, allowing for inclusive formatting.
|
|
142
142
|
* - This is useful for applications that need to handle natural language processing, such as chatbots, content management systems, or any text processing tasks that require accurate pluralization.
|
|
143
143
|
* @example
|
|
144
|
-
* import { pluralizer } from '
|
|
144
|
+
* import { pluralizer } from 'toolbox-x/pluralizer';
|
|
145
145
|
*
|
|
146
146
|
* pluralizer.pluralize('child'); // "children"
|
|
147
147
|
* pluralizer.toSingular('geese'); // "goose"
|
package/dist/pluralizer.mjs
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { a as isNonEmptyString, d as isString, m as isUndefined } from "./primitives-Djsevc69.mjs";
|
|
18
|
-
import { a as normalizeNumber } from "./utilities-
|
|
18
|
+
import { a as normalizeNumber } from "./utilities-DPscNbS1.mjs";
|
|
19
19
|
|
|
20
20
|
//#region src/pluralizer/rules.ts
|
|
21
21
|
/** Irregular singular → plural mappings */
|
|
@@ -452,9 +452,9 @@ const uncountables = /* @__PURE__ */ Object.freeze(new Set([
|
|
|
452
452
|
* - This class is useful for applications that need to handle natural language processing, such as chatbots, content management systems, or any text processing tasks that require accurate pluralization.
|
|
453
453
|
*
|
|
454
454
|
* @remarks
|
|
455
|
-
* - For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/
|
|
455
|
+
* - For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utils/string/format-unit-with-plural formatUnitWithPlural} instead.
|
|
456
456
|
*
|
|
457
|
-
* - For ready to use instance, please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/
|
|
457
|
+
* - For ready to use instance, please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utils/string/pluralizer pluralizer} instead.
|
|
458
458
|
*
|
|
459
459
|
* @example
|
|
460
460
|
* const pluralizer = new Pluralizer();
|
|
@@ -648,12 +648,12 @@ var Pluralizer = class {
|
|
|
648
648
|
}
|
|
649
649
|
};
|
|
650
650
|
/**
|
|
651
|
-
* Default shared instance of {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/
|
|
651
|
+
* Default shared instance of {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/pluralizer Pluralizer}.
|
|
652
652
|
*
|
|
653
653
|
* - _Use this when you don’t need multiple configurations._
|
|
654
654
|
* - _It comes preloaded with standard pluralization rules, irregular forms, and uncountable nouns._
|
|
655
655
|
*
|
|
656
|
-
* @remarks For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utilities/string/
|
|
656
|
+
* @remarks For simpler pluralization (plural with only 's'), please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utilities/string/format-unit-with-plural formatUnitWithPlural} instead.
|
|
657
657
|
*
|
|
658
658
|
* * Handles English word pluralization and singularization with support for irregular forms and uncountable nouns.
|
|
659
659
|
*
|
|
@@ -664,7 +664,7 @@ var Pluralizer = class {
|
|
|
664
664
|
* - Supports options for count-based pluralization, allowing for inclusive formatting.
|
|
665
665
|
* - This is useful for applications that need to handle natural language processing, such as chatbots, content management systems, or any text processing tasks that require accurate pluralization.
|
|
666
666
|
* @example
|
|
667
|
-
* import { pluralizer } from '
|
|
667
|
+
* import { pluralizer } from 'toolbox-x/pluralizer';
|
|
668
668
|
*
|
|
669
669
|
* pluralizer.pluralize('child'); // "children"
|
|
670
670
|
* pluralizer.toSingular('geese'); // "goose"
|
|
@@ -81,7 +81,7 @@ function isFunction(value) {
|
|
|
81
81
|
* @returns `true` if the descriptor is defined and its value is a function; otherwise, `false`.
|
|
82
82
|
*/
|
|
83
83
|
const isMethodDescriptor = (descriptor) => {
|
|
84
|
-
return !!descriptor &&
|
|
84
|
+
return !!descriptor && isFunction(descriptor?.value);
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
87
|
* * Type guard to check if a value is a Date object.
|
|
@@ -269,7 +269,7 @@ function isIPAddress(value) {
|
|
|
269
269
|
/**
|
|
270
270
|
* * Type guard to check if the current environment matches a given string.
|
|
271
271
|
* @param env - The expected environment (e.g., "production", "development").
|
|
272
|
-
* @returns `true` if the value
|
|
272
|
+
* @returns `true` if the value equals to `process.env.NODE_ENV`, otherwise `false`.
|
|
273
273
|
*/
|
|
274
274
|
function isEnvironment(env) {
|
|
275
275
|
return process.env.NODE_ENV === env;
|
|
@@ -81,7 +81,7 @@ function isFunction(value) {
|
|
|
81
81
|
* @returns `true` if the descriptor is defined and its value is a function; otherwise, `false`.
|
|
82
82
|
*/
|
|
83
83
|
const isMethodDescriptor = (descriptor) => {
|
|
84
|
-
return !!descriptor &&
|
|
84
|
+
return !!descriptor && isFunction(descriptor?.value);
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
87
|
* * Type guard to check if a value is a Date object.
|
|
@@ -269,7 +269,7 @@ function isIPAddress(value) {
|
|
|
269
269
|
/**
|
|
270
270
|
* * Type guard to check if the current environment matches a given string.
|
|
271
271
|
* @param env - The expected environment (e.g., "production", "development").
|
|
272
|
-
* @returns `true` if the value
|
|
272
|
+
* @returns `true` if the value equals to `process.env.NODE_ENV`, otherwise `false`.
|
|
273
273
|
*/
|
|
274
274
|
function isEnvironment(env) {
|
|
275
275
|
return process.env.NODE_ENV === env;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { t as LOWERCASE } from "./constants-C7wERz5m.cjs";
|
|
18
|
-
import {
|
|
18
|
+
import { Fr as LooseLiteral, Mr as Join, oi as Split, t as $Countries } from "./object-Mglyg4AW.cjs";
|
|
19
19
|
|
|
20
20
|
//#region src/types/string.d.ts
|
|
21
21
|
declare global {
|
|
@@ -211,6 +211,8 @@ type TitleCase<Str extends string, Del extends string = ''> = Split<$NormalizeSt
|
|
|
211
211
|
* @remarks It will lowercase: auxiliaries, prepositions, articles and conjunctions unless they are at the beginning.
|
|
212
212
|
*/
|
|
213
213
|
type SentenceCase<Str extends string, Del extends string = ''> = Split<$NormalizeString<Str, Del>, ' '> extends [infer F extends string, ...infer R extends string[]] ? `${Capitalize<Lowercase<F>>} ${Join<$LowercaseWords<R>, ' '>}` : ' ';
|
|
214
|
+
/** Helper type to convert an empty string to `string` while maintaining the literal type otherwise. */
|
|
215
|
+
type $WidenEmpty<T extends string> = T extends '' ? string : T;
|
|
214
216
|
/** Matches any non-Latin character. */
|
|
215
217
|
type SpecialCharacter = Lowercase<string> & Uppercase<string>;
|
|
216
218
|
/** Evaluates whether a string consists only of Latin alphabet characters. */
|
|
@@ -259,4 +261,4 @@ interface CharDiffResult {
|
|
|
259
261
|
modified: HighlightedText[];
|
|
260
262
|
}
|
|
261
263
|
//#endregion
|
|
262
|
-
export {
|
|
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 };
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { t as LOWERCASE } from "./constants-C7wERz5m.mjs";
|
|
18
|
-
import {
|
|
18
|
+
import { Fr as LooseLiteral, Mr as Join, oi as Split, t as $Countries } from "./object-Mglyg4AW.mjs";
|
|
19
19
|
|
|
20
20
|
//#region src/types/string.d.ts
|
|
21
21
|
declare global {
|
|
@@ -211,6 +211,8 @@ type TitleCase<Str extends string, Del extends string = ''> = Split<$NormalizeSt
|
|
|
211
211
|
* @remarks It will lowercase: auxiliaries, prepositions, articles and conjunctions unless they are at the beginning.
|
|
212
212
|
*/
|
|
213
213
|
type SentenceCase<Str extends string, Del extends string = ''> = Split<$NormalizeString<Str, Del>, ' '> extends [infer F extends string, ...infer R extends string[]] ? `${Capitalize<Lowercase<F>>} ${Join<$LowercaseWords<R>, ' '>}` : ' ';
|
|
214
|
+
/** Helper type to convert an empty string to `string` while maintaining the literal type otherwise. */
|
|
215
|
+
type $WidenEmpty<T extends string> = T extends '' ? string : T;
|
|
214
216
|
/** Matches any non-Latin character. */
|
|
215
217
|
type SpecialCharacter = Lowercase<string> & Uppercase<string>;
|
|
216
218
|
/** Evaluates whether a string consists only of Latin alphabet characters. */
|
|
@@ -259,4 +261,4 @@ interface CharDiffResult {
|
|
|
259
261
|
modified: HighlightedText[];
|
|
260
262
|
}
|
|
261
263
|
//#endregion
|
|
262
|
-
export {
|
|
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 };
|
package/dist/stylog.cjs
CHANGED
|
@@ -19,7 +19,7 @@ const require_primitives = require('./primitives-CBGICrDR.cjs');
|
|
|
19
19
|
const require_css_colors = require('./css-colors-DC7oZ46Y.cjs');
|
|
20
20
|
const require_guards = require('./guards-DGN95D2h.cjs');
|
|
21
21
|
const require_convert = require('./convert-Cqy2Llek.cjs');
|
|
22
|
-
const require_specials = require('./specials-
|
|
22
|
+
const require_specials = require('./specials-dkYP1Nh2.cjs');
|
|
23
23
|
|
|
24
24
|
//#region src/stylog/console.log.ts
|
|
25
25
|
/**
|
|
@@ -210,7 +210,7 @@ function isTextStyle(value) {
|
|
|
210
210
|
*
|
|
211
211
|
* @remarks
|
|
212
212
|
* - Allows chaining of style methods or initializing with predefined styles.
|
|
213
|
-
* - For fluent, chainable styling with zero configuration use {@link https://toolbox-x.nazmul-nhb.dev/docs/
|
|
213
|
+
* - For fluent, chainable styling with zero configuration use {@link https://toolbox-x.nazmul-nhb.dev/docs/utils/misc/stylog Stylog} (`LogStyler` chainable wrapper).
|
|
214
214
|
*
|
|
215
215
|
* @example
|
|
216
216
|
* const styled = new LogStyler(['red', 'bold']);
|
|
@@ -316,7 +316,7 @@ var LogStyler = class LogStyler {
|
|
|
316
316
|
* @remarks
|
|
317
317
|
* - This method is specifically designed for browser environments and returns a tuple containing the formatted string with `%c` placeholder and an array of CSS styles (`string[]`).
|
|
318
318
|
* - Use this when you need direct access to the CSS styling for custom browser output.
|
|
319
|
-
* - If you want to format with ANSI escape codes, consider using {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/
|
|
319
|
+
* - If you want to format with ANSI escape codes, consider using {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/log-styler#toansiinput-stringify toANSI} method.
|
|
320
320
|
*
|
|
321
321
|
* @param input - Input to style before printing in the shell.
|
|
322
322
|
* @param stringify - Whether to apply `JSON.stringify()` before styling. Defaults to `false`.
|
|
@@ -375,7 +375,7 @@ var LogStyler = class LogStyler {
|
|
|
375
375
|
*
|
|
376
376
|
* @remarks
|
|
377
377
|
* - This method returns ANSI-formatted strings suitable for environments that support ANSI escape codes (terminals, modern browser consoles, etc.).
|
|
378
|
-
* - For unsupported browsers, consider using the {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/
|
|
378
|
+
* - For unsupported browsers, consider using the {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/log-styler#loginput-stringify log} method to print directly or {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/log-styler#tocssinput-stringify toCSS} to get styled tuple `[format, cssList]` for Browser.
|
|
379
379
|
*
|
|
380
380
|
* @param input - Input to style before printing in the shell.
|
|
381
381
|
* @param stringify - Whether to apply `JSON.stringify()` before styling. Defaults to `false`.
|
|
@@ -588,7 +588,7 @@ function createStylogProxy(styler) {
|
|
|
588
588
|
* - In browsers, styles are applied using `CSS`; in `Node.js`, `ANSI` escape codes are used.
|
|
589
589
|
* - When multiple styles of the same category are chained, the last one wins.
|
|
590
590
|
* - Use `.log(value, stringify?)` to print; set `stringify` to `true` to serialize with `JSON.stringify`.
|
|
591
|
-
* - If you need custom reusable style configurations, use {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/
|
|
591
|
+
* - If you need custom reusable style configurations, use {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/log-styler Stylog} class.
|
|
592
592
|
*
|
|
593
593
|
* @example
|
|
594
594
|
* // Simple color
|
package/dist/stylog.d.cts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { _ as Hex } from "./Color-
|
|
18
|
-
import { a as AnsiSequence, n as Stylog, o as BGColor, t as LogStyler, u as TextStyle } from "./Stylog-
|
|
17
|
+
import { _ as Hex } from "./Color-BCsnSEmt.cjs";
|
|
18
|
+
import { a as AnsiSequence, n as Stylog, o as BGColor, t as LogStyler, u as TextStyle } from "./Stylog-DJOVxym_.cjs";
|
|
19
19
|
|
|
20
20
|
//#region src/stylog/utils.d.ts
|
|
21
21
|
/**
|