@gjsify/utils 0.0.2 → 0.0.3

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.
@@ -1,27 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var cancel_handler_exports = {};
19
- __export(cancel_handler_exports, {
20
- closeCancelHandler: () => closeCancelHandler,
21
- createCancelHandler: () => createCancelHandler,
22
- getCancelHandler: () => getCancelHandler
23
- });
24
- module.exports = __toCommonJS(cancel_handler_exports);
25
1
  let nextRid = 1;
26
2
  const resources = {};
27
3
  const createCancelHandler = () => {
@@ -39,3 +15,8 @@ const closeCancelHandler = (rid) => {
39
15
  const getCancelHandler = (rid) => {
40
16
  return resources[rid];
41
17
  };
18
+ export {
19
+ closeCancelHandler,
20
+ createCancelHandler,
21
+ getCancelHandler
22
+ };
package/lib/cjs/cli.js CHANGED
@@ -1,40 +1,11 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var cli_exports = {};
29
- __export(cli_exports, {
30
- cli: () => cli
31
- });
32
- module.exports = __toCommonJS(cli_exports);
33
- var import_glib_2 = __toESM(require("@girs/glib-2.0"), 1);
1
+ import GLib from "@girs/glib-2.0";
34
2
  const byteArray = imports.byteArray;
35
3
  const cli = (commandLine) => {
36
- const [res, out, err, status] = import_glib_2.default.spawn_command_line_sync(commandLine);
4
+ const [res, out, err, status] = GLib.spawn_command_line_sync(commandLine);
37
5
  if (err.byteLength)
38
6
  throw new Error(byteArray.toString(err));
39
7
  return byteArray.toString(out);
40
8
  };
9
+ export {
10
+ cli
11
+ };
package/lib/cjs/error.js CHANGED
@@ -1,25 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var error_exports = {};
19
- __export(error_exports, {
20
- initErrorV8Methods: () => initErrorV8Methods
21
- });
22
- module.exports = __toCommonJS(error_exports);
23
1
  const initErrorV8Methods = (ErrorConstructor) => {
24
2
  if (!Error.captureStackTrace) {
25
3
  Error.captureStackTrace = function(targetObject, constructorOpt) {
@@ -38,3 +16,6 @@ const initErrorV8Methods = (ErrorConstructor) => {
38
16
  };
39
17
  }
40
18
  };
19
+ export {
20
+ initErrorV8Methods
21
+ };
package/lib/cjs/file.js CHANGED
@@ -1,42 +1,13 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var file_exports = {};
29
- __export(file_exports, {
30
- readJSON: () => readJSON
31
- });
32
- module.exports = __toCommonJS(file_exports);
33
- var import_glib_2 = __toESM(require("@girs/glib-2.0"), 1);
1
+ import GLib from "@girs/glib-2.0";
34
2
  const byteArray = imports.byteArray;
35
3
  const readJSON = (path) => {
36
- const [ok, contents] = import_glib_2.default.file_get_contents(path);
4
+ const [ok, contents] = GLib.file_get_contents(path);
37
5
  if (ok) {
38
6
  const map = JSON.parse(byteArray.toString(contents));
39
7
  return map;
40
8
  }
41
9
  throw new Error(`Error on require "${path}"`);
42
10
  };
11
+ export {
12
+ readJSON
13
+ };
package/lib/cjs/fs.js CHANGED
@@ -1,40 +1,7 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var fs_exports = {};
29
- __export(fs_exports, {
30
- existsFD: () => existsFD,
31
- existsSync: () => existsSync
32
- });
33
- module.exports = __toCommonJS(fs_exports);
34
- var import_gio_2 = __toESM(require("@girs/gio-2.0"), 1);
1
+ import Gio from "@girs/gio-2.0";
35
2
  const existsFD = (fd) => {
36
3
  try {
37
- let stream = import_gio_2.default.UnixInputStream.new(fd, false);
4
+ let stream = Gio.UnixInputStream.new(fd, false);
38
5
  stream.close(null);
39
6
  return true;
40
7
  } catch (error) {
@@ -45,6 +12,10 @@ function existsSync(path) {
45
12
  if (typeof path !== "string" || path === "") {
46
13
  return false;
47
14
  }
48
- const file = import_gio_2.default.File.new_for_path(path);
15
+ const file = Gio.File.new_for_path(path);
49
16
  return file.query_exists(null);
50
17
  }
18
+ export {
19
+ existsFD,
20
+ existsSync
21
+ };
package/lib/cjs/index.js CHANGED
@@ -1,30 +1,14 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var src_exports = {};
16
- module.exports = __toCommonJS(src_exports);
17
- __reExport(src_exports, require("./types/index.js"), module.exports);
18
- __reExport(src_exports, require("./cancel-handler.js"), module.exports);
19
- __reExport(src_exports, require("./cli.js"), module.exports);
20
- __reExport(src_exports, require("./error.js"), module.exports);
21
- __reExport(src_exports, require("./file.js"), module.exports);
22
- __reExport(src_exports, require("./fs.js"), module.exports);
23
- __reExport(src_exports, require("./log.js"), module.exports);
24
- __reExport(src_exports, require("./message.js"), module.exports);
25
- __reExport(src_exports, require("./os.js"), module.exports);
26
- __reExport(src_exports, require("./path.js"), module.exports);
27
- __reExport(src_exports, require("./process.js"), module.exports);
28
- __reExport(src_exports, require("./system.js"), module.exports);
29
- __reExport(src_exports, require("./tty.js"), module.exports);
30
- __reExport(src_exports, require("./version.js"), module.exports);
1
+ export * from "./types/index.js";
2
+ export * from "./cancel-handler.js";
3
+ export * from "./cli.js";
4
+ export * from "./error.js";
5
+ export * from "./file.js";
6
+ export * from "./fs.js";
7
+ export * from "./log.js";
8
+ export * from "./message.js";
9
+ export * from "./os.js";
10
+ export * from "./path.js";
11
+ export * from "./process.js";
12
+ export * from "./system.js";
13
+ export * from "./tty.js";
14
+ export * from "./version.js";
package/lib/cjs/log.js CHANGED
@@ -1,59 +1,23 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var log_exports = {};
29
- __export(log_exports, {
30
- LogSignals: () => LogSignals,
31
- extractErrorData: () => extractErrorData,
32
- logLevelToString: () => logLevelToString,
33
- logSignals: () => logSignals,
34
- parseStackTrace: () => parseStackTrace
35
- });
36
- module.exports = __toCommonJS(log_exports);
37
- var import_glib_2 = __toESM(require("@girs/glib-2.0"), 1);
1
+ import GLib from "@girs/glib-2.0";
38
2
  const logLevelToString = (logLevel) => {
39
3
  switch (logLevel) {
40
- case import_glib_2.default.LogLevelFlags.FLAG_FATAL:
4
+ case GLib.LogLevelFlags.FLAG_FATAL:
41
5
  return "FLAG_FATAL";
42
- case import_glib_2.default.LogLevelFlags.FLAG_RECURSION:
6
+ case GLib.LogLevelFlags.FLAG_RECURSION:
43
7
  return "FLAG_RECURSION";
44
- case import_glib_2.default.LogLevelFlags.LEVEL_CRITICAL:
8
+ case GLib.LogLevelFlags.LEVEL_CRITICAL:
45
9
  return "LEVEL_CRITICAL";
46
- case import_glib_2.default.LogLevelFlags.LEVEL_DEBUG:
10
+ case GLib.LogLevelFlags.LEVEL_DEBUG:
47
11
  return "LEVEL_DEBUG";
48
- case import_glib_2.default.LogLevelFlags.LEVEL_ERROR:
12
+ case GLib.LogLevelFlags.LEVEL_ERROR:
49
13
  return "LEVEL_ERROR";
50
- case import_glib_2.default.LogLevelFlags.LEVEL_INFO:
14
+ case GLib.LogLevelFlags.LEVEL_INFO:
51
15
  return "LEVEL_INFO";
52
- case import_glib_2.default.LogLevelFlags.LEVEL_MASK:
16
+ case GLib.LogLevelFlags.LEVEL_MASK:
53
17
  return "LEVEL_MASK";
54
- case import_glib_2.default.LogLevelFlags.LEVEL_MESSAGE:
18
+ case GLib.LogLevelFlags.LEVEL_MESSAGE:
55
19
  return "LEVEL_MESSAGE";
56
- case import_glib_2.default.LogLevelFlags.LEVEL_WARNING:
20
+ case GLib.LogLevelFlags.LEVEL_WARNING:
57
21
  return "LEVEL_WARNING";
58
22
  default:
59
23
  return "UNKNOWN";
@@ -137,7 +101,7 @@ class LogSignals {
137
101
  return LogSignals.instance;
138
102
  }
139
103
  initHandler() {
140
- import_glib_2.default.log_set_writer_func((level, fields) => {
104
+ GLib.log_set_writer_func((level, fields) => {
141
105
  const decoder = new TextDecoder("utf-8");
142
106
  const message = decoder.decode(fields?.MESSAGE);
143
107
  const priority = Number(decoder.decode(fields?.PRIORITY));
@@ -148,10 +112,10 @@ class LogSignals {
148
112
  domain
149
113
  };
150
114
  if (!this.handler(level, data)) {
151
- level |= import_glib_2.default.LogLevelFlags.FLAG_RECURSION;
152
- import_glib_2.default.log_default_handler(domain, level, message, null);
115
+ level |= GLib.LogLevelFlags.FLAG_RECURSION;
116
+ GLib.log_default_handler(domain, level, message, null);
153
117
  }
154
- return import_glib_2.default.LogWriterOutput.HANDLED;
118
+ return GLib.LogWriterOutput.HANDLED;
155
119
  });
156
120
  }
157
121
  /**
@@ -161,7 +125,7 @@ class LogSignals {
161
125
  * @returns `true` to catch the log or `false` to output the error to the console as usual
162
126
  */
163
127
  handler(level, structuredData) {
164
- if (level === import_glib_2.default.LogLevelFlags.LEVEL_WARNING && structuredData.domain === "Gjs" && structuredData.message.startsWith("Unhandled promise rejection")) {
128
+ if (level === GLib.LogLevelFlags.LEVEL_WARNING && structuredData.domain === "Gjs" && structuredData.message.startsWith("Unhandled promise rejection")) {
165
129
  try {
166
130
  const errorData = reconstructErrorFromMessage(structuredData.message);
167
131
  const fakePromise = new Promise(() => {
@@ -177,7 +141,7 @@ class LogSignals {
177
141
  } catch (error) {
178
142
  printerr(error);
179
143
  }
180
- } else if (level === import_glib_2.default.LogLevelFlags.LEVEL_CRITICAL) {
144
+ } else if (level === GLib.LogLevelFlags.LEVEL_CRITICAL) {
181
145
  const errorData = reconstructErrorFromMessage(structuredData.message);
182
146
  logSignals.emit("uncaughtException", structuredData, errorData);
183
147
  }
@@ -186,3 +150,10 @@ class LogSignals {
186
150
  }
187
151
  imports.signals.addSignalMethods(LogSignals.prototype);
188
152
  const logSignals = LogSignals.getSingleton();
153
+ export {
154
+ LogSignals,
155
+ extractErrorData,
156
+ logLevelToString,
157
+ logSignals,
158
+ parseStackTrace
159
+ };
@@ -1,26 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var message_exports = {};
19
- __export(message_exports, {
20
- notImplemented: () => notImplemented,
21
- warnNotImplemented: () => warnNotImplemented
22
- });
23
- module.exports = __toCommonJS(message_exports);
24
1
  const notImplemented = (msg) => {
25
2
  const message = msg ? `Not implemented: ${msg}` : "Not implemented";
26
3
  throw new Error(message);
@@ -30,3 +7,7 @@ const warnNotImplemented = (msg) => {
30
7
  console.warn(message);
31
8
  return message;
32
9
  };
10
+ export {
11
+ notImplemented,
12
+ warnNotImplemented
13
+ };
package/lib/cjs/os.js CHANGED
@@ -1,43 +1,6 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var os_exports = {};
29
- __export(os_exports, {
30
- getArch: () => getArch,
31
- getEnv: () => getEnv,
32
- getOs: () => getOs,
33
- getTarget: () => getTarget,
34
- getUserInfo: () => getUserInfo,
35
- getVendor: () => getVendor
36
- });
37
- module.exports = __toCommonJS(os_exports);
38
- var import_cli = require("./cli.js");
39
- var import_glib_2 = __toESM(require("@girs/glib-2.0"), 1);
40
- var import_gio_2 = __toESM(require("@girs/gio-2.0"), 1);
1
+ import { cli } from "./cli.js";
2
+ import GLib from "@girs/glib-2.0";
3
+ import Gio from "@girs/gio-2.0";
41
4
  let _arch = "";
42
5
  let _os = "";
43
6
  let _target = "";
@@ -46,14 +9,14 @@ const getArch = () => {
46
9
  if (_arch) {
47
10
  return _arch;
48
11
  }
49
- _arch = (0, import_cli.cli)("uname -m").trim();
12
+ _arch = cli("uname -m").trim();
50
13
  return _arch;
51
14
  };
52
15
  const getOs = () => {
53
16
  if (_os) {
54
17
  return _os;
55
18
  }
56
- const os = (0, import_cli.cli)("uname -o").trim();
19
+ const os = cli("uname -o").trim();
57
20
  if (/\bDarwin\b/i.test(os)) {
58
21
  _os = "darwin";
59
22
  return _os;
@@ -93,9 +56,9 @@ const extractUserInfo = (passwd, username) => {
93
56
  return null;
94
57
  };
95
58
  const getUserInfo = (username) => {
96
- const file = import_gio_2.default.File.new_for_path("/etc/passwd");
59
+ const file = Gio.File.new_for_path("/etc/passwd");
97
60
  if (!username) {
98
- username = import_glib_2.default.get_user_name();
61
+ username = GLib.get_user_name();
99
62
  }
100
63
  if (userInfo[username]) {
101
64
  return userInfo[username];
@@ -108,3 +71,11 @@ const getUserInfo = (username) => {
108
71
  userInfo[username] = extractUserInfo(contentStr, username);
109
72
  return userInfo[username];
110
73
  };
74
+ export {
75
+ getArch,
76
+ getEnv,
77
+ getOs,
78
+ getTarget,
79
+ getUserInfo,
80
+ getVendor
81
+ };
package/lib/cjs/path.js CHANGED
@@ -1,44 +1,8 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var path_exports = {};
29
- __export(path_exports, {
30
- getNodeModulesPath: () => getNodeModulesPath,
31
- getPathSeparator: () => getPathSeparator,
32
- getProgramDir: () => getProgramDir,
33
- getProgramExe: () => getProgramExe,
34
- resolve: () => resolve
35
- });
36
- module.exports = __toCommonJS(path_exports);
37
- var import_gio_2 = __toESM(require("@girs/gio-2.0"), 1);
38
- var import_glib_2 = __toESM(require("@girs/glib-2.0"), 1);
39
- const { File } = import_gio_2.default;
1
+ import Gio from "@girs/gio-2.0";
2
+ import GLib from "@girs/glib-2.0";
3
+ const { File } = Gio;
40
4
  const _getProgramDir = (programFile) => {
41
- const info = programFile.query_info("standard::", import_gio_2.default.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null);
5
+ const info = programFile.query_info("standard::", Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null);
42
6
  if (info.get_is_symlink()) {
43
7
  const symlinkFile = programFile.get_parent().resolve_relative_path(info.get_symlink_target());
44
8
  return symlinkFile.get_parent();
@@ -54,14 +18,14 @@ const resolve = (dir, ...filenames) => {
54
18
  return file;
55
19
  };
56
20
  const getProgramExe = () => {
57
- const currentDir = import_glib_2.default.get_current_dir();
21
+ const currentDir = GLib.get_current_dir();
58
22
  return File.new_for_path(currentDir).resolve_relative_path(imports.system.programInvocationName);
59
23
  };
60
24
  const getProgramDir = () => {
61
25
  return _getProgramDir(getProgramExe()).get_path();
62
26
  };
63
27
  const getPathSeparator = () => {
64
- const currentDir = import_glib_2.default.get_current_dir();
28
+ const currentDir = GLib.get_current_dir();
65
29
  return /^\//.test(currentDir) ? "/" : "\\";
66
30
  };
67
31
  const getNodeModulesPath = () => {
@@ -77,3 +41,10 @@ const getNodeModulesPath = () => {
77
41
  } while (dir.has_parent(null) && !found);
78
42
  return dir;
79
43
  };
44
+ export {
45
+ getNodeModulesPath,
46
+ getPathSeparator,
47
+ getProgramDir,
48
+ getProgramExe,
49
+ resolve
50
+ };
@@ -1,59 +1,24 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var process_exports = {};
29
- __export(process_exports, {
30
- getLocale: () => getLocale,
31
- getPid: () => getPid,
32
- getPpid: () => getPpid,
33
- getTitle: () => getTitle
34
- });
35
- module.exports = __toCommonJS(process_exports);
36
- var import_gio_2 = __toESM(require("@girs/gio-2.0"), 1);
37
- var import_glib_2 = __toESM(require("@girs/glib-2.0"), 1);
1
+ import Gio from "@girs/gio-2.0";
2
+ import GLib from "@girs/glib-2.0";
38
3
  let PID = 0;
39
4
  let PPID = 0;
40
5
  let LOCALE = "";
41
6
  const getLocale = () => {
42
7
  if (!LOCALE) {
43
- LOCALE = import_glib_2.default.getenv("LANG").split(".")[0].replace("_", "-");
8
+ LOCALE = GLib.getenv("LANG").split(".")[0].replace("_", "-");
44
9
  }
45
10
  return LOCALE;
46
11
  };
47
12
  const getPid = () => {
48
13
  if (!PID) {
49
- PID = new import_gio_2.default.Credentials().get_unix_pid();
14
+ PID = new Gio.Credentials().get_unix_pid();
50
15
  }
51
16
  return PID;
52
17
  };
53
18
  const getPpid = () => {
54
19
  if (!PPID) {
55
20
  const path = `/proc/${getPid()}/status`;
56
- const file = import_gio_2.default.File.new_for_path(path);
21
+ const file = Gio.File.new_for_path(path);
57
22
  const [success, contents] = file.load_contents(null);
58
23
  if (success) {
59
24
  const contentStr = new TextDecoder().decode(contents);
@@ -66,5 +31,11 @@ const getPpid = () => {
66
31
  return PPID;
67
32
  };
68
33
  const getTitle = () => {
69
- return import_glib_2.default.get_prgname();
34
+ return GLib.get_prgname();
35
+ };
36
+ export {
37
+ getLocale,
38
+ getPid,
39
+ getPpid,
40
+ getTitle
70
41
  };
package/lib/cjs/system.js CHANGED
@@ -1,53 +1,18 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var system_exports = {};
29
- __export(system_exports, {
30
- getArgs: () => getArgs,
31
- getArgv: () => getArgv,
32
- parseArgv: () => parseArgv
33
- });
34
- module.exports = __toCommonJS(system_exports);
35
- var import_glib_2 = __toESM(require("@girs/glib-2.0"), 1);
36
- var import_gio_2 = __toESM(require("@girs/gio-2.0"), 1);
37
- var import_fs = require("./fs.js");
38
- const import_meta = {};
39
- const File = import_gio_2.default.File;
1
+ import GLib from "@girs/glib-2.0";
2
+ import Gio from "@girs/gio-2.0";
3
+ import { existsSync } from "./fs.js";
4
+ const File = Gio.File;
40
5
  const args = [];
41
6
  const getArgv = () => {
42
7
  if (args.length) {
43
8
  return args;
44
9
  }
45
- const [__filename] = import_glib_2.default.filename_from_uri(import_meta.url);
10
+ const [__filename] = GLib.filename_from_uri(import.meta.url);
46
11
  args.push(__filename);
47
12
  ARGV.forEach((arg) => {
48
13
  if (arg[0] !== "-") {
49
14
  args.push(
50
- (0, import_fs.existsSync)(arg) ? File.new_for_path(arg).get_path() : arg
15
+ existsSync(arg) ? File.new_for_path(arg).get_path() : arg
51
16
  );
52
17
  } else {
53
18
  args.push(arg);
@@ -75,3 +40,8 @@ const parseArgv = (argv) => {
75
40
  }
76
41
  return result;
77
42
  };
43
+ export {
44
+ getArgs,
45
+ getArgv,
46
+ parseArgv
47
+ };
package/lib/cjs/tty.js CHANGED
@@ -1,32 +1,13 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var tty_exports = {};
19
- __export(tty_exports, {
20
- STDERR_FD: () => STDERR_FD,
21
- STDIN_FD: () => STDIN_FD,
22
- STDOUT_FD: () => STDOUT_FD,
23
- existsTty: () => existsTty
24
- });
25
- module.exports = __toCommonJS(tty_exports);
26
- var import_fs = require("./fs.js");
1
+ import { existsFD } from "./fs.js";
27
2
  const STDIN_FD = 0;
28
3
  const STDOUT_FD = 1;
29
4
  const STDERR_FD = 2;
30
5
  const existsTty = () => {
31
- return (0, import_fs.existsFD)(STDOUT_FD);
6
+ return existsFD(STDOUT_FD);
7
+ };
8
+ export {
9
+ STDERR_FD,
10
+ STDIN_FD,
11
+ STDOUT_FD,
12
+ existsTty
32
13
  };
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var cancel_signals_exports = {};
15
- module.exports = __toCommonJS(cancel_signals_exports);
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var error_data_exports = {};
15
- module.exports = __toCommonJS(error_data_exports);
@@ -1,24 +1,8 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var types_exports = {};
16
- module.exports = __toCommonJS(types_exports);
17
- __reExport(types_exports, require("./cancel-signals.js"), module.exports);
18
- __reExport(types_exports, require("./error-data.js"), module.exports);
19
- __reExport(types_exports, require("./signal-methods.js"), module.exports);
20
- __reExport(types_exports, require("./stack-trace-frame.js"), module.exports);
21
- __reExport(types_exports, require("./structured-log-data.js"), module.exports);
22
- __reExport(types_exports, require("./uncaught-exception-data.js"), module.exports);
23
- __reExport(types_exports, require("./unhandled-rejection-data.js"), module.exports);
24
- __reExport(types_exports, require("./user-info.js"), module.exports);
1
+ export * from "./cancel-signals.js";
2
+ export * from "./error-data.js";
3
+ export * from "./signal-methods.js";
4
+ export * from "./stack-trace-frame.js";
5
+ export * from "./structured-log-data.js";
6
+ export * from "./uncaught-exception-data.js";
7
+ export * from "./unhandled-rejection-data.js";
8
+ export * from "./user-info.js";
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var signal_methods_exports = {};
15
- module.exports = __toCommonJS(signal_methods_exports);
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var stack_trace_frame_exports = {};
15
- module.exports = __toCommonJS(stack_trace_frame_exports);
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var structured_log_data_exports = {};
15
- module.exports = __toCommonJS(structured_log_data_exports);
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var uncaught_exception_data_exports = {};
15
- module.exports = __toCommonJS(uncaught_exception_data_exports);
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var unhandled_rejection_data_exports = {};
15
- module.exports = __toCommonJS(unhandled_rejection_data_exports);
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var user_info_exports = {};
15
- module.exports = __toCommonJS(user_info_exports);
@@ -1,26 +1,7 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var version_exports = {};
19
- __export(version_exports, {
20
- getGjsVersion: () => getGjsVersion
21
- });
22
- module.exports = __toCommonJS(version_exports);
23
1
  const getGjsVersion = () => {
24
2
  const v = imports.system.version.toString();
25
3
  return `${v[0]}.${+(v[1] + v[2])}.${+(v[3] + v[4])}`;
26
4
  };
5
+ export {
6
+ getGjsVersion
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/utils",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Utils module for gjsify",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -35,7 +35,7 @@
35
35
  "fs"
36
36
  ],
37
37
  "devDependencies": {
38
- "@gjsify/cli": "^0.0.2",
38
+ "@gjsify/cli": "^0.0.3",
39
39
  "typescript": "^5.1.3"
40
40
  },
41
41
  "dependencies": {