@wavy/fn 0.0.5 → 0.0.7

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/main.cjs CHANGED
@@ -87,7 +87,7 @@ __export(main_exports, {
87
87
  takeWhile: () => takeWhile,
88
88
  timeDuration: () => timeDuration,
89
89
  toNumber: () => toNumber,
90
- toObject: () => toObject,
90
+ toObject: () => ObjectConverter_default,
91
91
  trimString: () => trimString,
92
92
  undefinedIfEmpty: () => undefinedIfEmpty,
93
93
  upperFirst: () => upperFirst,
@@ -95,6 +95,187 @@ __export(main_exports, {
95
95
  });
96
96
  module.exports = __toCommonJS(main_exports);
97
97
 
98
+ // src/helper-functions/HelperFunctions.ts
99
+ var import_types2 = require("@wavy/types");
100
+
101
+ // src/helper-functions/components/formatter/number/NumberFormatter.ts
102
+ var NumberFormatter = class _NumberFormatter {
103
+ static format(value, format2, options) {
104
+ switch (format2) {
105
+ case "money":
106
+ return _NumberFormatter.toMoney(value, options);
107
+ default:
108
+ return value.toLocaleString("en-us");
109
+ }
110
+ }
111
+ static toMoney(amount, options) {
112
+ const dollarSign = options?.excludeDollarSign ? "" : "$";
113
+ if (!amount) return dollarSign + (options?.dropDecimals ? "0" : "0.00");
114
+ if (options?.truncate) {
115
+ const strAmt = takeWhile(
116
+ `${amount}`.split(""),
117
+ (char) => char !== "."
118
+ ).join("");
119
+ const fmtMoney = (value, decimal) => {
120
+ const getTruncatedSuffix = () => {
121
+ if (strAmt.length <= 3) return "";
122
+ if (range(4, 7).includes(strAmt.length)) return "k";
123
+ if (range(7, 10).includes(strAmt.length)) return "m";
124
+ if (range(10, 13).includes(strAmt.length)) return "b";
125
+ if (range(13, 16).includes(strAmt.length)) return "t";
126
+ };
127
+ const fmtValue = parseInt(decimal) > 0 ? `${value}.${decimal}` : value;
128
+ return dollarSign + fmtValue + getTruncatedSuffix();
129
+ };
130
+ if (strAmt.length <= 3) return fmtMoney(strAmt, "0");
131
+ else {
132
+ const relevantDigits = takeLast(
133
+ windowed([...strAmt.split("")].reverse(), 3).map(
134
+ (arr) => arr.reverse()
135
+ ),
136
+ 2
137
+ ).reverse();
138
+ return fmtMoney(relevantDigits[0].join(""), relevantDigits[1][0]);
139
+ }
140
+ }
141
+ return (amount < 0 ? "-" : options?.showSigns ? "+" : "") + dollarSign + amount.toLocaleString("en-US", {
142
+ minimumFractionDigits: options?.dropDecimals ? 0 : 2,
143
+ currency: "USD",
144
+ currencyDisplay: "symbol",
145
+ currencySign: "accounting",
146
+ signDisplay: "never"
147
+ });
148
+ }
149
+ };
150
+ var NumberFormatter_default = NumberFormatter;
151
+
152
+ // src/helper-functions/components/formatter/object/ObjectFormatter.ts
153
+ var ObjectFormatter = class {
154
+ static toString = {
155
+ name: (name) => name ? `${name.first} ${name.last}`.trim() : "no_name",
156
+ phoneNumber: (phoneNumber) => {
157
+ if (!phoneNumber) return "no_phone_number";
158
+ return `${phoneNumber.countryCode} (${phoneNumber.areaCode}) ${insertAt(
159
+ phoneNumber.localNumber.split(""),
160
+ 3,
161
+ "-"
162
+ ).join("")}`;
163
+ },
164
+ address: (address, inline) => {
165
+ if (address === void 0) return "no_address";
166
+ const addressKeys = Object.keys(address).map((k) => k);
167
+ const delimiter = (isLast) => !isLast ? "," + (!inline ? "\n" : "") : "";
168
+ return addressKeys.map(
169
+ (key, idx) => address[key] + delimiter(idx === lastIndex(addressKeys))
170
+ ).join("") || "no_address";
171
+ }
172
+ };
173
+ };
174
+ var ObjectFormatter_default = ObjectFormatter;
175
+
176
+ // src/helper-functions/components/input/InputManager.ts
177
+ var InputManager = class {
178
+ static manualValidators = {
179
+ percent: (value) => StringFormatter_default.toNumber(value) <= 100 && run(value.split(".")?.[1], (dec) => dec ? dec.length <= 2 : true)
180
+ };
181
+ static formatters = {
182
+ money: {
183
+ format: (value) => take(
184
+ value.split(".").map(
185
+ (sect, idx) => idx === 0 ? `${NumberFormatter_default.format(StringFormatter_default.toNumber(sect))}` : take(sect.split(""), 2).join("")
186
+ ),
187
+ 2
188
+ ).join("."),
189
+ unformat: (value) => `${StringFormatter_default.toNumber(value)}`
190
+ }
191
+ };
192
+ static separateNumbersFormatter(options = {
193
+ numbersPerGroup: 3,
194
+ separator: "-"
195
+ }) {
196
+ return {
197
+ format: (value) => {
198
+ let groupedValues = windowed(
199
+ value.split(""),
200
+ options.numbersPerGroup
201
+ ).map((v) => v.join(""));
202
+ if (options.groupCount) {
203
+ groupedValues = [
204
+ ...take(groupedValues, options.groupCount),
205
+ drop(groupedValues, options.groupCount).join("").replace(options.separator, "")
206
+ ].filter((v) => !isEmpty(v));
207
+ }
208
+ return groupedValues.join(options.separator);
209
+ },
210
+ unformat: (value) => {
211
+ const unformatted = value.replaceAll(options.separator, "");
212
+ return unformatted;
213
+ }
214
+ };
215
+ }
216
+ };
217
+ var InputManager_default = InputManager;
218
+
219
+ // src/helper-functions/components/formatter/string/StringFormatter.ts
220
+ var VOWELS = "aeiouy";
221
+ var StringFormatter = class _StringFormatter {
222
+ static vowels = VOWELS;
223
+ static caseConverter = {
224
+ camelToLetter: (camelCase) => {
225
+ return camelCase.split("").map(
226
+ (char, charIdx) => charIdx === 0 ? char.toUpperCase() : char === char.toUpperCase() && char !== char.toLowerCase() ? ` ${char}` : char
227
+ ).join("");
228
+ }
229
+ };
230
+ static extract = {
231
+ capitalLetters: (value, count2) => {
232
+ return value.split("", count2).filter(
233
+ (char) => char === char.toUpperCase() && char !== char.toLowerCase()
234
+ );
235
+ }
236
+ };
237
+ static trimString(value, trim) {
238
+ let newValue = value;
239
+ while (newValue.endsWith(trim)) {
240
+ newValue = value.split("").reverse().join("").replace(trim, "").split("").reverse().join("");
241
+ }
242
+ return newValue;
243
+ }
244
+ static pluralize(value) {
245
+ return value[value.length - 1] === "s" ? value + "es" : value + "s";
246
+ }
247
+ static addArticle(value, article) {
248
+ let fmtArticle = "";
249
+ switch (article) {
250
+ case "a/an":
251
+ fmtArticle = VOWELS.includes(value?.[0].toLowerCase()) ? "An" : "A";
252
+ break;
253
+ default:
254
+ return article;
255
+ }
256
+ return `${fmtArticle.toLowerCase()} ${value}`;
257
+ }
258
+ static toSearch(from) {
259
+ return from.split("").filter((char) => char !== " ").join("").toLowerCase().trim();
260
+ }
261
+ static toMoney(from, options) {
262
+ return NumberFormatter_default.toMoney(_StringFormatter.toNumber(from), options);
263
+ }
264
+ static toTRN(from) {
265
+ return InputManager_default.separateNumbersFormatter().format(from);
266
+ }
267
+ static toNumber(value) {
268
+ const potentialNumber = take(value.split("."), 2).join(".").split("").map(
269
+ (char, idx) => idx === 0 && char === "-" ? char : "0123456789.".includes(char) ? char : ""
270
+ ).join("");
271
+ return isEmpty(potentialNumber.trim()) ? 0 : parseFloat(potentialNumber);
272
+ }
273
+ static upperFirst(value) {
274
+ return value.split("").map((char, idx) => idx === 0 ? char.toUpperCase() : char).join("");
275
+ }
276
+ };
277
+ var StringFormatter_default = StringFormatter;
278
+
98
279
  // src/helper-functions/components/time/TimeManager.ts
99
280
  var TimeManager = class _TimeManager {
100
281
  constructor(locale = "en-jm") {
@@ -267,188 +448,62 @@ var TimeManager = class _TimeManager {
267
448
  };
268
449
  var TimeManager_default = TimeManager;
269
450
 
270
- // src/helper-functions/components/formatter/number/NumberFormatter.ts
271
- var NumberFormatter = class _NumberFormatter {
272
- static format(value, format2, options) {
273
- switch (format2) {
274
- case "money":
275
- return _NumberFormatter.toMoney(value, options);
276
- default:
277
- return value.toLocaleString("en-us");
278
- }
279
- }
280
- static toMoney(amount, options) {
281
- const dollarSign = options?.excludeDollarSign ? "" : "$";
282
- if (!amount) return dollarSign + (options?.dropDecimals ? "0" : "0.00");
283
- if (options?.truncate) {
284
- const strAmt = takeWhile(
285
- `${amount}`.split(""),
286
- (char) => char !== "."
287
- ).join("");
288
- const fmtMoney = (value, decimal) => {
289
- const getTruncatedSuffix = () => {
290
- if (strAmt.length <= 3) return "";
291
- if (range(4, 7).includes(strAmt.length)) return "k";
292
- if (range(7, 10).includes(strAmt.length)) return "m";
293
- if (range(10, 13).includes(strAmt.length)) return "b";
294
- if (range(13, 16).includes(strAmt.length)) return "t";
295
- };
296
- const fmtValue = parseInt(decimal) > 0 ? `${value}.${decimal}` : value;
297
- return dollarSign + fmtValue + getTruncatedSuffix();
298
- };
299
- if (strAmt.length <= 3) return fmtMoney(strAmt, "0");
300
- else {
301
- const relevantDigits = takeLast(
302
- windowed([...strAmt.split("")].reverse(), 3).map(
303
- (arr) => arr.reverse()
304
- ),
305
- 2
306
- ).reverse();
307
- return fmtMoney(relevantDigits[0].join(""), relevantDigits[1][0]);
308
- }
309
- }
310
- return (amount < 0 ? "-" : options?.showSigns ? "+" : "") + dollarSign + amount.toLocaleString("en-US", {
311
- minimumFractionDigits: options?.dropDecimals ? 0 : 2,
312
- currency: "USD",
313
- currencyDisplay: "symbol",
314
- currencySign: "accounting",
315
- signDisplay: "never"
316
- });
317
- }
318
- };
319
- var NumberFormatter_default = NumberFormatter;
320
-
321
- // src/helper-functions/components/input/InputManager.ts
322
- var InputManager = class {
323
- static manualValidators = {
324
- percent: (value) => StringFormatter_default.toNumber(value) <= 100 && run(value.split(".")?.[1], (dec) => dec ? dec.length <= 2 : true)
325
- };
326
- static formatters = {
327
- money: {
328
- format: (value) => take(
329
- value.split(".").map(
330
- (sect, idx) => idx === 0 ? `${NumberFormatter_default.format(StringFormatter_default.toNumber(sect))}` : take(sect.split(""), 2).join("")
331
- ),
332
- 2
333
- ).join("."),
334
- unformat: (value) => `${StringFormatter_default.toNumber(value)}`
335
- }
336
- };
337
- static separateNumbersFormatter(options = {
338
- numbersPerGroup: 3,
339
- separator: "-"
340
- }) {
341
- return {
342
- format: (value) => {
343
- let groupedValues = windowed(
344
- value.split(""),
345
- options.numbersPerGroup
346
- ).map((v) => v.join(""));
347
- if (options.groupCount) {
348
- groupedValues = [
349
- ...take(groupedValues, options.groupCount),
350
- drop(groupedValues, options.groupCount).join("").replace(options.separator, "")
351
- ].filter((v) => !isEmpty(v));
451
+ // src/helper-functions/components/ObjectConverter.ts
452
+ var import_uuid = require("uuid");
453
+ var import_types = require("@wavy/types");
454
+ var import_console = require("console");
455
+ function fileToLocalFile(file, options) {
456
+ const fileName = (() => {
457
+ const fileExt = getFileExt(file.name);
458
+ if (options?.filename && options.filename.includes(fileExt))
459
+ return options.filename;
460
+ else if (options?.filename) return options.filename.trim() + fileExt;
461
+ return file.name;
462
+ })()?.trim?.();
463
+ const { name: _, size: __, ..._metadata } = file;
464
+ return {
465
+ uid: (0, import_uuid.v4)(),
466
+ description: options?.description,
467
+ path: options?.filepath || file?.webkitRelativePath,
468
+ typeAlias: options?.typeAlias || run(
469
+ Object.keys(import_types.LOCAL_FILE_MIME_TYPES).find(
470
+ (key) => import_types.LOCAL_FILE_MIME_TYPES[key].includes(file.type)
471
+ ),
472
+ (type) => {
473
+ if (!type) {
474
+ (0, import_console.log)("An unknown file type was found ", file.type);
475
+ return "unknown";
352
476
  }
353
- return groupedValues.join(options.separator);
354
- },
355
- unformat: (value) => {
356
- const unformatted = value.replaceAll(options.separator, "");
357
- return unformatted;
477
+ return type;
358
478
  }
359
- };
360
- }
361
- };
362
- var InputManager_default = InputManager;
363
-
364
- // src/helper-functions/components/formatter/string/StringFormatter.ts
365
- var VOWELS = "aeiouy";
366
- var StringFormatter = class _StringFormatter {
367
- static vowels = VOWELS;
368
- static caseConverter = {
369
- camelToLetter: (camelCase) => {
370
- return camelCase.split("").map(
371
- (char, charIdx) => charIdx === 0 ? char.toUpperCase() : char === char.toUpperCase() && char !== char.toLowerCase() ? ` ${char}` : char
372
- ).join("");
373
- }
479
+ ),
480
+ sizeInBytes: file.size,
481
+ uploadDate: options?.uploadDate === "now" ? Date.now() : options?.uploadDate ?? file?.lastModified,
482
+ name: fileName,
483
+ _metadata
374
484
  };
375
- static extract = {
376
- capitalLetters: (value, count2) => {
377
- return value.split("", count2).filter(
378
- (char) => char === char.toUpperCase() && char !== char.toLowerCase()
379
- );
380
- }
485
+ }
486
+ function localFileToFile(localFile) {
487
+ return {
488
+ name: localFile.name,
489
+ size: localFile.sizeInBytes,
490
+ ...localFile._metadata
381
491
  };
382
- static trimString(value, trim) {
383
- let newValue = value;
384
- while (newValue.endsWith(trim)) {
385
- newValue = value.split("").reverse().join("").replace(trim, "").split("").reverse().join("");
386
- }
387
- return newValue;
388
- }
389
- static pluralize(value) {
390
- return value[value.length - 1] === "s" ? value + "es" : value + "s";
391
- }
392
- static addArticle(value, article) {
393
- let fmtArticle = "";
394
- switch (article) {
395
- case "a/an":
396
- fmtArticle = VOWELS.includes(value?.[0].toLowerCase()) ? "An" : "A";
397
- break;
398
- default:
399
- return article;
492
+ }
493
+ var Overloader = class {
494
+ invoke(...args) {
495
+ if (isFile(args[0])) {
496
+ return fileToLocalFile(...args);
400
497
  }
401
- return `${fmtArticle.toLowerCase()} ${value}`;
402
- }
403
- static toSearch(from) {
404
- return from.split("").filter((char) => char !== " ").join("").toLowerCase().trim();
405
- }
406
- static toMoney(from, options) {
407
- return NumberFormatter_default.toMoney(_StringFormatter.toNumber(from), options);
408
- }
409
- static toTRN(from) {
410
- return InputManager_default.separateNumbersFormatter().format(from);
411
- }
412
- static toNumber(value) {
413
- const potentialNumber = take(value.split("."), 2).join(".").split("").map(
414
- (char, idx) => idx === 0 && char === "-" ? char : "0123456789.".includes(char) ? char : ""
415
- ).join("");
416
- return isEmpty(potentialNumber.trim()) ? 0 : parseFloat(potentialNumber);
417
- }
418
- static upperFirst(value) {
419
- return value.split("").map((char, idx) => idx === 0 ? char.toUpperCase() : char).join("");
498
+ if (isLocalFile(args[0])) {
499
+ return localFileToFile(...args);
500
+ } else throw new Error(`The arguments supplied are insufficient.`);
420
501
  }
421
502
  };
422
- var StringFormatter_default = StringFormatter;
423
-
424
- // src/helper-functions/components/formatter/object/ObjectFormatter.ts
425
- var ObjectFormatter = class {
426
- static toString = {
427
- name: (name) => name ? `${name.first} ${name.last}`.trim() : "no_name",
428
- phoneNumber: (phoneNumber) => {
429
- if (!phoneNumber) return "no_phone_number";
430
- return `${phoneNumber.countryCode} (${phoneNumber.areaCode}) ${insertAt(
431
- phoneNumber.localNumber.split(""),
432
- 3,
433
- "-"
434
- ).join("")}`;
435
- },
436
- address: (address, inline) => {
437
- if (address === void 0) return "no_address";
438
- const addressKeys = Object.keys(address).map((k) => k);
439
- const delimiter = (isLast) => !isLast ? "," + (!inline ? "\n" : "") : "";
440
- return addressKeys.map(
441
- (key, idx) => address[key] + delimiter(idx === lastIndex(addressKeys))
442
- ).join("") || "no_address";
443
- }
444
- };
445
- };
446
- var ObjectFormatter_default = ObjectFormatter;
503
+ var toObject = new Overloader().invoke;
504
+ var ObjectConverter_default = toObject;
447
505
 
448
506
  // src/helper-functions/HelperFunctions.ts
449
- var import_uuid = require("uuid");
450
- var import_types = require("@wavy/types");
451
- var import_console = require("console");
452
507
  var dateFormat = new TimeManager_default().format;
453
508
  var timeDuration = new TimeManager_default().getDuration;
454
509
  var upperFirst = StringFormatter_default.upperFirst;
@@ -484,19 +539,14 @@ function format(event, ...args) {
484
539
  }
485
540
  }
486
541
  function isFile(value) {
487
- const fileKeys = Object.keys({
488
- arrayBuffer: null,
489
- bytes: null,
490
- lastModified: null,
491
- name: null,
492
- size: null,
493
- slice: null,
494
- stream: null,
495
- text: null,
496
- type: null,
497
- webkitRelativePath: null
498
- });
499
- if (value && typeof value === "object" && fileKeys.every((key) => key in value) && fileKeys.length === Object.keys(value).length)
542
+ const requiredKeys = [
543
+ "name",
544
+ "size",
545
+ "type",
546
+ "lastModified",
547
+ "webkitRelativePath"
548
+ ];
549
+ if (value && typeof value === "object" && requiredKeys.every((key) => key in value))
500
550
  return true;
501
551
  return false;
502
552
  }
@@ -511,7 +561,7 @@ function isLocalFile(value) {
511
561
  uploadDate: 0,
512
562
  _metadata: void 0
513
563
  };
514
- const optionalKeys = ["description", "_metadata"];
564
+ const optionalKeys = ["description"];
515
565
  const requiredKeys = Object.keys(dummyLocalFile).filter((key) => !optionalKeys.includes(key));
516
566
  const allKeys = [requiredKeys, optionalKeys].flat();
517
567
  if (value && typeof value === "object" && requiredKeys.every((key) => key in value) && Object.keys(value).every((key) => allKeys.includes(key))) {
@@ -519,68 +569,8 @@ function isLocalFile(value) {
519
569
  }
520
570
  return false;
521
571
  }
522
- var toObject = new class T {
523
- fileToLocalFile(file, options) {
524
- const fileName = (() => {
525
- const fileExt = getFileExt(file.name);
526
- if (options?.filename && options.filename.includes(fileExt))
527
- return options.filename;
528
- else if (options?.filename) return options.filename.trim() + fileExt;
529
- return file.name;
530
- })()?.trim?.();
531
- const { name: _, size: __, ..._metadata } = file;
532
- return {
533
- uid: (0, import_uuid.v4)(),
534
- description: options?.description,
535
- path: options?.filepath || file.webkitRelativePath,
536
- typeAlias: options?.typeAlias || run(
537
- Object.keys(import_types.LOCAL_FILE_MIME_TYPES).find(
538
- (key) => import_types.LOCAL_FILE_MIME_TYPES[key].includes(file.type)
539
- ),
540
- (type) => {
541
- if (!type) {
542
- (0, import_console.log)("An unknown file type was found ", file.type);
543
- return "unknown";
544
- }
545
- return type;
546
- }
547
- ),
548
- sizeInBytes: file.size,
549
- uploadDate: options?.uploadDate === "now" ? Date.now() : options?.uploadDate ?? file.lastModified,
550
- name: fileName,
551
- _metadata
552
- };
553
- }
554
- localFileToFile(localFile) {
555
- if ("_metadata" in localFile) {
556
- return {
557
- name: localFile.name,
558
- size: localFile.sizeInBytes,
559
- ...localFile._metadata
560
- };
561
- }
562
- return {
563
- name: localFile.name,
564
- size: localFile.sizeInBytes,
565
- webkitRelativePath: localFile.path,
566
- lastModified: localFile.uploadDate
567
- };
568
- }
569
- invoke(...args) {
570
- if (isFile(args[0])) {
571
- return this.fileToLocalFile(
572
- ...args
573
- );
574
- }
575
- if (isLocalFile(args[0])) {
576
- return this.localFileToFile(
577
- ...args
578
- );
579
- } else throw new Error(`The arguments supplied are insufficient.`);
580
- }
581
- }().invoke;
582
572
  function getMimeTypes(typeAliases) {
583
- return distinct(strictArray(typeAliases)).map((alias) => import_types.LOCAL_FILE_MIME_TYPES[alias]).flat();
573
+ return distinct(strictArray(typeAliases)).map((alias) => import_types2.LOCAL_FILE_MIME_TYPES[alias]).flat();
584
574
  }
585
575
  function classNameResolver(baseClassName) {
586
576
  return (className) => {
@@ -893,7 +883,7 @@ function arrayWithConst(array) {
893
883
  }
894
884
 
895
885
  // src/server-adapters/ServerAdapters.ts
896
- var import_types2 = require("@wavy/types");
886
+ var import_types3 = require("@wavy/types");
897
887
  var iiKeys = Object.keys({
898
888
  name: null,
899
889
  address: null,
package/dist/main.d.cts CHANGED
@@ -31,6 +31,17 @@ declare class StringFormatter {
31
31
  static upperFirst(value: string): string;
32
32
  }
33
33
 
34
+ declare const toObject: {
35
+ (file: File | Pick<File, "name" | "size" | "type" | "webkitRelativePath" | "lastModified">, options?: Partial<{
36
+ uploadDate: number | "now";
37
+ description: string;
38
+ filepath: string;
39
+ filename: string;
40
+ typeAlias: LocalFile["typeAlias"];
41
+ }> | undefined): LocalFile;
42
+ (localFile: LocalFile): File;
43
+ };
44
+
34
45
  declare const dateFormat: (time: number | Date | "now", format?: DateFormat) => string;
35
46
  declare const timeDuration: (from: number, to: number, options?: {
36
47
  disableRemainder?: boolean;
@@ -51,16 +62,6 @@ declare const toMoney: (value: string | number, options?: NumberFormatterTypes["
51
62
  declare function format<Event extends "date" | "money" | "name" | "phone-number" | "address">(event: Event, ...args: Event extends "date" ? Parameters<typeof dateFormat> : Event extends "money" ? Parameters<typeof toMoney> : Event extends "name" ? Parameters<typeof nameToString> : Event extends "phone-number" ? Parameters<typeof phoneNoToString> : Event extends "address" ? Parameters<typeof addressToString> : never): Event extends "date" ? ReturnType<typeof dateFormat> : Event extends "money" ? ReturnType<typeof toMoney> : Event extends "name" ? ReturnType<typeof nameToString> : Event extends "phone-number" ? ReturnType<typeof phoneNoToString> : Event extends "address" ? ReturnType<typeof addressToString> : never;
52
63
  declare function isFile(value: unknown): value is File;
53
64
  declare function isLocalFile(value: unknown): value is LocalFile;
54
- declare const toObject: {
55
- (file: File, options?: Partial<{
56
- uploadDate: number | "now";
57
- description: string;
58
- filepath: string;
59
- filename: string;
60
- typeAlias: LocalFile["typeAlias"];
61
- }> | undefined): LocalFile;
62
- (localFile: LocalFile | SanitizeLocalType<LocalFile>): File;
63
- };
64
65
  declare function getMimeTypes(typeAliases: KnownFileTypeAlias[]): string[];
65
66
  declare function classNameResolver(baseClassName: string): (className: string) => string;
66
67
  declare function classNameExt(rootClassName: string): (className: string) => string;
package/dist/main.d.ts CHANGED
@@ -31,6 +31,17 @@ declare class StringFormatter {
31
31
  static upperFirst(value: string): string;
32
32
  }
33
33
 
34
+ declare const toObject: {
35
+ (file: File | Pick<File, "name" | "size" | "type" | "webkitRelativePath" | "lastModified">, options?: Partial<{
36
+ uploadDate: number | "now";
37
+ description: string;
38
+ filepath: string;
39
+ filename: string;
40
+ typeAlias: LocalFile["typeAlias"];
41
+ }> | undefined): LocalFile;
42
+ (localFile: LocalFile): File;
43
+ };
44
+
34
45
  declare const dateFormat: (time: number | Date | "now", format?: DateFormat) => string;
35
46
  declare const timeDuration: (from: number, to: number, options?: {
36
47
  disableRemainder?: boolean;
@@ -51,16 +62,6 @@ declare const toMoney: (value: string | number, options?: NumberFormatterTypes["
51
62
  declare function format<Event extends "date" | "money" | "name" | "phone-number" | "address">(event: Event, ...args: Event extends "date" ? Parameters<typeof dateFormat> : Event extends "money" ? Parameters<typeof toMoney> : Event extends "name" ? Parameters<typeof nameToString> : Event extends "phone-number" ? Parameters<typeof phoneNoToString> : Event extends "address" ? Parameters<typeof addressToString> : never): Event extends "date" ? ReturnType<typeof dateFormat> : Event extends "money" ? ReturnType<typeof toMoney> : Event extends "name" ? ReturnType<typeof nameToString> : Event extends "phone-number" ? ReturnType<typeof phoneNoToString> : Event extends "address" ? ReturnType<typeof addressToString> : never;
52
63
  declare function isFile(value: unknown): value is File;
53
64
  declare function isLocalFile(value: unknown): value is LocalFile;
54
- declare const toObject: {
55
- (file: File, options?: Partial<{
56
- uploadDate: number | "now";
57
- description: string;
58
- filepath: string;
59
- filename: string;
60
- typeAlias: LocalFile["typeAlias"];
61
- }> | undefined): LocalFile;
62
- (localFile: LocalFile | SanitizeLocalType<LocalFile>): File;
63
- };
64
65
  declare function getMimeTypes(typeAliases: KnownFileTypeAlias[]): string[];
65
66
  declare function classNameResolver(baseClassName: string): (className: string) => string;
66
67
  declare function classNameExt(rootClassName: string): (className: string) => string;
package/dist/main.js CHANGED
@@ -1,3 +1,184 @@
1
+ // src/helper-functions/HelperFunctions.ts
2
+ import { LOCAL_FILE_MIME_TYPES as LOCAL_FILE_MIME_TYPES2 } from "@wavy/types";
3
+
4
+ // src/helper-functions/components/formatter/number/NumberFormatter.ts
5
+ var NumberFormatter = class _NumberFormatter {
6
+ static format(value, format2, options) {
7
+ switch (format2) {
8
+ case "money":
9
+ return _NumberFormatter.toMoney(value, options);
10
+ default:
11
+ return value.toLocaleString("en-us");
12
+ }
13
+ }
14
+ static toMoney(amount, options) {
15
+ const dollarSign = options?.excludeDollarSign ? "" : "$";
16
+ if (!amount) return dollarSign + (options?.dropDecimals ? "0" : "0.00");
17
+ if (options?.truncate) {
18
+ const strAmt = takeWhile(
19
+ `${amount}`.split(""),
20
+ (char) => char !== "."
21
+ ).join("");
22
+ const fmtMoney = (value, decimal) => {
23
+ const getTruncatedSuffix = () => {
24
+ if (strAmt.length <= 3) return "";
25
+ if (range(4, 7).includes(strAmt.length)) return "k";
26
+ if (range(7, 10).includes(strAmt.length)) return "m";
27
+ if (range(10, 13).includes(strAmt.length)) return "b";
28
+ if (range(13, 16).includes(strAmt.length)) return "t";
29
+ };
30
+ const fmtValue = parseInt(decimal) > 0 ? `${value}.${decimal}` : value;
31
+ return dollarSign + fmtValue + getTruncatedSuffix();
32
+ };
33
+ if (strAmt.length <= 3) return fmtMoney(strAmt, "0");
34
+ else {
35
+ const relevantDigits = takeLast(
36
+ windowed([...strAmt.split("")].reverse(), 3).map(
37
+ (arr) => arr.reverse()
38
+ ),
39
+ 2
40
+ ).reverse();
41
+ return fmtMoney(relevantDigits[0].join(""), relevantDigits[1][0]);
42
+ }
43
+ }
44
+ return (amount < 0 ? "-" : options?.showSigns ? "+" : "") + dollarSign + amount.toLocaleString("en-US", {
45
+ minimumFractionDigits: options?.dropDecimals ? 0 : 2,
46
+ currency: "USD",
47
+ currencyDisplay: "symbol",
48
+ currencySign: "accounting",
49
+ signDisplay: "never"
50
+ });
51
+ }
52
+ };
53
+ var NumberFormatter_default = NumberFormatter;
54
+
55
+ // src/helper-functions/components/formatter/object/ObjectFormatter.ts
56
+ var ObjectFormatter = class {
57
+ static toString = {
58
+ name: (name) => name ? `${name.first} ${name.last}`.trim() : "no_name",
59
+ phoneNumber: (phoneNumber) => {
60
+ if (!phoneNumber) return "no_phone_number";
61
+ return `${phoneNumber.countryCode} (${phoneNumber.areaCode}) ${insertAt(
62
+ phoneNumber.localNumber.split(""),
63
+ 3,
64
+ "-"
65
+ ).join("")}`;
66
+ },
67
+ address: (address, inline) => {
68
+ if (address === void 0) return "no_address";
69
+ const addressKeys = Object.keys(address).map((k) => k);
70
+ const delimiter = (isLast) => !isLast ? "," + (!inline ? "\n" : "") : "";
71
+ return addressKeys.map(
72
+ (key, idx) => address[key] + delimiter(idx === lastIndex(addressKeys))
73
+ ).join("") || "no_address";
74
+ }
75
+ };
76
+ };
77
+ var ObjectFormatter_default = ObjectFormatter;
78
+
79
+ // src/helper-functions/components/input/InputManager.ts
80
+ var InputManager = class {
81
+ static manualValidators = {
82
+ percent: (value) => StringFormatter_default.toNumber(value) <= 100 && run(value.split(".")?.[1], (dec) => dec ? dec.length <= 2 : true)
83
+ };
84
+ static formatters = {
85
+ money: {
86
+ format: (value) => take(
87
+ value.split(".").map(
88
+ (sect, idx) => idx === 0 ? `${NumberFormatter_default.format(StringFormatter_default.toNumber(sect))}` : take(sect.split(""), 2).join("")
89
+ ),
90
+ 2
91
+ ).join("."),
92
+ unformat: (value) => `${StringFormatter_default.toNumber(value)}`
93
+ }
94
+ };
95
+ static separateNumbersFormatter(options = {
96
+ numbersPerGroup: 3,
97
+ separator: "-"
98
+ }) {
99
+ return {
100
+ format: (value) => {
101
+ let groupedValues = windowed(
102
+ value.split(""),
103
+ options.numbersPerGroup
104
+ ).map((v) => v.join(""));
105
+ if (options.groupCount) {
106
+ groupedValues = [
107
+ ...take(groupedValues, options.groupCount),
108
+ drop(groupedValues, options.groupCount).join("").replace(options.separator, "")
109
+ ].filter((v) => !isEmpty(v));
110
+ }
111
+ return groupedValues.join(options.separator);
112
+ },
113
+ unformat: (value) => {
114
+ const unformatted = value.replaceAll(options.separator, "");
115
+ return unformatted;
116
+ }
117
+ };
118
+ }
119
+ };
120
+ var InputManager_default = InputManager;
121
+
122
+ // src/helper-functions/components/formatter/string/StringFormatter.ts
123
+ var VOWELS = "aeiouy";
124
+ var StringFormatter = class _StringFormatter {
125
+ static vowels = VOWELS;
126
+ static caseConverter = {
127
+ camelToLetter: (camelCase) => {
128
+ return camelCase.split("").map(
129
+ (char, charIdx) => charIdx === 0 ? char.toUpperCase() : char === char.toUpperCase() && char !== char.toLowerCase() ? ` ${char}` : char
130
+ ).join("");
131
+ }
132
+ };
133
+ static extract = {
134
+ capitalLetters: (value, count2) => {
135
+ return value.split("", count2).filter(
136
+ (char) => char === char.toUpperCase() && char !== char.toLowerCase()
137
+ );
138
+ }
139
+ };
140
+ static trimString(value, trim) {
141
+ let newValue = value;
142
+ while (newValue.endsWith(trim)) {
143
+ newValue = value.split("").reverse().join("").replace(trim, "").split("").reverse().join("");
144
+ }
145
+ return newValue;
146
+ }
147
+ static pluralize(value) {
148
+ return value[value.length - 1] === "s" ? value + "es" : value + "s";
149
+ }
150
+ static addArticle(value, article) {
151
+ let fmtArticle = "";
152
+ switch (article) {
153
+ case "a/an":
154
+ fmtArticle = VOWELS.includes(value?.[0].toLowerCase()) ? "An" : "A";
155
+ break;
156
+ default:
157
+ return article;
158
+ }
159
+ return `${fmtArticle.toLowerCase()} ${value}`;
160
+ }
161
+ static toSearch(from) {
162
+ return from.split("").filter((char) => char !== " ").join("").toLowerCase().trim();
163
+ }
164
+ static toMoney(from, options) {
165
+ return NumberFormatter_default.toMoney(_StringFormatter.toNumber(from), options);
166
+ }
167
+ static toTRN(from) {
168
+ return InputManager_default.separateNumbersFormatter().format(from);
169
+ }
170
+ static toNumber(value) {
171
+ const potentialNumber = take(value.split("."), 2).join(".").split("").map(
172
+ (char, idx) => idx === 0 && char === "-" ? char : "0123456789.".includes(char) ? char : ""
173
+ ).join("");
174
+ return isEmpty(potentialNumber.trim()) ? 0 : parseFloat(potentialNumber);
175
+ }
176
+ static upperFirst(value) {
177
+ return value.split("").map((char, idx) => idx === 0 ? char.toUpperCase() : char).join("");
178
+ }
179
+ };
180
+ var StringFormatter_default = StringFormatter;
181
+
1
182
  // src/helper-functions/components/time/TimeManager.ts
2
183
  var TimeManager = class _TimeManager {
3
184
  constructor(locale = "en-jm") {
@@ -170,188 +351,62 @@ var TimeManager = class _TimeManager {
170
351
  };
171
352
  var TimeManager_default = TimeManager;
172
353
 
173
- // src/helper-functions/components/formatter/number/NumberFormatter.ts
174
- var NumberFormatter = class _NumberFormatter {
175
- static format(value, format2, options) {
176
- switch (format2) {
177
- case "money":
178
- return _NumberFormatter.toMoney(value, options);
179
- default:
180
- return value.toLocaleString("en-us");
181
- }
182
- }
183
- static toMoney(amount, options) {
184
- const dollarSign = options?.excludeDollarSign ? "" : "$";
185
- if (!amount) return dollarSign + (options?.dropDecimals ? "0" : "0.00");
186
- if (options?.truncate) {
187
- const strAmt = takeWhile(
188
- `${amount}`.split(""),
189
- (char) => char !== "."
190
- ).join("");
191
- const fmtMoney = (value, decimal) => {
192
- const getTruncatedSuffix = () => {
193
- if (strAmt.length <= 3) return "";
194
- if (range(4, 7).includes(strAmt.length)) return "k";
195
- if (range(7, 10).includes(strAmt.length)) return "m";
196
- if (range(10, 13).includes(strAmt.length)) return "b";
197
- if (range(13, 16).includes(strAmt.length)) return "t";
198
- };
199
- const fmtValue = parseInt(decimal) > 0 ? `${value}.${decimal}` : value;
200
- return dollarSign + fmtValue + getTruncatedSuffix();
201
- };
202
- if (strAmt.length <= 3) return fmtMoney(strAmt, "0");
203
- else {
204
- const relevantDigits = takeLast(
205
- windowed([...strAmt.split("")].reverse(), 3).map(
206
- (arr) => arr.reverse()
207
- ),
208
- 2
209
- ).reverse();
210
- return fmtMoney(relevantDigits[0].join(""), relevantDigits[1][0]);
211
- }
212
- }
213
- return (amount < 0 ? "-" : options?.showSigns ? "+" : "") + dollarSign + amount.toLocaleString("en-US", {
214
- minimumFractionDigits: options?.dropDecimals ? 0 : 2,
215
- currency: "USD",
216
- currencyDisplay: "symbol",
217
- currencySign: "accounting",
218
- signDisplay: "never"
219
- });
220
- }
221
- };
222
- var NumberFormatter_default = NumberFormatter;
223
-
224
- // src/helper-functions/components/input/InputManager.ts
225
- var InputManager = class {
226
- static manualValidators = {
227
- percent: (value) => StringFormatter_default.toNumber(value) <= 100 && run(value.split(".")?.[1], (dec) => dec ? dec.length <= 2 : true)
228
- };
229
- static formatters = {
230
- money: {
231
- format: (value) => take(
232
- value.split(".").map(
233
- (sect, idx) => idx === 0 ? `${NumberFormatter_default.format(StringFormatter_default.toNumber(sect))}` : take(sect.split(""), 2).join("")
234
- ),
235
- 2
236
- ).join("."),
237
- unformat: (value) => `${StringFormatter_default.toNumber(value)}`
238
- }
239
- };
240
- static separateNumbersFormatter(options = {
241
- numbersPerGroup: 3,
242
- separator: "-"
243
- }) {
244
- return {
245
- format: (value) => {
246
- let groupedValues = windowed(
247
- value.split(""),
248
- options.numbersPerGroup
249
- ).map((v) => v.join(""));
250
- if (options.groupCount) {
251
- groupedValues = [
252
- ...take(groupedValues, options.groupCount),
253
- drop(groupedValues, options.groupCount).join("").replace(options.separator, "")
254
- ].filter((v) => !isEmpty(v));
354
+ // src/helper-functions/components/ObjectConverter.ts
355
+ import { v4 } from "uuid";
356
+ import { LOCAL_FILE_MIME_TYPES } from "@wavy/types";
357
+ import { log } from "console";
358
+ function fileToLocalFile(file, options) {
359
+ const fileName = (() => {
360
+ const fileExt = getFileExt(file.name);
361
+ if (options?.filename && options.filename.includes(fileExt))
362
+ return options.filename;
363
+ else if (options?.filename) return options.filename.trim() + fileExt;
364
+ return file.name;
365
+ })()?.trim?.();
366
+ const { name: _, size: __, ..._metadata } = file;
367
+ return {
368
+ uid: v4(),
369
+ description: options?.description,
370
+ path: options?.filepath || file?.webkitRelativePath,
371
+ typeAlias: options?.typeAlias || run(
372
+ Object.keys(LOCAL_FILE_MIME_TYPES).find(
373
+ (key) => LOCAL_FILE_MIME_TYPES[key].includes(file.type)
374
+ ),
375
+ (type) => {
376
+ if (!type) {
377
+ log("An unknown file type was found ", file.type);
378
+ return "unknown";
255
379
  }
256
- return groupedValues.join(options.separator);
257
- },
258
- unformat: (value) => {
259
- const unformatted = value.replaceAll(options.separator, "");
260
- return unformatted;
380
+ return type;
261
381
  }
262
- };
263
- }
264
- };
265
- var InputManager_default = InputManager;
266
-
267
- // src/helper-functions/components/formatter/string/StringFormatter.ts
268
- var VOWELS = "aeiouy";
269
- var StringFormatter = class _StringFormatter {
270
- static vowels = VOWELS;
271
- static caseConverter = {
272
- camelToLetter: (camelCase) => {
273
- return camelCase.split("").map(
274
- (char, charIdx) => charIdx === 0 ? char.toUpperCase() : char === char.toUpperCase() && char !== char.toLowerCase() ? ` ${char}` : char
275
- ).join("");
276
- }
382
+ ),
383
+ sizeInBytes: file.size,
384
+ uploadDate: options?.uploadDate === "now" ? Date.now() : options?.uploadDate ?? file?.lastModified,
385
+ name: fileName,
386
+ _metadata
277
387
  };
278
- static extract = {
279
- capitalLetters: (value, count2) => {
280
- return value.split("", count2).filter(
281
- (char) => char === char.toUpperCase() && char !== char.toLowerCase()
282
- );
283
- }
388
+ }
389
+ function localFileToFile(localFile) {
390
+ return {
391
+ name: localFile.name,
392
+ size: localFile.sizeInBytes,
393
+ ...localFile._metadata
284
394
  };
285
- static trimString(value, trim) {
286
- let newValue = value;
287
- while (newValue.endsWith(trim)) {
288
- newValue = value.split("").reverse().join("").replace(trim, "").split("").reverse().join("");
289
- }
290
- return newValue;
291
- }
292
- static pluralize(value) {
293
- return value[value.length - 1] === "s" ? value + "es" : value + "s";
294
- }
295
- static addArticle(value, article) {
296
- let fmtArticle = "";
297
- switch (article) {
298
- case "a/an":
299
- fmtArticle = VOWELS.includes(value?.[0].toLowerCase()) ? "An" : "A";
300
- break;
301
- default:
302
- return article;
395
+ }
396
+ var Overloader = class {
397
+ invoke(...args) {
398
+ if (isFile(args[0])) {
399
+ return fileToLocalFile(...args);
303
400
  }
304
- return `${fmtArticle.toLowerCase()} ${value}`;
305
- }
306
- static toSearch(from) {
307
- return from.split("").filter((char) => char !== " ").join("").toLowerCase().trim();
308
- }
309
- static toMoney(from, options) {
310
- return NumberFormatter_default.toMoney(_StringFormatter.toNumber(from), options);
311
- }
312
- static toTRN(from) {
313
- return InputManager_default.separateNumbersFormatter().format(from);
314
- }
315
- static toNumber(value) {
316
- const potentialNumber = take(value.split("."), 2).join(".").split("").map(
317
- (char, idx) => idx === 0 && char === "-" ? char : "0123456789.".includes(char) ? char : ""
318
- ).join("");
319
- return isEmpty(potentialNumber.trim()) ? 0 : parseFloat(potentialNumber);
320
- }
321
- static upperFirst(value) {
322
- return value.split("").map((char, idx) => idx === 0 ? char.toUpperCase() : char).join("");
401
+ if (isLocalFile(args[0])) {
402
+ return localFileToFile(...args);
403
+ } else throw new Error(`The arguments supplied are insufficient.`);
323
404
  }
324
405
  };
325
- var StringFormatter_default = StringFormatter;
326
-
327
- // src/helper-functions/components/formatter/object/ObjectFormatter.ts
328
- var ObjectFormatter = class {
329
- static toString = {
330
- name: (name) => name ? `${name.first} ${name.last}`.trim() : "no_name",
331
- phoneNumber: (phoneNumber) => {
332
- if (!phoneNumber) return "no_phone_number";
333
- return `${phoneNumber.countryCode} (${phoneNumber.areaCode}) ${insertAt(
334
- phoneNumber.localNumber.split(""),
335
- 3,
336
- "-"
337
- ).join("")}`;
338
- },
339
- address: (address, inline) => {
340
- if (address === void 0) return "no_address";
341
- const addressKeys = Object.keys(address).map((k) => k);
342
- const delimiter = (isLast) => !isLast ? "," + (!inline ? "\n" : "") : "";
343
- return addressKeys.map(
344
- (key, idx) => address[key] + delimiter(idx === lastIndex(addressKeys))
345
- ).join("") || "no_address";
346
- }
347
- };
348
- };
349
- var ObjectFormatter_default = ObjectFormatter;
406
+ var toObject = new Overloader().invoke;
407
+ var ObjectConverter_default = toObject;
350
408
 
351
409
  // src/helper-functions/HelperFunctions.ts
352
- import { v4 } from "uuid";
353
- import { LOCAL_FILE_MIME_TYPES } from "@wavy/types";
354
- import { log } from "console";
355
410
  var dateFormat = new TimeManager_default().format;
356
411
  var timeDuration = new TimeManager_default().getDuration;
357
412
  var upperFirst = StringFormatter_default.upperFirst;
@@ -387,19 +442,14 @@ function format(event, ...args) {
387
442
  }
388
443
  }
389
444
  function isFile(value) {
390
- const fileKeys = Object.keys({
391
- arrayBuffer: null,
392
- bytes: null,
393
- lastModified: null,
394
- name: null,
395
- size: null,
396
- slice: null,
397
- stream: null,
398
- text: null,
399
- type: null,
400
- webkitRelativePath: null
401
- });
402
- if (value && typeof value === "object" && fileKeys.every((key) => key in value) && fileKeys.length === Object.keys(value).length)
445
+ const requiredKeys = [
446
+ "name",
447
+ "size",
448
+ "type",
449
+ "lastModified",
450
+ "webkitRelativePath"
451
+ ];
452
+ if (value && typeof value === "object" && requiredKeys.every((key) => key in value))
403
453
  return true;
404
454
  return false;
405
455
  }
@@ -414,7 +464,7 @@ function isLocalFile(value) {
414
464
  uploadDate: 0,
415
465
  _metadata: void 0
416
466
  };
417
- const optionalKeys = ["description", "_metadata"];
467
+ const optionalKeys = ["description"];
418
468
  const requiredKeys = Object.keys(dummyLocalFile).filter((key) => !optionalKeys.includes(key));
419
469
  const allKeys = [requiredKeys, optionalKeys].flat();
420
470
  if (value && typeof value === "object" && requiredKeys.every((key) => key in value) && Object.keys(value).every((key) => allKeys.includes(key))) {
@@ -422,68 +472,8 @@ function isLocalFile(value) {
422
472
  }
423
473
  return false;
424
474
  }
425
- var toObject = new class T {
426
- fileToLocalFile(file, options) {
427
- const fileName = (() => {
428
- const fileExt = getFileExt(file.name);
429
- if (options?.filename && options.filename.includes(fileExt))
430
- return options.filename;
431
- else if (options?.filename) return options.filename.trim() + fileExt;
432
- return file.name;
433
- })()?.trim?.();
434
- const { name: _, size: __, ..._metadata } = file;
435
- return {
436
- uid: v4(),
437
- description: options?.description,
438
- path: options?.filepath || file.webkitRelativePath,
439
- typeAlias: options?.typeAlias || run(
440
- Object.keys(LOCAL_FILE_MIME_TYPES).find(
441
- (key) => LOCAL_FILE_MIME_TYPES[key].includes(file.type)
442
- ),
443
- (type) => {
444
- if (!type) {
445
- log("An unknown file type was found ", file.type);
446
- return "unknown";
447
- }
448
- return type;
449
- }
450
- ),
451
- sizeInBytes: file.size,
452
- uploadDate: options?.uploadDate === "now" ? Date.now() : options?.uploadDate ?? file.lastModified,
453
- name: fileName,
454
- _metadata
455
- };
456
- }
457
- localFileToFile(localFile) {
458
- if ("_metadata" in localFile) {
459
- return {
460
- name: localFile.name,
461
- size: localFile.sizeInBytes,
462
- ...localFile._metadata
463
- };
464
- }
465
- return {
466
- name: localFile.name,
467
- size: localFile.sizeInBytes,
468
- webkitRelativePath: localFile.path,
469
- lastModified: localFile.uploadDate
470
- };
471
- }
472
- invoke(...args) {
473
- if (isFile(args[0])) {
474
- return this.fileToLocalFile(
475
- ...args
476
- );
477
- }
478
- if (isLocalFile(args[0])) {
479
- return this.localFileToFile(
480
- ...args
481
- );
482
- } else throw new Error(`The arguments supplied are insufficient.`);
483
- }
484
- }().invoke;
485
475
  function getMimeTypes(typeAliases) {
486
- return distinct(strictArray(typeAliases)).map((alias) => LOCAL_FILE_MIME_TYPES[alias]).flat();
476
+ return distinct(strictArray(typeAliases)).map((alias) => LOCAL_FILE_MIME_TYPES2[alias]).flat();
487
477
  }
488
478
  function classNameResolver(baseClassName) {
489
479
  return (className) => {
@@ -1050,7 +1040,7 @@ export {
1050
1040
  takeWhile,
1051
1041
  timeDuration,
1052
1042
  toNumber,
1053
- toObject,
1043
+ ObjectConverter_default as toObject,
1054
1044
  trimString,
1055
1045
  undefinedIfEmpty,
1056
1046
  upperFirst,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavy/fn",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "main": "./dist/main.js",
5
5
  "module": "./dist/main.cjs",
6
6
  "types": "./dist/main.d.ts",
@@ -22,7 +22,7 @@
22
22
  "description": "",
23
23
  "devDependencies": {
24
24
  "@types/node": "^24.5.2",
25
- "@wavy/types": "^0.0.26",
25
+ "@wavy/types": "^0.0.28",
26
26
  "tsup": "^8.5.0",
27
27
  "typescript": "^5.9.2"
28
28
  }