@ocap/util 1.28.4 → 1.28.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/esm/index.mjs +1 -1
- package/esm/url.d.mts +1 -1
- package/esm/url.mjs +1 -1
- package/lib/index.cjs +2 -2
- package/lib/url.cjs +2 -2
- package/lib/url.d.cts +1 -1
- package/package.json +2 -2
package/esm/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import rightPad from "lodash/padEnd.js";
|
|
|
11
11
|
import leftPad from "lodash/padStart.js";
|
|
12
12
|
import base58 from "bs58";
|
|
13
13
|
import base64 from "base64-url";
|
|
14
|
-
import
|
|
14
|
+
import utf8 from "utf8";
|
|
15
15
|
|
|
16
16
|
//#region src/index.ts
|
|
17
17
|
const DID_PREFIX = "did:abt:";
|
package/esm/url.d.mts
CHANGED
package/esm/url.mjs
CHANGED
package/lib/index.cjs
CHANGED
|
@@ -158,7 +158,7 @@ const toBN = (num, base = 10) => {
|
|
|
158
158
|
* @returns {String} hex representation of input string
|
|
159
159
|
*/
|
|
160
160
|
const utf8ToHex = (str) => {
|
|
161
|
-
str = utf8.encode(str);
|
|
161
|
+
str = utf8.default.encode(str);
|
|
162
162
|
let hex = "";
|
|
163
163
|
str = str.replace(/^(?:\u0000)*/, "");
|
|
164
164
|
str = str.split("").reverse().join("");
|
|
@@ -193,7 +193,7 @@ const hexToUtf8 = (hex) => {
|
|
|
193
193
|
code = parseInt(hex.substr(i, 2), 16);
|
|
194
194
|
str += String.fromCharCode(code);
|
|
195
195
|
}
|
|
196
|
-
return utf8.decode(str);
|
|
196
|
+
return utf8.default.decode(str);
|
|
197
197
|
};
|
|
198
198
|
/**
|
|
199
199
|
* Converts value to number representation
|
package/lib/url.cjs
CHANGED
|
@@ -7,9 +7,9 @@ let dns_promises = require("dns/promises");
|
|
|
7
7
|
//#region src/url.ts
|
|
8
8
|
const MAX_URL_LENGTH = 256;
|
|
9
9
|
function parseIp(host) {
|
|
10
|
-
if (!ipaddr_js.isValid(host)) return null;
|
|
10
|
+
if (!ipaddr_js.default.isValid(host)) return null;
|
|
11
11
|
try {
|
|
12
|
-
return ipaddr_js.parse(host);
|
|
12
|
+
return ipaddr_js.default.parse(host);
|
|
13
13
|
} catch {
|
|
14
14
|
return null;
|
|
15
15
|
}
|
package/lib/url.d.cts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocap/util",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "utils shared across multiple forge js libs, works in both node.js and browser",
|
|
6
6
|
"keywords": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"ipaddr.js": "^2.1.0",
|
|
20
20
|
"lodash": "^4.17.21",
|
|
21
21
|
"utf8": "^3.0.0",
|
|
22
|
-
"@ocap/types": "^1.28.
|
|
22
|
+
"@ocap/types": "^1.28.6"
|
|
23
23
|
},
|
|
24
24
|
"resolutions": {
|
|
25
25
|
"elliptic": "6.5.3"
|