@w3ux/utils 1.1.1-beta.5 → 1.1.1-beta.6

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/base.cjs CHANGED
@@ -29,12 +29,10 @@ __export(base_exports, {
29
29
  maxBigInt: () => maxBigInt,
30
30
  minBigInt: () => minBigInt,
31
31
  minDecimalPlaces: () => minDecimalPlaces,
32
- objectSpread: () => objectSpread,
33
32
  pageFromUri: () => pageFromUri,
34
33
  removeHexPrefix: () => removeHexPrefix,
35
34
  rmCommas: () => rmCommas,
36
35
  shuffle: () => shuffle,
37
- u8aConcat: () => u8aConcat,
38
36
  withTimeout: () => withTimeout
39
37
  });
40
38
  module.exports = __toCommonJS(base_exports);
@@ -158,30 +156,6 @@ var isSuperset = (set, subset) => {
158
156
  };
159
157
  var maxBigInt = (...values) => values.reduce((max, current) => current > max ? current : max);
160
158
  var minBigInt = (...values) => values.reduce((min, current) => current < min ? current : min);
161
- function objectSpread(dest, ...sources) {
162
- sources.forEach((src) => {
163
- if (src) {
164
- if (src && typeof src.entries === "function") {
165
- Object.entries(src).forEach(([key, value]) => {
166
- dest[key] = value;
167
- });
168
- } else {
169
- Object.assign(dest, src);
170
- }
171
- }
172
- });
173
- return dest;
174
- }
175
- var u8aConcat = (...u8as) => {
176
- const totalLength = u8as.reduce((sum, u8a) => sum + u8a.length, 0);
177
- const result = new Uint8Array(totalLength);
178
- let offset = 0;
179
- for (const u8a of u8as) {
180
- result.set(u8a, offset);
181
- offset += u8a.length;
182
- }
183
- return result;
184
- };
185
159
  // Annotate the CommonJS export names for ESM import in node:
