@wavy/fn 0.0.23 → 0.0.24
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 +10 -3
- package/dist/main.js +10 -3
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -216,8 +216,13 @@ var NumberFormatter = class _NumberFormatter {
|
|
|
216
216
|
if (range(10, 13).includes(strAmt.length)) return "b";
|
|
217
217
|
if (range(13, 16).includes(strAmt.length)) return "t";
|
|
218
218
|
};
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
let amount2 = parseInt(decimal) > 0 ? `${value}.${decimal}` : value;
|
|
220
|
+
if (amount2.includes("-")) {
|
|
221
|
+
amount2 = "-" + dollarSign + amount2;
|
|
222
|
+
} else {
|
|
223
|
+
amount2 = dollarSign + amount2;
|
|
224
|
+
}
|
|
225
|
+
return amount2 + getTruncatedSuffix();
|
|
221
226
|
};
|
|
222
227
|
if (strAmt.length <= 3) return fmtMoney(strAmt, "0");
|
|
223
228
|
else {
|
|
@@ -227,7 +232,8 @@ var NumberFormatter = class _NumberFormatter {
|
|
|
227
232
|
),
|
|
228
233
|
2
|
|
229
234
|
).reverse();
|
|
230
|
-
|
|
235
|
+
const amount2 = fmtMoney(relevantDigits[0].join(""), relevantDigits[1][0]);
|
|
236
|
+
return amount2;
|
|
231
237
|
}
|
|
232
238
|
}
|
|
233
239
|
return (amount < 0 ? "-" : options?.showSigns ? "+" : "") + dollarSign + amount.toLocaleString("en-US", {
|
|
@@ -608,6 +614,7 @@ function isIterable(value) {
|
|
|
608
614
|
return !!value && typeof value === "object" && Symbol.iterator in value && typeof value[Symbol.iterator] === "function";
|
|
609
615
|
}
|
|
610
616
|
function isPromise(value) {
|
|
617
|
+
if (value instanceof Promise) return true;
|
|
611
618
|
return !!value && (typeof value === "object" || typeof value === "function") && "then" in value && typeof value.then === "function";
|
|
612
619
|
}
|
|
613
620
|
function castArray(value) {
|
package/dist/main.js
CHANGED
|
@@ -114,8 +114,13 @@ var NumberFormatter = class _NumberFormatter {
|
|
|
114
114
|
if (range(10, 13).includes(strAmt.length)) return "b";
|
|
115
115
|
if (range(13, 16).includes(strAmt.length)) return "t";
|
|
116
116
|
};
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
let amount2 = parseInt(decimal) > 0 ? `${value}.${decimal}` : value;
|
|
118
|
+
if (amount2.includes("-")) {
|
|
119
|
+
amount2 = "-" + dollarSign + amount2;
|
|
120
|
+
} else {
|
|
121
|
+
amount2 = dollarSign + amount2;
|
|
122
|
+
}
|
|
123
|
+
return amount2 + getTruncatedSuffix();
|
|
119
124
|
};
|
|
120
125
|
if (strAmt.length <= 3) return fmtMoney(strAmt, "0");
|
|
121
126
|
else {
|
|
@@ -125,7 +130,8 @@ var NumberFormatter = class _NumberFormatter {
|
|
|
125
130
|
),
|
|
126
131
|
2
|
|
127
132
|
).reverse();
|
|
128
|
-
|
|
133
|
+
const amount2 = fmtMoney(relevantDigits[0].join(""), relevantDigits[1][0]);
|
|
134
|
+
return amount2;
|
|
129
135
|
}
|
|
130
136
|
}
|
|
131
137
|
return (amount < 0 ? "-" : options?.showSigns ? "+" : "") + dollarSign + amount.toLocaleString("en-US", {
|
|
@@ -506,6 +512,7 @@ function isIterable(value) {
|
|
|
506
512
|
return !!value && typeof value === "object" && Symbol.iterator in value && typeof value[Symbol.iterator] === "function";
|
|
507
513
|
}
|
|
508
514
|
function isPromise(value) {
|
|
515
|
+
if (value instanceof Promise) return true;
|
|
509
516
|
return !!value && (typeof value === "object" || typeof value === "function") && "then" in value && typeof value.then === "function";
|
|
510
517
|
}
|
|
511
518
|
function castArray(value) {
|