@neon-rs/load 0.0.20 → 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 CHANGED
@@ -95,9 +95,12 @@ function isGlibc() {
95
95
  !!header &&
96
96
  ('glibcVersionRuntime' in header);
97
97
  }
98
- function debug(dirname) {
99
- const m = path.join(dirname, "index.node");
100
- return fs.existsSync(m) ? require(m) : null;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neon-rs/load",
3
- "version": "0.0.20",
3
+ "version": "0.0.23",
4
4
  "description": "Utilities for loading Neon modules.",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export declare function currentTarget(): string;
2
- export declare function debug(dirname: string): any;
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;