UNPKG

@peculiar/fortify-client-core

Version:

Fortify client core API for quickly connect to Fortify App

29 lines (28 loc) 972 B
"use strict"; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.polyfillInit = void 0; if (!Uint8Array.prototype.slice) { Object.defineProperty(Uint8Array.prototype, 'slice', { value(begin, end) { return new Uint8Array(Array.prototype.slice.call(this, begin, end)); }, }); } const polyfillInit = async () => { var _a; if (!window['protobuf']) { await Promise.resolve().then(() => require('protobufjs/dist/protobuf.js')); } if (!window['WebcryptoSocket']) { // eslint-disable-next-line @typescript-eslint/no-explicit-any await (_a = '@webcrypto-local/client/build/webcrypto-socket.mjs', Promise.resolve().then(() => require(_a))); } }; exports.polyfillInit = polyfillInit;