186
160
  0 && (module.exports = {
187
161
  appendOr,
@@ -194,12 +168,10 @@ var u8aConcat = (...u8as) => {
194
168
  maxBigInt,
195
169
  minBigInt,
196
170
  minDecimalPlaces,
197
- objectSpread,
198
171
  pageFromUri,
199
172
  removeHexPrefix,
200
173
  rmCommas,
201
174
  shuffle,
202
- u8aConcat,
203
175
  withTimeout
204
176
  });
205
177
  /* @license Copyright 2024 w3ux authors & contributors
package/base.d.cts CHANGED
@@ -100,20 +100,5 @@ declare const maxBigInt: (...values: bigint[]) => bigint;
100
100
  * minBigInt(10n, 50n, 30n, 100n, 20n); // 10n
101
101
  */
102
102
  declare const minBigInt: (...values: bigint[]) => bigint;
103
- /**
104
- * @name objectSpread
105
- * @summary Merges all source objects into the destination object.
106
- * @param {T} dest - The destination object to be populated.
107
- * @param {...Partial<T>} sources - The source objects to merge into the destination.
108
- * @returns {T} The updated destination object.
109
- */
110
- declare function objectSpread<T extends object>(dest: object, ...sources: (object | undefined | null)[]): T;
111
- /**
112
- * Concatenates multiple Uint8Array instances into a single Uint8Array.
113
- *
114
- * @param {Uint8Array[]} u8as - An array of Uint8Array instances to concatenate.
115
- * @returns {Uint8Array} A new Uint8Array containing all the input arrays concatenated.
116
- */
117
- declare const u8aConcat: (...u8as: Uint8Array[]) => Uint8Array;
118
103
 
119
- export { appendOr, appendOrEmpty, camelize, ellipsisFn, eqSet, formatAccountSs58, isSuperset, maxBigInt, minBigInt, minDecimalPlaces, objectSpread, pageFromUri, removeHexPrefix, rmCommas, shuffle, u8aConcat, withTimeout };
104
+ export { appendOr, appendOrEmpty, camelize, ellipsisFn, eqSet, formatAccountSs58, isSuperset, maxBigInt, minBigInt, minDecimalPlaces, pageFromUri, removeHexPrefix, rmCommas, shuffle, withTimeout };
package/base.d.ts CHANGED
@@ -100,20 +100,5 @@ declare const maxBigInt: (...values: bigint[]) => bigint;
100
100
  * minBigInt(10n, 50n, 30n, 100n, 20n); // 10n
101
101
  */
102
102
  declare const minBigInt: (...values: bigint[]) => bigint;
103
- /**
104
- * @name objectSpread
105
- * @summary Merges all source objects into the destination object.
106
- * @param {T} dest - The destination object to be populated.
107
- * @param {...Partial<T>} sources - The source objects to merge into the destination.
108
- * @returns {T} The updated destination object.
109
- */
110
- declare function objectSpread<T extends object>(dest: object, ...sources: (object | undefined | null)[]): T;
111
- /**
112
- * Concatenates multiple Uint8Array instances into a single Uint8Array.
113
- *
114
- * @param {Uint8Array[]} u8as - An array of Uint8Array instances to concatenate.
115
- * @returns {Uint8Array} A new Uint8Array containing all the input arrays concatenated.
116
- */
117
- declare const u8aConcat: (...u8as: Uint8Array[]) => Uint8Array;
118
103
 
119
- export { appendOr, appendOrEmpty, camelize, ellipsisFn, eqSet, formatAccountSs58, isSuperset, maxBigInt, minBigInt, minDecimalPlaces, objectSpread, pageFromUri, removeHexPrefix, rmCommas, shuffle, u8aConcat, withTimeout };
104
+ export { appendOr, appendOrEmpty, camelize, ellipsisFn, eqSet, formatAccountSs58, isSuperset, maxBigInt, minBigInt, minDecimalPlaces, pageFromUri, removeHexPrefix, rmCommas, shuffle, withTimeout };
package/base.js CHANGED
@@ -119,30 +119,6 @@ var isSuperset = (set, subset) => {
119
119
  };
120
120
  var maxBigInt = (...values) => values.reduce((max, current) => current > max ? current : max);
121
121
  var minBigInt = (...values) => values.reduce((min, current) => current < min ? current : min);
122
- function objectSpread(dest, ...sources) {
123
- sources.forEach((src) => {
124
- if (src) {
125
- if (src && typeof src.entries === "function") {
126
- Object.entries(src).forEach(([key, value]) => {
127
- dest[key] = value;
128
- });
129
- } else {
130
- Object.assign(dest, src);
131
- }
132
- }
133
- });
134
- return dest;
135
- }
136
- var u8aConcat = (...u8as) => {
137
- const totalLength = u8as.reduce((sum, u8a) => sum + u8a.length, 0);
138
- const result = new Uint8Array(totalLength);
139
- let offset = 0;
140
- for (const u8a of u8as) {
141
- result.set(u8a, offset);
142
- offset += u8a.length;
143
- }
144
- return result;
145
- };
146
122
  export {
147
123
  appendOr,
148
124
  appendOrEmpty,
@@ -154,12 +130,10 @@ export {
154
130
  maxBigInt,
155
131
  minBigInt,
156
132
  minDecimalPlaces,
157
- objectSpread,
158
133
  pageFromUri,
159
134
  removeHexPrefix,
160
135
  rmCommas,
161
136
  shuffle,
162
- u8aConcat,
163
137
  withTimeout
164
138
  };
165
139
  /* @license Copyright 2024 w3ux authors & contributors
@@ -16,13 +16,14 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // src/conversions.ts
20
- var conversions_exports = {};
21
- __export(conversions_exports, {
19
+ // src/convert.ts
20
+ var convert_exports = {};
21
+ __export(convert_exports, {
22
22
  stringToU8a: () => stringToU8a,
23
+ u8aConcat: () => u8aConcat,
23
24
  u8aToString: () => u8aToString
24
25
  });
25
- module.exports = __toCommonJS(conversions_exports);
26
+ module.exports = __toCommonJS(convert_exports);
26
27
  var stringToU8a = (input) => {
27
28
  const u8a = new Uint8Array(input.length);
28
29
  for (let i = 0; i < input.length; i++) {
@@ -37,9 +38,20 @@ var u8aToString = (u8a) => {
37
38
  }
38
39
  return chars.join("");
39
40
  };
41
+ var u8aConcat = (...u8as) => {
42
+ const totalLength = u8as.reduce((sum, u8a) => sum + u8a.length, 0);
43
+ const result = new Uint8Array(totalLength);
44
+ let offset = 0;
45
+ for (const u8a of u8as) {
46
+ result.set(u8a, offset);
47
+ offset += u8a.length;
48
+ }
49
+ return result;
50
+ };
40
51
  // Annotate the CommonJS export names for ESM import in node:
41
52
  0 && (module.exports = {
42
53
  stringToU8a,
54
+ u8aConcat,
43
55
  u8aToString
44
56
  });
45
57
  /* @license Copyright 2024 w3ux authors & contributors
@@ -14,5 +14,12 @@ declare const stringToU8a: (input: string) => Uint8Array;
14
14
  * @returns {string} The resulting string.
15
15
  */
16
16
  declare const u8aToString: (u8a: Uint8Array) => string;
17
+ /**
18
+ * Concatenates multiple Uint8Array instances into a single Uint8Array.
19
+ *
20
+ * @param {Uint8Array[]} u8as - An array of Uint8Array instances to concatenate.
21
+ * @returns {Uint8Array} A new Uint8Array containing all the input arrays concatenated.
22
+ */
23
+ declare const u8aConcat: (...u8as: Uint8Array[]) => Uint8Array;
17
24
 
18
- export { stringToU8a, u8aToString };
25
+ export { stringToU8a, u8aConcat, u8aToString };
@@ -14,5 +14,12 @@ declare const stringToU8a: (input: string) => Uint8Array;
14
14
  * @returns {string} The resulting string.
15
15
  */
16
16
  declare const u8aToString: (u8a: Uint8Array) => string;
17
+ /**
18
+ * Concatenates multiple Uint8Array instances into a single Uint8Array.
19
+ *
20
+ * @param {Uint8Array[]} u8as - An array of Uint8Array instances to concatenate.
21
+ * @returns {Uint8Array} A new Uint8Array containing all the input arrays concatenated.
22
+ */
23
+ declare const u8aConcat: (...u8as: Uint8Array[]) => Uint8Array;
17
24
 
18
- export { stringToU8a, u8aToString };
25
+ export { stringToU8a, u8aConcat, u8aToString };
@@ -1,4 +1,4 @@
1
- // src/conversions.ts
1
+ // src/convert.ts
2
2
  var stringToU8a = (input) => {
3
3
  const u8a = new Uint8Array(input.length);
4
4
  for (let i = 0; i < input.length; i++) {
@@ -13,8 +13,19 @@ var u8aToString = (u8a) => {
13
13
  }
14
14
  return chars.join("");
15
15
  };
16
+ var u8aConcat = (...u8as) => {
17
+ const totalLength = u8as.reduce((sum, u8a) => sum + u8a.length, 0);
18
+ const result = new Uint8Array(totalLength);
19
+ let offset = 0;
20
+ for (const u8a of u8as) {
21
+ result.set(u8a, offset);
22
+ offset += u8a.length;
23
+ }
24
+ return result;
25
+ };
16
26
  export {
17
27
  stringToU8a,
28
+ u8aConcat,
18
29
  u8aToString
19
30
  };
20
31
  /* @license Copyright 2024 w3ux authors & contributors
package/index.cjs CHANGED
@@ -51,7 +51,6 @@ __export(src_exports, {
51
51
  mergeDeep: () => mergeDeep,
52
52
  minBigInt: () => minBigInt,
53
53
  minDecimalPlaces: () => minDecimalPlaces,
54
- objectSpread: () => objectSpread,
55
54
  pageFromUri: () => pageFromUri,
56
55
  planckToUnit: () => planckToUnit,
57
56
  remToUnit: () => remToUnit,
@@ -195,32 +194,8 @@ var isSuperset = (set, subset) => {
195
194
  };
196
195
  var maxBigInt = (...values) => values.reduce((max, current) => current > max ? current : max);
197
196
  var minBigInt = (...values) => values.reduce((min, current) => current < min ? current : min);
198
- function objectSpread(dest, ...sources) {
199
- sources.forEach((src) => {
200
- if (src) {
201
- if (src && typeof src.entries === "function") {
202
- Object.entries(src).forEach(([key, value]) => {
203
- dest[key] = value;
204
- });
205
- } else {
206
- Object.assign(dest, src);
207
- }
208
- }
209
- });
210
- return dest;
211
- }
212
- var u8aConcat = (...u8as) => {
213
- const totalLength = u8as.reduce((sum, u8a) => sum + u8a.length, 0);
214
- const result = new Uint8Array(totalLength);
215
- let offset = 0;
216
- for (const u8a of u8as) {
217
- result.set(u8a, offset);
218
- offset += u8a.length;
219
- }
220
- return result;
221
- };
222
197
 
223
- // src/conversions.ts
198
+ // src/convert.ts
224
199
  var stringToU8a = (input) => {
225
200
  const u8a = new Uint8Array(input.length);
226
201
  for (let i = 0; i < input.length; i++) {
@@ -235,6 +210,16 @@ var u8aToString = (u8a) => {
235
210
  }
236
211
  return chars.join("");
237
212
  };
213
+ var u8aConcat = (...u8as) => {
214
+ const totalLength = u8as.reduce((sum, u8a) => sum + u8a.length, 0);
215
+ const result = new Uint8Array(totalLength);
216
+ let offset = 0;
217
+ for (const u8a of u8as) {
218
+ result.set(u8a, offset);
219
+ offset += u8a.length;
220
+ }
221
+ return result;
222
+ };
238
223
 
239
224
  // ../../node_modules/@polkadot/x-textdecoder/node.js
240
225
  var import_node_util = __toESM(require("util"), 1);
@@ -616,7 +601,6 @@ var mergeDeep = (target, ...sources) => {
616
601
  mergeDeep,
617
602
  minBigInt,
618
603
  minDecimalPlaces,
619
- objectSpread,
620
604
  pageFromUri,
621
605
  planckToUnit,
622
606
  remToUnit,
package/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- export { appendOr, appendOrEmpty, camelize, ellipsisFn, eqSet, formatAccountSs58, isSuperset, maxBigInt, minBigInt, minDecimalPlaces, objectSpread, pageFromUri, removeHexPrefix, rmCommas, shuffle, u8aConcat, withTimeout } from './base.cjs';
2
- export { stringToU8a, u8aToString } from './conversions.cjs';
1
+ export { appendOr, appendOrEmpty, camelize, ellipsisFn, eqSet, formatAccountSs58, isSuperset, maxBigInt, minBigInt, minDecimalPlaces, pageFromUri, removeHexPrefix, rmCommas, shuffle, withTimeout } from './base.cjs';
2
+ export { stringToU8a, u8aConcat, u8aToString } from './convert.cjs';
3
3
  export { addedTo, applyWidthAsPadding, capitalizeFirstLetter, determinePoolDisplay, extractUrlValue, inChrome, isValidAddress, isValidHttpUrl, localStorageOrDefault, makeCancelable, matchedProperties, mergeDeep, planckToUnit, remToUnit, removeVarFromUrlHash, removedFrom, setStateWithRef, snakeToCamel, sortWithNull, unescape, unimplemented, unitToPlanck, varToUrlHash } from './unit.cjs';
4
4
  import '@w3ux/types';
5
5
  import 'react';
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { appendOr, appendOrEmpty, camelize, ellipsisFn, eqSet, formatAccountSs58, isSuperset, maxBigInt, minBigInt, minDecimalPlaces, objectSpread, pageFromUri, removeHexPrefix, rmCommas, shuffle, u8aConcat, withTimeout } from './base.js';
2
- export { stringToU8a, u8aToString } from './conversions.js';
1
+ export { appendOr, appendOrEmpty, camelize, ellipsisFn, eqSet, formatAccountSs58, isSuperset, maxBigInt, minBigInt, minDecimalPlaces, pageFromUri, removeHexPrefix, rmCommas, shuffle, withTimeout } from './base.js';
2
+ export { stringToU8a, u8aConcat, u8aToString } from './convert.js';
3
3
  export { addedTo, applyWidthAsPadding, capitalizeFirstLetter, determinePoolDisplay, extractUrlValue, inChrome, isValidAddress, isValidHttpUrl, localStorageOrDefault, makeCancelable, matchedProperties, mergeDeep, planckToUnit, remToUnit, removeVarFromUrlHash, removedFrom, setStateWithRef, snakeToCamel, sortWithNull, unescape, unimplemented, unitToPlanck, varToUrlHash } from './unit.js';
4
4
  import '@w3ux/types';
5
5
  import 'react';
package/index.js CHANGED
@@ -119,32 +119,8 @@ var isSuperset = (set, subset) => {
119
119
  };
120
120
  var maxBigInt = (...values) => values.reduce((max, current) => current > max ? current : max);
121
121
  var minBigInt = (...values) => values.reduce((min, current) => current < min ? current : min);
122
- function objectSpread(dest, ...sources) {
123
- sources.forEach((src) => {
124
- if (src) {
125
- if (src && typeof src.entries === "function") {
126
- Object.entries(src).forEach(([key, value]) => {
127
- dest[key] = value;
128
- });
129
- } else {
130
- Object.assign(dest, src);
131
- }
132
- }
133
- });
134
- return dest;
135
- }
136
- var u8aConcat = (...u8as) => {
137
- const totalLength = u8as.reduce((sum, u8a) => sum + u8a.length, 0);
138
- const result = new Uint8Array(totalLength);
139
- let offset = 0;
140
- for (const u8a of u8as) {
141
- result.set(u8a, offset);
142
- offset += u8a.length;
143
- }
144
- return result;
145
- };
146
122
 
147
- // src/conversions.ts
123
+ // src/convert.ts
148
124
  var stringToU8a = (input) => {
149
125
  const u8a = new Uint8Array(input.length);
150
126
  for (let i = 0; i < input.length; i++) {
@@ -159,6 +135,16 @@ var u8aToString = (u8a) => {
159
135
  }
160
136
  return chars.join("");
161
137
  };
138
+ var u8aConcat = (...u8as) => {
139
+ const totalLength = u8as.reduce((sum, u8a) => sum + u8a.length, 0);
140
+ const result = new Uint8Array(totalLength);
141
+ let offset = 0;
142
+ for (const u8a of u8as) {
143
+ result.set(u8a, offset);
144
+ offset += u8a.length;
145
+ }
146
+ return result;
147
+ };
162
148
 
163
149
  // ../../node_modules/@polkadot/x-textdecoder/node.js
164
150
  import util from "node:util";
@@ -539,7 +525,6 @@ export {
539
525
  mergeDeep,
540
526
  minBigInt,
541
527
  minDecimalPlaces,
542
- objectSpread,
543
528
  pageFromUri,
544
529
  planckToUnit,
545
530
  remToUnit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w3ux/utils",
3
- "version": "1.1.1-beta.5",
3
+ "version": "1.1.1-beta.6",
4
4
  "license": "GPL-3.0-only",
5
5
  "dependencies": {
6
6
  "@polkadot-api/substrate-bindings": "^0.9.3"