@gjsify/util 0.4.44 → 0.5.0
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/lib/esm/compat.js +1 -1
- package/package.json +4 -4
package/lib/esm/compat.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";const e=Symbol.for(`nodejs.util.promisify.custom`);function promisify(t){if(typeof t!=`function`)throw TypeError(`The "original" argument must be of type Function`);let n=t[e];if(typeof n==`function`)return n;function promisified(...e){return new Promise((n,r)=>{t.call(this,...e,(e,...t)=>{e?r(e):t.length<=1?n(t[0]):n(t)})})}return Object.setPrototypeOf(promisified,Object.getPrototypeOf(t)),Object.defineProperty(promisified,e,{value:promisified}),promisified}promisify.custom=e;function callbackify(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type Function`);return function(...t){let n=t.pop();if(typeof n!=`function`)throw TypeError(`The last argument must be of type Function`);e.apply(this,t).then(e=>Promise.resolve().then(()=>n(null,e)),e=>Promise.resolve().then(()=>n(e||Error())))}}function deprecate(e,t,n){let r=!1;function deprecated(...i){if(!r){r=!0;let e=n?`[${n}] ${t}`:t;console.warn(`DeprecationWarning: ${e}`)}return e.apply(this,i)}return Object.setPrototypeOf(deprecated,e),deprecated}function debuglog(e){let debug;return(...t)=>{if(debug===void 0){let t=typeof globalThis.process?.env?.NODE_DEBUG==`string`?globalThis.process.env.NODE_DEBUG:``;if(RegExp(`\\b${e}\\b`,`i`).test(t)){let t=typeof globalThis.process?.pid==`number`?globalThis.process.pid:0;debug=(...n)=>{console.error(`${e.toUpperCase()} ${t}:`,...n)}}else debug=()=>{}}debug(...t)}}function inherits(e,t){if(e==null){let t=TypeError(`The "ctor" argument must be of type Function. Received `+String(e));throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(t==null){let e=TypeError(`The "superCtor" argument must be of type Function. Received `+String(t));throw e.code=`ERR_INVALID_ARG_TYPE`,e}if(t.prototype===void 0){let e=TypeError(`The "superCtor.prototype" property must not be undefined`);throw e.code=`ERR_INVALID_ARG_TYPE`,e}Object.defineProperty(e
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=Symbol.for(`nodejs.util.promisify.custom`);function promisify(t){if(typeof t!=`function`)throw TypeError(`The "original" argument must be of type Function`);let n=t[e];if(typeof n==`function`)return n;function promisified(...e){return new Promise((n,r)=>{t.call(this,...e,(e,...t)=>{e?r(e):t.length<=1?n(t[0]):n(t)})})}return Object.setPrototypeOf(promisified,Object.getPrototypeOf(t)),Object.defineProperty(promisified,e,{value:promisified}),promisified}promisify.custom=e;function callbackify(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type Function`);return function(...t){let n=t.pop();if(typeof n!=`function`)throw TypeError(`The last argument must be of type Function`);e.apply(this,t).then(e=>Promise.resolve().then(()=>n(null,e)),e=>Promise.resolve().then(()=>n(e||Error())))}}function deprecate(e,t,n){let r=!1;function deprecated(...i){if(!r){r=!0;let e=n?`[${n}] ${t}`:t;console.warn(`DeprecationWarning: ${e}`)}return e.apply(this,i)}return Object.setPrototypeOf(deprecated,e),deprecated}function debuglog(e){let debug;return(...t)=>{if(debug===void 0){let t=typeof globalThis.process?.env?.NODE_DEBUG==`string`?globalThis.process.env.NODE_DEBUG:``;if(RegExp(`\\b${e}\\b`,`i`).test(t)){let t=typeof globalThis.process?.pid==`number`?globalThis.process.pid:0;debug=(...n)=>{console.error(`${e.toUpperCase()} ${t}:`,...n)}}else debug=()=>{}}debug(...t)}}function inherits(e,t){if(e==null){let t=TypeError(`The "ctor" argument must be of type Function. Received `+String(e));throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(t==null){let e=TypeError(`The "superCtor" argument must be of type Function. Received `+String(t));throw e.code=`ERR_INVALID_ARG_TYPE`,e}if(t.prototype===void 0){let e=TypeError(`The "superCtor.prototype" property must not be undefined`);throw e.code=`ERR_INVALID_ARG_TYPE`,e}Object.defineProperty(e,`super_`,{value:t,writable:!0,configurable:!0}),Object.setPrototypeOf(e.prototype,t.prototype)}function isDeepStrictEqual(e,t){if(Object.is(e,t))return!0;if(typeof e!=typeof t||e===null||t===null||typeof e!=`object`)return!1;let n=e,r=t;if(Array.isArray(n)&&Array.isArray(r)){if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(!isDeepStrictEqual(n[e],r[e]))return!1;return!0}if(Array.isArray(n)!==Array.isArray(r))return!1;if(n instanceof Date&&r instanceof Date)return n.getTime()===r.getTime();if(n instanceof RegExp&&r instanceof RegExp)return n.source===r.source&&n.flags===r.flags;let i=Object.keys(n),a=Object.keys(r);if(i.length!==a.length)return!1;for(let e of i)if(!Object.prototype.hasOwnProperty.call(r,e)||!isDeepStrictEqual(n[e],r[e]))return!1;return!0}function toUSVString(e){return typeof e.toWellFormed==`function`?e.toWellFormed():e.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,`�`)}function aborted(e,t){return e==null||typeof e.aborted!=`boolean`?Promise.reject(TypeError(`The "signal" argument must be an instance of AbortSignal`)):typeof t!=`object`||!t?Promise.reject(TypeError(`The "resource" argument must be an non-null object`)):e.aborted?Promise.resolve():new Promise(t=>{let onAbort=()=>{e.removeEventListener(`abort`,onAbort),t()};e.addEventListener(`abort`,onAbort,{once:!0})})}export{aborted,callbackify,debuglog,deprecate,inherits,isDeepStrictEqual,promisify,toUSVString};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/util",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Node.js util module for Gjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"util"
|
|
41
41
|
],
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@gjsify/cli": "^0.
|
|
44
|
-
"@gjsify/unit": "^0.
|
|
43
|
+
"@gjsify/cli": "^0.5.0",
|
|
44
|
+
"@gjsify/unit": "^0.5.0",
|
|
45
45
|
"@types/inherits": "^2.0.0",
|
|
46
|
-
"@types/node": "^25.9.
|
|
46
|
+
"@types/node": "^25.9.2",
|
|
47
47
|
"typescript": "^6.0.3"
|
|
48
48
|
},
|
|
49
49
|
"gjsify": {
|