(options)
| 14 | } |
| 15 | |
| 16 | export function encodeData(options) { |
| 17 | if (!options.text || options.text.length <= 0) return null |
| 18 | |
| 19 | options = extend({ |
| 20 | render : "canvas", |
| 21 | width : 256, |
| 22 | height : 256, |
| 23 | typeNumber : -1, |
| 24 | correctLevel : 1, |
| 25 | background : "#ffffff", |
| 26 | foreground : "#000000" |
| 27 | }, options); |
| 28 | |
| 29 | let qrcode = new QRCodeEncoder(options.typeNumber, options.correctLevel) |
| 30 | qrcode.addData(options.text) |
| 31 | qrcode.make() |
| 32 | |
| 33 | return qrcode; |
| 34 | } |
| 35 | |
| 36 | export function getTypeTable(qrcode) { |
| 37 | const nCount = qrcode.getModuleCount(); |
no test coverage detected