@neon-rs/load 0.0.34 → 0.0.36

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
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bin = exports.custom = exports.scope = exports.currentTarget = void 0;
4
- const node_module_1 = require("node:module");
3
+ exports.bin = exports.currentTarget = void 0;
5
4
  function currentTarget() {
6
5
  let os = null;
7
6
  switch (process.platform) {
@@ -78,16 +77,18 @@ function isGlibc() {
78
77
  // const pathSpec = path.join(...components);
79
78
  // return fs.existsSync(pathSpec) ? require(pathSpec) : null;
80
79
  // }
81
- const requireAbsolute = (0, node_module_1.createRequire)(process.cwd());
82
- function scope(scope) {
83
- return requireAbsolute(scope + "/" + currentTarget());
84
- }
85
- exports.scope = scope;
86
- function custom(toRequireSpec) {
87
- return requireAbsolute(toRequireSpec(currentTarget()));
80
+ function* interleave(a1, a2) {
81
+ const length = Math.max(a1.length, a2.length);
82
+ for (let i = 0; i < length; i++) {
83
+ if (i < a1.length) {
84
+ yield a1[i];
85
+ }
86
+ if (i < a2.length) {
87
+ yield a2[i];
88
+ }
89
+ }
88
90
  }
89
- exports.custom = custom;
90
- function bin(scope) {
91
- return scope + "/" + currentTarget();
91
+ function bin(scope, ...rest) {
92
+ return [...interleave(scope, rest)].join("") + "/" + currentTarget();
92
93
  }
93
94
  exports.bin = bin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neon-rs/load",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
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,2 @@
1
1
  export declare function currentTarget(): string;
2
- export declare function scope(scope: string): any;
3
- export declare function custom(toRequireSpec: (target: string) => string): any;
4
- export declare function bin(scope: string): string;
2
+ export declare function bin(scope: string[], ...rest: string[]): string;