@wavy/fn 0.0.28 → 0.0.29
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 +3 -3
- package/dist/main.d.cts +6 -1
- package/dist/main.d.ts +6 -1
- package/dist/main.js +3 -3
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -627,9 +627,9 @@ function parseName(value) {
|
|
|
627
627
|
const { first = "", last = "" } = value || {};
|
|
628
628
|
return first.trim() + " " + last.trim();
|
|
629
629
|
}
|
|
630
|
-
function parseMoney(value) {
|
|
631
|
-
if (typeof value === "string") return StringFormatter_default.toMoney(value);
|
|
632
|
-
return NumberFormatter_default.toMoney(value);
|
|
630
|
+
function parseMoney(value, options) {
|
|
631
|
+
if (typeof value === "string") return StringFormatter_default.toMoney(value, options);
|
|
632
|
+
return NumberFormatter_default.toMoney(value, options);
|
|
633
633
|
}
|
|
634
634
|
function parseAddress(address, ...args) {
|
|
635
635
|
if (typeof address === "string") {
|
package/dist/main.d.cts
CHANGED
|
@@ -38,6 +38,11 @@ type NumberFormatterTypes = {
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
+
declare class NumberFormatter {
|
|
42
|
+
static format(value: number, format?: NumberFormatterTypes["formats"], options?: NumberFormatterTypes["options"]["money"]): string;
|
|
43
|
+
static toMoney(amount: number | undefined, options?: NumberFormatterTypes["options"]["money"]): string;
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
declare class StringFormatter {
|
|
42
47
|
static vowels: string;
|
|
43
48
|
static caseConverter: {
|
|
@@ -84,7 +89,7 @@ declare function isIterable<T>(value: unknown): value is Iterable<T>;
|
|
|
84
89
|
declare function isPromise<T>(value: unknown): value is Promise<T>;
|
|
85
90
|
declare const parseDate: (time: number | Date | "now", format?: DateFormat) => string;
|
|
86
91
|
declare function parseName<Value extends string | Name>(value: Value): Value extends string ? Name : Value extends Name ? string : never;
|
|
87
|
-
declare function parseMoney(value: string | number): string;
|
|
92
|
+
declare function parseMoney(value: string | number, options?: Parameters<typeof NumberFormatter.toMoney>[1]): string;
|
|
88
93
|
declare function parseAddress<T extends Address | string>(address: T, ...args: T extends string ? [
|
|
89
94
|
options?: Partial<{
|
|
90
95
|
/**The value used to separate each field in the string
|
package/dist/main.d.ts
CHANGED
|
@@ -38,6 +38,11 @@ type NumberFormatterTypes = {
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
+
declare class NumberFormatter {
|
|
42
|
+
static format(value: number, format?: NumberFormatterTypes["formats"], options?: NumberFormatterTypes["options"]["money"]): string;
|
|
43
|
+
static toMoney(amount: number | undefined, options?: NumberFormatterTypes["options"]["money"]): string;
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
declare class StringFormatter {
|
|
42
47
|
static vowels: string;
|
|
43
48
|
static caseConverter: {
|
|
@@ -84,7 +89,7 @@ declare function isIterable<T>(value: unknown): value is Iterable<T>;
|
|
|
84
89
|
declare function isPromise<T>(value: unknown): value is Promise<T>;
|
|
85
90
|
declare const parseDate: (time: number | Date | "now", format?: DateFormat) => string;
|
|
86
91
|
declare function parseName<Value extends string | Name>(value: Value): Value extends string ? Name : Value extends Name ? string : never;
|
|
87
|
-
declare function parseMoney(value: string | number): string;
|
|
92
|
+
declare function parseMoney(value: string | number, options?: Parameters<typeof NumberFormatter.toMoney>[1]): string;
|
|
88
93
|
declare function parseAddress<T extends Address | string>(address: T, ...args: T extends string ? [
|
|
89
94
|
options?: Partial<{
|
|
90
95
|
/**The value used to separate each field in the string
|
package/dist/main.js
CHANGED
|
@@ -522,9 +522,9 @@ function parseName(value) {
|
|
|
522
522
|
const { first = "", last = "" } = value || {};
|
|
523
523
|
return first.trim() + " " + last.trim();
|
|
524
524
|
}
|
|
525
|
-
function parseMoney(value) {
|
|
526
|
-
if (typeof value === "string") return StringFormatter_default.toMoney(value);
|
|
527
|
-
return NumberFormatter_default.toMoney(value);
|
|
525
|
+
function parseMoney(value, options) {
|
|
526
|
+
if (typeof value === "string") return StringFormatter_default.toMoney(value, options);
|
|
527
|
+
return NumberFormatter_default.toMoney(value, options);
|
|
528
528
|
}
|
|
529
529
|
function parseAddress(address, ...args) {
|
|
530
530
|
if (typeof address === "string") {
|