@neon-rs/load 0.0.22 → 0.0.23
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 +6 -3
- package/package.json +1 -1
- package/types/index.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -95,9 +95,12 @@ function isGlibc() {
|
|
|
95
95
|
!!header &&
|
|
96
96
|
('glibcVersionRuntime' in header);
|
|
97
97
|
}
|
|
98
|
-
function debug(
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
function debug(...components) {
|
|
99
|
+
if (components.length === 0 || !components[components.length - 1].endsWith(".node")) {
|
|
100
|
+
components.push("index.node");
|
|
101
|
+
}
|
|
102
|
+
const pathSpec = path.join(...components);
|
|
103
|
+
return fs.existsSync(pathSpec) ? require(pathSpec) : null;
|
|
101
104
|
}
|
|
102
105
|
exports.debug = debug;
|
|
103
106
|
function scope(scope) {
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function currentTarget(): string;
|
|
2
|
-
export declare function debug(
|
|
2
|
+
export declare function debug(...components: string[]): any;
|
|
3
3
|
export declare function scope(scope: string): any;
|
|
4
4
|
export declare function custom(toRequireSpec: (target: string) => string): any;
|