Open kousu opened 5 years ago
Here's some open questions:
.structuredAppend
to result objects with .M
and .N
subobjects. "Structured Append" is the technical name from the spec, and it matches what qrencode and zxing-cpp call this feature, but it's very abstract; I would rather it be something like .numbering.page
, .numbering.of
.N
but not M
so that you have 0<=M<N<=16, python-style?loadPngSync()
and used assert
in a couple of places instead of expect()
. I'm not proud of this but I couldn't see another way. Help?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?
Fixes #128 .