@peculiar/fortify-client-core
Version:
Fortify client core API for quickly connect to Fortify App
26 lines (25 loc) • 855 B
JavaScript
/**
* @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) {
// eslint-disable-next-line no-extend-native
Object.defineProperty(Uint8Array.prototype, 'slice', {
value(begin, end) {
return new Uint8Array(Array.prototype.slice.call(this, begin, end));
},
});
}
export const polyfillInit = async () => {
// eslint-disable-next-line @typescript-eslint/dot-notation
if (!window['protobuf']) {
await import('protobufjs/dist/protobuf.js');
}
// eslint-disable-next-line @typescript-eslint/dot-notation
if (!window['WebcryptoSocket']) {
await import('@webcrypto-local/client/build/webcrypto-socket.mjs');
}
};