1 line
11 KiB
JSON
1 line
11 KiB
JSON
|
{"ast":null,"code":"\"use strict\";\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = {\n enumerable: true,\n get: function () {\n return m[k];\n }\n };\n }\n Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\nvar __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {\n Object.defineProperty(o, \"default\", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = this && this.__importStar || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.load = exports.currentTarget = void 0;\nconst path = __importStar(require(\"path\"));\nconst fs = __importStar(require(\"fs\"));\nfunction currentTarget() {\n let os = null;\n switch (process.platform) {\n case 'android':\n switch (process.arch) {\n case 'arm':\n return 'android-arm-eabi';\n case 'arm64':\n return 'android-arm64';\n }\n os = 'Android';\n break;\n case 'win32':\n switch (process.arch) {\n case 'x64':\n return 'win32-x64-msvc';\n case 'arm64':\n return 'win32-arm64-msvc';\n case 'ia32':\n return 'win32-ia32-msvc';\n }\n os = 'Windows';\n break;\n case 'darwin':\n switch (process.arch) {\n case 'x64':\n return 'darwin-x64';\n case 'arm64':\n return 'darwin-arm64';\n }\n os = 'macOS';\n break;\n case 'linux':\n switch (process.arch) {\n case 'x64':\n case 'arm64':\n return isGlibc() ? `linux-${process.arch}-gnu` : `linux-${process.arch}-musl`;\n case 'arm':\n return 'linux-arm-gnueabihf';\n }\n os = 'Linux';\n break;\n case 'freebsd':\n if (process.arch === 'x64') {\n return 'freebsd-x64';\n }\n os = 'FreeBSD';\n break;\n }\n if (os) {\n throw new Error(`Neon: unsupported ${os} architecture: ${process.arch}`);\n }\n throw new Error(`Neon: unsupported system: ${process.platform}`);\n}\nexports.currentTarget = currentTarget;\nfunction isGlibc() {\n // Cast to unknown to work around a bug in the type definition:\n // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/40140\n const report = process.report?.getReport();\n if (typeof report !== 'object' || !report || !('header' in report)) {\n return false;\n }\n const header = report.header;\n return typeof header === 'object' && !!header && 'glibcVersionRuntime' in header;\n}\nfunction load(dirname) {\n const m = path.join(dirname, \"index.node\");\n return fs.existsSync(m) ? require(m) : null;\n}\nexports.load = load;","map":{"version":3,"names":["__createBinding","Object","create","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","defineProperty","__setModuleDefault","v","value","__importStar","mod","result","prototype","hasOwnProperty","call","exports","load","currentTarget","path","require","fs","os","process","platform","arch","isGlibc","Error","report","getReport","header","dirname","join","existsSync"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@neon-rs/load/dist/index.js"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc |
|