@wavy/fn 0.0.18 → 0.0.19
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 +7 -10
- package/dist/main.js +7 -10
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -57,7 +57,7 @@ __export(main_exports, {
|
|
|
57
57
|
isLetter: () => isLetter,
|
|
58
58
|
isLocalFile: () => isLocalFile,
|
|
59
59
|
isNumber: () => isNumber,
|
|
60
|
-
lastIndex: () =>
|
|
60
|
+
lastIndex: () => lastIndex2,
|
|
61
61
|
map: () => map,
|
|
62
62
|
mapToArray: () => mapToArray,
|
|
63
63
|
maxOf: () => maxOf,
|
|
@@ -238,13 +238,12 @@ var NumberFormatter_default = NumberFormatter;
|
|
|
238
238
|
var ObjectFormatter = class {
|
|
239
239
|
static toString = {
|
|
240
240
|
name: (name) => name ? `${name.first} ${name.last}`.trim() : "no_name",
|
|
241
|
-
address: (address, inline) => {
|
|
241
|
+
address: (address, inline = true) => {
|
|
242
242
|
if (address === void 0) return "no_address";
|
|
243
243
|
const addressKeys = Object.keys(address).map((k) => k);
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
).join("") || "no_address";
|
|
244
|
+
return strictArray(addressKeys.map((key) => address[key])).join(
|
|
245
|
+
"," + inline ? "" : "\n"
|
|
246
|
+
) || "no_address";
|
|
248
247
|
}
|
|
249
248
|
};
|
|
250
249
|
};
|
|
@@ -614,7 +613,7 @@ function classNameExt(rootClassName) {
|
|
|
614
613
|
function range(start, end) {
|
|
615
614
|
return buildArray(end - start, (i) => i + start);
|
|
616
615
|
}
|
|
617
|
-
function
|
|
616
|
+
function lastIndex2(value) {
|
|
618
617
|
return value.length - 1;
|
|
619
618
|
}
|
|
620
619
|
function buildArray(length, func) {
|
|
@@ -625,7 +624,7 @@ function blankSpaces(count2) {
|
|
|
625
624
|
}
|
|
626
625
|
function ordinalIndicator(amount) {
|
|
627
626
|
const stringifiedAmount = `${amount}`;
|
|
628
|
-
const lastIdx =
|
|
627
|
+
const lastIdx = lastIndex2(stringifiedAmount);
|
|
629
628
|
const lastChar = stringifiedAmount[lastIdx];
|
|
630
629
|
const secondToLastChar = stringifiedAmount[lastIdx - 1];
|
|
631
630
|
let indicator;
|
|
@@ -874,7 +873,6 @@ async function copyToClipboard(text) {
|
|
|
874
873
|
await navigator.clipboard.writeText(text);
|
|
875
874
|
return { response: "success" };
|
|
876
875
|
} catch (err) {
|
|
877
|
-
console.error("Failed to copy text: ", err);
|
|
878
876
|
if (err instanceof Error) {
|
|
879
877
|
return {
|
|
880
878
|
error: {
|
|
@@ -898,7 +896,6 @@ async function readClipboardText() {
|
|
|
898
896
|
const text = await navigator.clipboard.readText();
|
|
899
897
|
return { response: { text: text.trim() } };
|
|
900
898
|
} catch (err) {
|
|
901
|
-
console.error("Failed to read clipboard contents: ", err);
|
|
902
899
|
return {
|
|
903
900
|
error: {
|
|
904
901
|
errorCode: "UNKNOWN",
|
package/dist/main.js
CHANGED
|
@@ -143,13 +143,12 @@ var NumberFormatter_default = NumberFormatter;
|
|
|
143
143
|
var ObjectFormatter = class {
|
|
144
144
|
static toString = {
|
|
145
145
|
name: (name) => name ? `${name.first} ${name.last}`.trim() : "no_name",
|
|
146
|
-
address: (address, inline) => {
|
|
146
|
+
address: (address, inline = true) => {
|
|
147
147
|
if (address === void 0) return "no_address";
|
|
148
148
|
const addressKeys = Object.keys(address).map((k) => k);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
).join("") || "no_address";
|
|
149
|
+
return strictArray(addressKeys.map((key) => address[key])).join(
|
|
150
|
+
"," + inline ? "" : "\n"
|
|
151
|
+
) || "no_address";
|
|
153
152
|
}
|
|
154
153
|
};
|
|
155
154
|
};
|
|
@@ -519,7 +518,7 @@ function classNameExt(rootClassName) {
|
|
|
519
518
|
function range(start, end) {
|
|
520
519
|
return buildArray(end - start, (i) => i + start);
|
|
521
520
|
}
|
|
522
|
-
function
|
|
521
|
+
function lastIndex2(value) {
|
|
523
522
|
return value.length - 1;
|
|
524
523
|
}
|
|
525
524
|
function buildArray(length, func) {
|
|
@@ -530,7 +529,7 @@ function blankSpaces(count2) {
|
|
|
530
529
|
}
|
|
531
530
|
function ordinalIndicator(amount) {
|
|
532
531
|
const stringifiedAmount = `${amount}`;
|
|
533
|
-
const lastIdx =
|
|
532
|
+
const lastIdx = lastIndex2(stringifiedAmount);
|
|
534
533
|
const lastChar = stringifiedAmount[lastIdx];
|
|
535
534
|
const secondToLastChar = stringifiedAmount[lastIdx - 1];
|
|
536
535
|
let indicator;
|
|
@@ -779,7 +778,6 @@ async function copyToClipboard(text) {
|
|
|
779
778
|
await navigator.clipboard.writeText(text);
|
|
780
779
|
return { response: "success" };
|
|
781
780
|
} catch (err) {
|
|
782
|
-
console.error("Failed to copy text: ", err);
|
|
783
781
|
if (err instanceof Error) {
|
|
784
782
|
return {
|
|
785
783
|
error: {
|
|
@@ -803,7 +801,6 @@ async function readClipboardText() {
|
|
|
803
801
|
const text = await navigator.clipboard.readText();
|
|
804
802
|
return { response: { text: text.trim() } };
|
|
805
803
|
} catch (err) {
|
|
806
|
-
console.error("Failed to read clipboard contents: ", err);
|
|
807
804
|
return {
|
|
808
805
|
error: {
|
|
809
806
|
errorCode: "UNKNOWN",
|
|
@@ -1031,7 +1028,7 @@ export {
|
|
|
1031
1028
|
isLetter,
|
|
1032
1029
|
isLocalFile,
|
|
1033
1030
|
isNumber,
|
|
1034
|
-
lastIndex,
|
|
1031
|
+
lastIndex2 as lastIndex,
|
|
1035
1032
|
map,
|
|
1036
1033
|
mapToArray,
|
|
1037
1034
|
maxOf,
|