Files
pezkuwi-ui/packages/react-qr/src/qrcode.ts
T
Jaco Greeff 556d07b368 Scan consistency updates (#194)
* Scan consistency updates

* Default auto height/width

* Rework qrcode export

* Fix address scanning (as per new format)

* Update tests

* Bump common

* Pass through genesisHash

* addExternal via address
2019-09-01 09:44:27 +02:00

17 lines
654 B
TypeScript

// Copyright 2017-2019 @polkadot/react-qr authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import _qrcode from 'qrcode-generator';
// A small hurdle to jump through, just to get the default/default correct (as generated)
const qrcode: typeof _qrcode = _qrcode;
// HACK The default function take string -> number[], the Uint8array is compatible
// with that signature and the use thereof
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(qrcode as any).stringToBytes = (data: Uint8Array): Uint8Array =>
data;
export default qrcode;