UNPKG

@polkadot/dev

Version:

A collection of shared CI scripts and development environment used by @polkadot projects

52 lines (51 loc) 1.92 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fooD = exports.fooC = exports.fooB = exports.fooA = exports.pureOpExp = exports.Clazz = void 0; exports.bigIntExp = bigIntExp; exports.dynamic = dynamic; exports.json = json; exports.jsOpExp = jsOpExp; const tslib_1 = require("tslib"); /** This should appear as-is in the output with: 1. extension added, 2. augmented.d.ts correct */ require("./augmented.js"); /** This import should appear as-in in the ouput (cjs without asserts) */ const testJson_json_1 = tslib_1.__importDefault(require("@polkadot/dev/rootJs/testJson.json")); /** Double double work, i.e. re-exports */ var Clazz_js_1 = require("./Clazz.js"); Object.defineProperty(exports, "Clazz", { enumerable: true, get: function () { return Clazz_js_1.Clazz; } }); /** Function to ensure that BigInt does not have the Babel Math.pow() transform */ function bigIntExp() { // 123_456n * 137_858_491_849n return 123456789n * (13n ** 10n); } /** Function to ensure that dynamic imports work */ async function dynamic(a, b) { // NOTE we go via this path so it points to the same location in both ESM // and CJS output (a './dynamic' import would be different otherwise) const { sum } = await import('@polkadot/dev/rootJs/dynamic.mjs'); // eslint-disable-next-line @typescript-eslint/no-unsafe-return return sum(a, b); } /** Function to ensure we have json correctly imported */ function json() { return testJson_json_1.default.test.json; } /** Check support for the ?? operator */ function jsOpExp(a) { const defaults = { a: 42, b: 43, c: 44 }; return a ?? defaults.a; } /** This is an actual check to ensure PURE is all-happy */ exports.pureOpExp = jsOpExp(); const fooA = 1; exports.fooA = fooA; const fooB = 2; exports.fooB = fooB; const fooC = 3; exports.fooC = fooC; const fooD = 4; exports.fooD = fooD;