🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@neon-rs/load

Package Overview
Dependencies
Maintainers
1
Versions
197
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neon-rs/load - npm Package Compare versions

Comparing version

to
0.0.70

22

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bin = exports.currentTarget = void 0;
exports.lazy = exports.bin = exports.currentTarget = void 0;
function currentTarget() {

@@ -95,1 +95,21 @@ let os = null;

exports.bin = bin;
function lazy(loaders, exports) {
let loaded = null;
function load() {
if (loaded) {
return loaded;
}
const target = currentTarget();
if (!loaders.hasOwnProperty(target)) {
throw new Error(`no precompiled module found for ${target}`);
}
loaded = loaders[target]();
return loaded;
}
let module = {};
for (const key of exports) {
Object.defineProperty(module, key, { get() { return load()[key]; } });
}
return module;
}
exports.lazy = lazy;

2

package.json
{
"name": "@neon-rs/load",
"version": "0.0.69",
"version": "0.0.70",
"description": "Utilities for loading Neon modules.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

export declare function currentTarget(): string;
export declare function bin(scope: string[], ...rest: string[]): string;
export declare function lazy(loaders: Record<string, () => any>, exports: string[]): any;