UNPKG

@peculiar/fortify-client-core

Version:

Fortify client core API for quickly connect to Fortify App

24 lines (23 loc) 749 B
/** * @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. */ if (!Uint8Array.prototype.slice) { Object.defineProperty(Uint8Array.prototype, 'slice', { value(begin, end) { return new Uint8Array(Array.prototype.slice.call(this, begin, end)); }, }); } export const polyfillInit = async () => { if (!window['protobuf']) { await import('protobufjs/dist/protobuf.js'); } if (!window['WebcryptoSocket']) { // eslint-disable-next-line @typescript-eslint/no-explicit-any await import('@webcrypto-local/client/build/webcrypto-socket.mjs'); } };