UNPKG

@browser-network/database

Version:

A type of distributed database built on top of the distributed browser-network

43 lines (42 loc) 1.59 kB
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); }; (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define(["require", "exports"], factory); } })(function (require, exports) { "use strict"; exports.__esModule = true; exports.exhaustive = exports.isPromise = exports.debugFactory = void 0; var debugFactory = function (appName) { return function (logLevel) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } if (globalThis['DEBUG'] >= logLevel) { console.log.apply(console, __spreadArray(["[".concat(logLevel, "] ").concat(appName, ": ")], args, false)); } }; }; exports.debugFactory = debugFactory; var isPromise = function (promise) { return promise.hasOwnProperty('then'); }; exports.isPromise = isPromise; var exhaustive = function (arg) { throw new Error('can not have gotten here'); }; exports.exhaustive = exhaustive; });