@w3ux/utils 0.1.1 → 0.1.2

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.d.ts CHANGED
@@ -67,5 +67,11 @@ declare const appendOr: (condition: boolean | string | undefined, value: string,
67
67
  * @summary Formats an address with the supplied ss58 prefix, or returns null if invalid.
68
68
  */
69
69
  declare const formatAccountSs58: (address: string, ss58: number) => string;
70
+ /**
71
+ * @name remvoeHexPrefix
72
+ * @summary Takes a string str as input and returns a new string with the "0x" prefix removed if it
73
+ * exists at the beginning of the input string.
74
+ */
75
+ declare const removeHexPrefix: (str: string) => string;
70
76
 
71
- export { appendOr, appendOrEmpty, camelize, ellipsisFn, formatAccountSs58, greaterThanZero, isNotZero, minDecimalPlaces, pageFromUri, rmCommas, shuffle, withTimeout };
77
+ export { appendOr, appendOrEmpty, camelize, ellipsisFn, formatAccountSs58, greaterThanZero, isNotZero, minDecimalPlaces, pageFromUri, removeHexPrefix, rmCommas, shuffle, withTimeout };
package/base.js CHANGED
@@ -110,6 +110,7 @@ var formatAccountSs58 = (address, ss58) => {
110
110
  return null;
111
111
  }
112
112
  };
113
+ var removeHexPrefix = (str) => str.replace(/^0x/, "");
113
114
  export {
114
115
  appendOr,
115
116
  appendOrEmpty,
@@ -120,6 +121,7 @@ export {
120
121
  isNotZero,
121
122
  minDecimalPlaces,
122
123
  pageFromUri,
124
+ removeHexPrefix,
123
125
  rmCommas,
124
126
  shuffle,
125
127
  withTimeout
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { appendOr, appendOrEmpty, camelize, ellipsisFn, formatAccountSs58, greaterThanZero, isNotZero, minDecimalPlaces, pageFromUri, rmCommas, shuffle, withTimeout } from './base.js';
1
+ export { appendOr, appendOrEmpty, camelize, ellipsisFn, formatAccountSs58, greaterThanZero, isNotZero, minDecimalPlaces, pageFromUri, removeHexPrefix, rmCommas, shuffle, withTimeout } from './base.js';
2
2
  export { addedTo, applyWidthAsPadding, capitalizeFirstLetter, determinePoolDisplay, evalUnits, extractUrlValue, inChrome, isValidAddress, isValidHttpUrl, localStorageOrDefault, makeCancelable, matchedProperties, mergeDeep, planckToUnit, remToUnit, removeVarFromUrlHash, removedFrom, setStateWithRef, snakeToCamel, sortWithNull, stringToBigNumber, transformToBaseUnit, unescape, unimplemented, unitToPlanck, varToUrlHash } from './unit.js';
3
3
  import 'bignumber.js';
4
4
  import './types.js';
package/index.js CHANGED
@@ -110,6 +110,7 @@ var formatAccountSs58 = (address, ss58) => {
110
110
  return null;
111
111
  }
112
112
  };
113
+ var removeHexPrefix = (str) => str.replace(/^0x/, "");
113
114
 
114
115
  // src/unit.ts
115
116
  import { decodeAddress, encodeAddress } from "@polkadot/keyring";
@@ -398,6 +399,7 @@ export {
398
399
  pageFromUri,
399
400
  planckToUnit,
400
401
  remToUnit,
402
+ removeHexPrefix,
401
403
  removeVarFromUrlHash,
402
404
  removedFrom,
403
405
  rmCommas,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w3ux/utils",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "license": "GPL-3.0-only",
5
5
  "type": "module",
6
6
  "dependencies": {