@gjsify/utils 0.4.30 → 0.4.32
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/cli.js +1 -1
- package/lib/esm/file.js +1 -1
- package/lib/esm/gio.js +1 -1
- package/package.json +2 -2
package/lib/esm/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import e from"@girs/glib-2.0";const
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import e from"@girs/glib-2.0";const cli=t=>{let[n,r,i,a]=e.spawn_command_line_sync(t);if(i.byteLength)throw Error(imports.byteArray.toString(i));return imports.byteArray.toString(r)};export{cli};
|
package/lib/esm/file.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import e from"@girs/glib-2.0";const
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import e from"@girs/glib-2.0";const readJSON=t=>{let[n,r]=e.file_get_contents(t);if(n)return JSON.parse(imports.byteArray.toString(r));throw Error(`Error on require "${t}"`)};export{readJSON};
|
package/lib/esm/gio.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import e from"@girs/glib-2.0";import t from"@girs/gio-2.0";
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import e from"@girs/glib-2.0";import t from"@girs/gio-2.0";function gioAsync(e,t,n,...r){return new Promise((i,a)=>{e[t](...r,(t,r)=>{try{i(e[n](r))}catch(e){a(e)}})})}async function readBytesAsync(n,r=4096,i=e.PRIORITY_DEFAULT,a=null){return new Promise((e,o)=>{n.read_bytes_async(r,i,a,(r,i)=>{try{let t=n.read_bytes_finish(i);return t.get_size()===0?e(null):e(imports.byteArray.fromGBytes(t))}catch(n){let r=n;if(typeof r.matches==`function`&&(r.matches(t.IOErrorEnum,t.IOErrorEnum.PARTIAL_INPUT)||r.matches(t.IOErrorEnum,t.IOErrorEnum.CONNECTION_CLOSED)||r.matches(t.IOErrorEnum,t.IOErrorEnum.BROKEN_PIPE)||r.matches(t.IOErrorEnum,t.IOErrorEnum.CLOSED)))return e(null);o(n)}})})}async function*inputStreamAsyncIterator(t,n=4096,r=e.PRIORITY_DEFAULT,i=null){let a;for(;(a=await readBytesAsync(t,n,r,i))!==null;)yield a}export{gioAsync,inputStreamAsyncIterator,readBytesAsync};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/utils",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.32",
|
|
4
4
|
"description": "Utils module for gjsify",
|
|
5
5
|
"module": "lib/esm/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"fs"
|
|
36
36
|
],
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@gjsify/cli": "^0.4.
|
|
38
|
+
"@gjsify/cli": "^0.4.32",
|
|
39
39
|
"typescript": "^6.0.3"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|