@neon-rs/load
Advanced tools
Comparing version 0.0.19 to 0.0.20
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.currentTarget = void 0; | ||
exports.custom = exports.scope = exports.debug = exports.currentTarget = void 0; | ||
const path = __importStar(require("path")); | ||
@@ -103,17 +103,10 @@ const fs = __importStar(require("fs")); | ||
} | ||
function load(options) { | ||
let debugModule = null; | ||
if (options.debug && (debugModule = debug(options.debug))) { | ||
return debugModule; | ||
} | ||
if ("dir" in options) { | ||
return require(path.join(options.dir, "index.node")); | ||
} | ||
if ("scope" in options) { | ||
return require(options.scope + "/" + currentTarget()); | ||
} | ||
if ("custom" in options) { | ||
return require(options.custom(currentTarget())); | ||
} | ||
exports.debug = debug; | ||
function scope(scope) { | ||
return require(scope + "/" + currentTarget()); | ||
} | ||
exports.default = load; | ||
exports.scope = scope; | ||
function custom(toRequireSpec) { | ||
return require(toRequireSpec(currentTarget())); | ||
} | ||
exports.custom = custom; |
{ | ||
"name": "@neon-rs/load", | ||
"version": "0.0.19", | ||
"version": "0.0.20", | ||
"description": "Utilities for loading Neon modules.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
export declare function currentTarget(): string; | ||
export type LoadDir = { | ||
debug?: string; | ||
dir: string; | ||
}; | ||
export type LoadScope = { | ||
debug?: string; | ||
scope: string; | ||
}; | ||
export type LoadCustom = { | ||
debug?: string; | ||
custom: (target: string) => string; | ||
}; | ||
export type LoadOptions = LoadDir | LoadScope | LoadCustom; | ||
export default function load(options: LoadOptions): any; | ||
export declare function debug(dirname: string): any; | ||
export declare function scope(scope: string): any; | ||
export declare function custom(toRequireSpec: (target: string) => string): any; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
4
5992
114