@neon-rs/load 0.0.29 → 0.0.31
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/index.js +12 -36
- package/package.json +1 -1
- package/types/index.d.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -1,31 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.custom = exports.scope = exports.
|
|
27
|
-
const
|
|
28
|
-
const fs = __importStar(require("fs"));
|
|
3
|
+
exports.custom = exports.scope = exports.currentTarget = void 0;
|
|
4
|
+
const node_module_1 = require("node:module");
|
|
29
5
|
function currentTarget() {
|
|
30
6
|
let os = null;
|
|
31
7
|
switch (process.platform) {
|
|
@@ -95,19 +71,19 @@ function isGlibc() {
|
|
|
95
71
|
!!header &&
|
|
96
72
|
('glibcVersionRuntime' in header);
|
|
97
73
|
}
|
|
98
|
-
function debug(...components) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
74
|
+
// export function debug(...components: string[]) {
|
|
75
|
+
// if (components.length === 0 || !components[components.length - 1].endsWith(".node")) {
|
|
76
|
+
// components.push("index.node");
|
|
77
|
+
// }
|
|
78
|
+
// const pathSpec = path.join(...components);
|
|
79
|
+
// return fs.existsSync(pathSpec) ? require(pathSpec) : null;
|
|
80
|
+
// }
|
|
81
|
+
const requireAbsolute = (0, node_module_1.createRequire)(process.cwd());
|
|
106
82
|
function scope(scope) {
|
|
107
|
-
return
|
|
83
|
+
return requireAbsolute(scope + "/" + currentTarget());
|
|
108
84
|
}
|
|
109
85
|
exports.scope = scope;
|
|
110
86
|
function custom(toRequireSpec) {
|
|
111
|
-
return
|
|
87
|
+
return requireAbsolute(toRequireSpec(currentTarget()));
|
|
112
88
|
}
|
|
113
89
|
exports.custom = custom;
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED