@wavy/fn 0.0.18 → 0.0.20

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
@@ -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
- const delimiter = (isLast) => !isLast ? "," + (!inline ? "\n" : "") : "";
245
- return addressKeys.map(
246
- (key, idx) => address[key] + delimiter(idx === lastIndex(addressKeys))
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
  };
@@ -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
- const delimiter = (isLast) => !isLast ? "," + (!inline ? "\n" : "") : "";
150
- return addressKeys.map(
151
- (key, idx) => address[key] + delimiter(idx === lastIndex(addressKeys))
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
  };
@@ -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",
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@wavy/fn",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "main": "./dist/main.js",
5
5
  "module": "./dist/main.cjs",
6
6
  "types": "./dist/main.d.ts",
7
7
  "scripts": {
8
+ "dev": "npm run build && npm link",
8
9
  "build": "tsup && node prepend",
9
10
  "success": "echo ✨ Successfully published package! ✨",
10
11
  "publisher": "npm run build && npm version patch && npm publish && npm run success"