foxts 5.0.3 → 5.0.4
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/empty-node/index.d.ts +1 -1
- package/dist/empty-node/index.js +1 -1
- package/dist/empty-node/index.mjs +1 -1
- package/dist/extract-error-message/index.js +1 -1
- package/dist/extract-error-message/index.mjs +1 -1
- package/dist/is-probably-ip/index.d.ts +2 -1
- package/dist/is-probably-ip/index.js +1 -1
- package/dist/is-probably-ip/index.mjs +1 -1
- package/dist/noop/index.js +1 -1
- package/dist/noop/index.mjs +1 -1
- package/dist/string-join/index.js +1 -1
- package/dist/string-join/index.mjs +1 -1
- package/dist/tagged/index.js +3 -1
- package/dist/tagged/index.mjs +3 -1
- package/package.json +9 -9
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* if you are trying to empty an Element, use `emptyElement` method instead, it will opt-in more performant method on modern browsers.
|
|
3
3
|
*/
|
|
4
4
|
declare function emptyNode(node: Node): void;
|
|
5
|
-
declare
|
|
5
|
+
declare const emptyElementModern: (element: Element) => void;
|
|
6
6
|
/**
|
|
7
7
|
* Use `Element.replaceChildren` if available, otherwise fall back to removing each child node.
|
|
8
8
|
*/
|
package/dist/empty-node/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){for(;e.firstChild;)e.removeChild(e.lastChild)}
|
|
1
|
+
"use strict";function e(e){for(;e.firstChild;)e.removeChild(e.lastChild)}const t=e=>e.replaceChildren(),r="u">typeof Element&&"replaceChildren"in Element.prototype?t:e;exports.emptyElement=r,exports.emptyElementModern=t,exports.emptyNode=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){for(;e.firstChild;)e.removeChild(e.lastChild)}
|
|
1
|
+
function e(e){for(;e.firstChild;)e.removeChild(e.lastChild)}const t=e=>e.replaceChildren(),l="u">typeof Element&&"replaceChildren"in Element.prototype?t:e;export{l as emptyElement,t as emptyElementModern,e as emptyNode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function
|
|
1
|
+
"use strict";const t="name",e="message",r="stack";function n(n){return"object"==typeof n&&!!n&&t in n&&"string"==typeof n[t]&&e in n&&"string"==typeof n[e]&&(!(r in n)||"string"==typeof n[r])}exports.extractErrorMessage=function(i,s=!0,o=!1){if(!n(i))return null;let c="";return s&&(c+=i[t],c+=": "),c+=i[e],o&&r in i&&"string"==typeof i[r]&&(c+="\n"+i[r]),c.trim()},exports.isErrorLikeObject=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const t="name",e="message",n="stack";function r(r){return"object"==typeof r&&!!r&&t in r&&"string"==typeof r[t]&&e in r&&"string"==typeof r[e]&&(!(n in r)||"string"==typeof r[n])}function i(o,s=!0,f=!1){if(!r(o))return null;let c="";return s&&(c+=o[t],c+=": "),c+=o[e],f&&n in o&&"string"==typeof o[n]&&(c+="\n"+o[n]),c.trim()}export{i as extractErrorMessage,r as isErrorLikeObject};
|
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
declare function isProbablyIpv4(hostname: string): boolean;
|
|
6
6
|
declare function isProbablyIpv6(hostname: string): boolean;
|
|
7
|
+
declare const isProbablyIp: (hostname: string) => boolean;
|
|
7
8
|
|
|
8
|
-
export { isProbablyIpv4, isProbablyIpv6 };
|
|
9
|
+
export { isProbablyIp, isProbablyIpv4, isProbablyIpv6 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";function t(t){const r=t.length;if(r<7||r>15)return!1;let e=0;for(let o=0;o<r;o+=1){const r=t.charCodeAt(o);if(46===r)e+=1;else if(r<48||r>57)return!1}return 3===e&&46!==t.charCodeAt(0)&&46!==t.charCodeAt(r-1)}function r(t){const r=t.length;if(r<3)return!1;let e=+("["===t[0]),o=r;if("]"===t[o-1]&&(o-=1),o-e>39)return!1;let n=!1;for(;e<o;e+=1){const r=t.charCodeAt(e);if(58===r)n=!0;else if((r<48||r>57)&&(r<97||r>102)&&(r<65||r>90))return!1}return n}exports.isProbablyIp=e=>t(e)||r(e),exports.isProbablyIpv4=t,exports.isProbablyIpv6=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function t(t){const r=t.length;if(r<7||r>15)return!1;let e=0;for(let n=0;n<r;n+=1){const r=t.charCodeAt(n);if(46===r)e+=1;else if(r<48||r>57)return!1}return 3===e&&46!==t.charCodeAt(0)&&46!==t.charCodeAt(r-1)}function r(t){const r=t.length;if(r<3)return!1;let e=+("["===t[0]),n=r;if("]"===t[n-1]&&(n-=1),n-e>39)return!1;let o=!1;for(;e<n;e+=1){const r=t.charCodeAt(e);if(58===r)o=!0;else if((r<48||r>57)&&(r<97||r>102)&&(r<65||r>90))return!1}return o}const e=e=>t(e)||r(e);export{e as isProbablyIp,t as isProbablyIpv4,r as isProbablyIpv6};
|
package/dist/noop/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o
|
|
1
|
+
"use strict";const o=/* @__NO_SIDE_EFFECTS__ */()=>{},r=/* #__PURE__ */Promise.resolve(),e=/* #__PURE__ */new Promise(o);exports.asyncNeverFn=/* @__NO_SIDE_EFFECTS__ */()=>e,exports.asyncNoop=/* @__NO_SIDE_EFFECTS__ */()=>r,exports.falseFn=/* @__NO_SIDE_EFFECTS__ */()=>!1,exports.noop=o,exports.throwFn=/* @__NO_SIDE_EFFECTS__ */()=>{throw Error()},exports.trueFn=/* @__NO_SIDE_EFFECTS__ */()=>!0;
|
package/dist/noop/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const o
|
|
1
|
+
const o=/* @__NO_SIDE_EFFECTS__ */()=>{},r=/* @__NO_SIDE_EFFECTS__ */()=>!0,e=/* @__NO_SIDE_EFFECTS__ */()=>!1,n=/* @__NO_SIDE_EFFECTS__ */()=>{throw Error()},s=/* #__PURE__ */Promise.resolve(),t=/* @__NO_SIDE_EFFECTS__ */()=>s,F=/* #__PURE__ */new Promise(o),a=/* @__NO_SIDE_EFFECTS__ */()=>F;export{a as asyncNeverFn,t as asyncNoop,e as falseFn,o as noop,n as throwFn,r as trueFn};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.stringJoin=function(t,
|
|
1
|
+
"use strict";exports.stringJoin=function(t,e=",",r=!1){let n,i=t.length;if(0===i)return"";r&&(i=(t=Array.from(new Set(t))).length);let l="",o=0;for(let r=0;r<i;r++)(n=t[r])&&(o?l+=e:o=1,l+=n);return l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(r
|
|
1
|
+
function t(e,r=",",n=!1){let l,o=e.length;if(0===o)return"";n&&(o=(e=Array.from(new Set(e))).length);let f="",i=0;for(let t=0;t<o;t++)(l=e[t])&&(i?f+=r:i=1,f+=l);return f}export{t as stringJoin};
|
package/dist/tagged/index.js
CHANGED
package/dist/tagged/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foxts",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "Opinionated collection of common TypeScript utils by @SukkaW",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/SukkaW/foxts"
|
|
@@ -314,21 +314,21 @@
|
|
|
314
314
|
"author": "SukkaW <https://skk.moe>",
|
|
315
315
|
"license": "MIT",
|
|
316
316
|
"devDependencies": {
|
|
317
|
-
"@eslint-sukka/node": "^8.0.
|
|
317
|
+
"@eslint-sukka/node": "^8.0.6",
|
|
318
318
|
"@happy-dom/global-registrator": "^20.0.11",
|
|
319
319
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
320
320
|
"@mitata/counters": "^0.0.8",
|
|
321
321
|
"@monyone/aho-corasick": "^1.1.3",
|
|
322
322
|
"@package-json/types": "^0.0.12",
|
|
323
323
|
"@swc-node/register": "^1.11.1",
|
|
324
|
-
"@swc/core": "^1.15.
|
|
324
|
+
"@swc/core": "^1.15.7",
|
|
325
325
|
"@types/mocha": "^10.0.10",
|
|
326
|
-
"@types/node": "^22.19.
|
|
327
|
-
"@types/sinon": "^
|
|
326
|
+
"@types/node": "^22.19.3",
|
|
327
|
+
"@types/sinon": "^21.0.0",
|
|
328
328
|
"bumpp": "^10.3.2",
|
|
329
|
-
"eslint": "^9.39.
|
|
330
|
-
"eslint-config-sukka": "^8.0.
|
|
331
|
-
"eslint-formatter-sukka": "^8.0.
|
|
329
|
+
"eslint": "^9.39.2",
|
|
330
|
+
"eslint-config-sukka": "^8.0.6",
|
|
331
|
+
"eslint-formatter-sukka": "^8.0.6",
|
|
332
332
|
"expect": "^30.2.0",
|
|
333
333
|
"fastscan": "^1.0.6",
|
|
334
334
|
"happy-dom": "^20.0.11",
|
|
@@ -338,7 +338,7 @@
|
|
|
338
338
|
"mocha": "^11.7.5",
|
|
339
339
|
"modern-ahocorasick": "^2.0.4",
|
|
340
340
|
"nyc": "^17.1.0",
|
|
341
|
-
"rollup": "^4.53.
|
|
341
|
+
"rollup": "^4.53.5",
|
|
342
342
|
"rollup-plugin-dts": "^6.3.0",
|
|
343
343
|
"rollup-plugin-oxc-resolve": "^0.0.5",
|
|
344
344
|
"rollup-plugin-swc3": "^0.12.1",
|