cozmo / jsQR

A pure javascript QR code reading library. This library takes in raw images and will locate, extract and parse any QR code found within.
https://cozmo.github.io/jsQR/
Apache License 2.0
3.67k stars 606 forks source link

Structured Append #132

Open kousu opened 5 years ago

kousu commented 5 years ago

Fixes #128 .

kousu commented 5 years ago

Here's some open questions:

kousu commented 5 years ago

Another issue:

if I try to use import { strict as assert } from 'assert'; and then regenerate the test-cases, I get "Module '"assert"' has no exported member 'strict'. ":

$ ./node_modules/.bin/ts-node --project tests/ tests/generate-test-data.ts

./jsQR/node_modules/ts-node/src/index.ts:307
        throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
              ^
TSError: ⨯ Unable to compile TypeScript
src/decoder/decodeData/index.ts (5,10): Module '"assert"' has no exported member 'strict'. (2305)
    at getOutput (./jsQR/node_modules/ts-node/src/index.ts:307:15)
    at ./jsQR/node_modules/ts-node/src/index.ts:336:16
    at Object.compile (./jsQR/node_modules/ts-node/src/index.ts:498:11)
    at Module.m._compile (./jsQR/node_modules/ts-node/src/index.ts:392:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.require.extensions.(anonymous function) [as .ts] (./jsQR/node_modules/ts-node/src/index.ts:395:12)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)

But this doesn't happen if I just ./node_modules/.bin/jest --runInBand structured-append which has the same offending line in it. How is that possible? Is generate-test-data.ts running in a stricter TypeScript mode?