UNPKG

@openland/foundationdb-core

Version:

Node.js bindings for the FoundationDB database

32 lines 1.36 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const path = require("path"); const error_1 = __importDefault(require("./error")); var ErrorPredicate; (function (ErrorPredicate) { ErrorPredicate[ErrorPredicate["Retryable"] = 50000] = "Retryable"; ErrorPredicate[ErrorPredicate["MaybeCommitted"] = 50001] = "MaybeCommitted"; ErrorPredicate[ErrorPredicate["RetryableNotCommitted"] = 50002] = "RetryableNotCommitted"; })(ErrorPredicate = exports.ErrorPredicate || (exports.ErrorPredicate = {})); // Will load a compiled build if present or a prebuild. // If no build if found it will throw an exception const rootDir = __dirname.endsWith(`dist${path.sep}lib`) // gross. ? path.resolve(`${__dirname}/../..`) : path.resolve(`${__dirname}/..`); let mod; try { mod = require('node-gyp-build')(rootDir); } catch (e) { // tslint:disable:no-console console.error('Could not load native module. Make sure the foundationdb client is installed and'); console.error('(on windows) in your PATH. https://www.foundationdb.org/download/'); // tslint:enable:no-console throw e; } mod.FDBError = error_1.default; exports.default = mod; //# sourceMappingURL=native.js.map