@sythos/js_barcode_universal 1.5.8 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +5 -4
- package/NOTICE.md +2 -2
- package/README.md +17 -13
- package/bundle/sythos-barcode.esm.js +11658 -11244
- package/bundle/sythos-barcode.js +11658 -11244
- package/package.json +10 -3
- package/src/index.d.ts +1 -1
- package/src/index.js +508 -516
- package/src/js/aztec/decoder.js +208 -199
- package/src/js/aztec/detector.js +153 -126
- package/src/js/aztec/encoder.js +172 -153
- package/src/js/aztec/high-level.js +106 -101
- package/src/js/aztec/index.js +1 -12
- package/src/js/aztec/tables.js +106 -120
- package/src/js/aztecrune/decoder.js +76 -85
- package/src/js/aztecrune/detector.js +107 -93
- package/src/js/aztecrune/encoder.js +50 -68
- package/src/js/aztecrune/index.js +1 -16
- package/src/js/aztecrune/tables.js +59 -54
- package/src/js/compactpdf417/decoder.js +69 -74
- package/src/js/compactpdf417/detector.js +74 -75
- package/src/js/compactpdf417/encoder.js +68 -81
- package/src/js/compactpdf417/index.js +1 -13
- package/src/js/compactpdf417/tables.js +71 -80
- package/src/js/core/bit-buffer.js +106 -122
- package/src/js/core/bit-matrix.js +196 -194
- package/src/js/core/errors.js +13 -15
- package/src/js/core/galois-field.js +119 -133
- package/src/js/core/index.js +2 -19
- package/src/js/core/reed-solomon.js +195 -204
- package/src/js/databar/codec.js +93 -108
- package/src/js/databar/decoder.js +149 -140
- package/src/js/databar/encoder.js +47 -55
- package/src/js/databar/gs1.js +122 -123
- package/src/js/databar/index.js +4 -36
- package/src/js/databar/patterns.js +81 -85
- package/src/js/databar/tables.js +51 -52
- package/src/js/datamatrix/decoder.js +216 -182
- package/src/js/datamatrix/detector.js +161 -132
- package/src/js/datamatrix/encoder.js +192 -133
- package/src/js/datamatrix/index.js +1 -9
- package/src/js/datamatrix/tables.js +68 -69
- package/src/js/frameqr/decoder.js +102 -125
- package/src/js/frameqr/detector.js +101 -94
- package/src/js/frameqr/encoder.js +67 -80
- package/src/js/frameqr/index.js +1 -10
- package/src/js/frameqr/tables.js +145 -163
- package/src/js/image/binarizer.js +146 -162
- package/src/js/image/grid-sampler.js +63 -79
- package/src/js/image/index.js +0 -2
- package/src/js/image/luminance.js +129 -140
- package/src/js/image/perspective.js +112 -149
- package/src/js/micropdf417/compaction.js +64 -65
- package/src/js/micropdf417/decoder.js +106 -109
- package/src/js/micropdf417/detector.js +73 -70
- package/src/js/micropdf417/encoder.js +129 -154
- package/src/js/micropdf417/error-correction.js +6 -11
- package/src/js/micropdf417/index.js +2 -16
- package/src/js/micropdf417/tables.js +112 -99
- package/src/js/microqr/decoder.js +177 -182
- package/src/js/microqr/detector.js +240 -256
- package/src/js/microqr/encoder.js +239 -194
- package/src/js/microqr/index.js +0 -2
- package/src/js/microqr/tables.js +208 -200
- package/src/js/oned/addons.js +167 -191
- package/src/js/oned/index.js +27 -58
- package/src/js/oned/patterns.js +194 -213
- package/src/js/oned/reader.js +1003 -984
- package/src/js/oned/writers.js +411 -466
- package/src/js/pdf417/compaction.js +315 -222
- package/src/js/pdf417/decoder.js +71 -36
- package/src/js/pdf417/detector.js +377 -361
- package/src/js/pdf417/encoder.js +57 -46
- package/src/js/pdf417/error-correction.js +5 -8
- package/src/js/pdf417/tables.js +248 -250
- package/src/js/qr/decoder.js +311 -347
- package/src/js/qr/detector.js +378 -395
- package/src/js/qr/encoder.js +514 -599
- package/src/js/qr/index.js +0 -2
- package/src/js/qr/tables.js +375 -422
- package/src/js/render/image-data.js +57 -62
- package/src/js/render/index.js +21 -23
- package/src/js/render/options.js +82 -90
- package/src/js/render/png.js +144 -169
- package/src/js/render/svg.js +41 -44
- package/src/js/render/webgl.js +103 -109
- package/src/js/render/webgpu.js +205 -217
- package/src/js/rmqr/decoder.js +161 -53
- package/src/js/rmqr/detector.js +73 -41
- package/src/js/rmqr/encoder.js +253 -104
- package/src/js/rmqr/index.js +1 -5
- package/src/js/rmqr/tables.js +108 -85
- package/src/ts/aztec/decoder.ts +317 -0
- package/src/ts/aztec/detector.ts +224 -0
- package/src/ts/aztec/encoder.ts +257 -0
- package/src/ts/aztec/high-level.ts +211 -0
- package/src/ts/aztec/index.ts +45 -0
- package/src/ts/aztec/tables.ts +210 -0
- package/src/ts/aztecrune/decoder.ts +155 -0
- package/src/ts/aztecrune/detector.ts +166 -0
- package/src/ts/aztecrune/encoder.ts +121 -0
- package/src/ts/aztecrune/index.ts +49 -0
- package/src/ts/aztecrune/tables.ts +137 -0
- package/src/ts/compactpdf417/decoder.ts +128 -0
- package/src/ts/compactpdf417/detector.ts +139 -0
- package/src/ts/compactpdf417/encoder.ts +140 -0
- package/src/ts/compactpdf417/index.ts +17 -0
- package/src/ts/compactpdf417/tables.ts +173 -0
- package/src/ts/core/bit-buffer.ts +174 -0
- package/src/ts/core/bit-matrix.ts +241 -0
- package/src/ts/core/errors.ts +61 -0
- package/src/ts/core/galois-field.ts +207 -0
- package/src/ts/core/index.ts +56 -0
- package/src/ts/core/reed-solomon.ts +327 -0
- package/src/ts/databar/codec.ts +181 -0
- package/src/ts/databar/decoder.ts +215 -0
- package/src/ts/databar/encoder.ts +96 -0
- package/src/ts/databar/gs1.ts +177 -0
- package/src/ts/databar/index.ts +68 -0
- package/src/ts/databar/patterns.ts +143 -0
- package/src/ts/databar/tables.ts +124 -0
- package/src/ts/datamatrix/decoder.ts +262 -0
- package/src/ts/datamatrix/detector.ts +225 -0
- package/src/ts/datamatrix/encoder.ts +191 -0
- package/src/ts/datamatrix/index.ts +42 -0
- package/src/ts/datamatrix/tables.ts +123 -0
- package/src/ts/frameqr/decoder.ts +239 -0
- package/src/ts/frameqr/detector.ts +192 -0
- package/src/ts/frameqr/encoder.ts +156 -0
- package/src/ts/frameqr/index.ts +42 -0
- package/src/ts/frameqr/tables.ts +270 -0
- package/src/ts/image/binarizer.ts +270 -0
- package/src/ts/image/grid-sampler.ts +164 -0
- package/src/ts/image/index.ts +40 -0
- package/src/ts/image/luminance.ts +196 -0
- package/src/ts/image/perspective.ts +195 -0
- package/src/ts/index.d.ts +1 -1
- package/src/ts/index.ts +790 -0
- package/src/ts/micropdf417/compaction.ts +116 -0
- package/src/ts/micropdf417/decoder.ts +183 -0
- package/src/ts/micropdf417/detector.ts +149 -0
- package/src/ts/micropdf417/encoder.ts +209 -0
- package/src/ts/micropdf417/error-correction.ts +55 -0
- package/src/ts/micropdf417/index.ts +49 -0
- package/src/ts/micropdf417/tables.ts +184 -0
- package/src/ts/microqr/decoder.ts +245 -0
- package/src/ts/microqr/detector.ts +355 -0
- package/src/ts/microqr/encoder.ts +269 -0
- package/src/ts/microqr/index.ts +36 -0
- package/src/ts/microqr/tables.ts +316 -0
- package/src/ts/oned/addons.ts +420 -0
- package/src/ts/oned/index.ts +106 -0
- package/src/ts/oned/patterns.ts +384 -0
- package/src/ts/oned/reader.ts +1364 -0
- package/src/ts/oned/writers.ts +746 -0
- package/src/ts/pdf417/compaction.ts +298 -0
- package/src/ts/pdf417/decoder.ts +75 -0
- package/src/ts/pdf417/detector.ts +468 -0
- package/src/ts/pdf417/encoder.ts +91 -0
- package/src/ts/pdf417/error-correction.ts +47 -0
- package/src/ts/pdf417/index.ts +6 -0
- package/src/ts/pdf417/tables.ts +317 -0
- package/src/ts/qr/decoder.ts +575 -0
- package/src/ts/qr/detector.ts +630 -0
- package/src/ts/qr/encoder.ts +958 -0
- package/src/ts/qr/index.ts +44 -0
- package/src/ts/qr/tables.ts +737 -0
- package/src/ts/render/image-data.ts +125 -0
- package/src/ts/render/index.ts +130 -0
- package/src/ts/render/options.ts +160 -0
- package/src/ts/render/png.ts +295 -0
- package/src/ts/render/svg.ts +120 -0
- package/src/ts/render/webgl.ts +206 -0
- package/src/ts/render/webgpu.ts +369 -0
- package/src/ts/rmqr/decoder.ts +101 -0
- package/src/ts/rmqr/detector.ts +90 -0
- package/src/ts/rmqr/encoder.ts +172 -0
- package/src/ts/rmqr/index.ts +37 -0
- package/src/ts/rmqr/tables.ts +154 -0
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
*
|
|
28
28
|
* Original work. No code from any other barcode implementation.
|
|
29
29
|
*/
|
|
30
|
-
|
|
31
30
|
/**
|
|
32
31
|
* MicroPDF417 format facts and Row Address Pattern (RAP) helpers.
|
|
33
32
|
*
|
|
@@ -42,143 +41,157 @@
|
|
|
42
41
|
*
|
|
43
42
|
* @module micropdf417/tables
|
|
44
43
|
*/
|
|
45
|
-
|
|
46
44
|
const variant = (id, columns, rows, eccCodewords, rapStart, rapRotation) => Object.freeze({
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
id,
|
|
46
|
+
columns,
|
|
47
|
+
rows,
|
|
48
|
+
totalCodewords: columns * rows,
|
|
49
|
+
dataCodewords: columns * rows - eccCodewords,
|
|
50
|
+
eccCodewords,
|
|
51
|
+
rapStart,
|
|
52
|
+
rapRotation,
|
|
55
53
|
});
|
|
56
|
-
|
|
57
54
|
/** All 34 predefined MicroPDF417 symbol variants, in format-table order. */
|
|
58
55
|
export const MICROPDF417_VARIANTS = Object.freeze([
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
56
|
+
variant(1, 1, 11, 7, 1, 8), variant(2, 1, 14, 7, 8, 0),
|
|
57
|
+
variant(3, 1, 17, 7, 36, 0), variant(4, 1, 20, 8, 19, 0),
|
|
58
|
+
variant(5, 1, 24, 8, 9, 8), variant(6, 1, 28, 8, 25, 8),
|
|
59
|
+
variant(7, 2, 8, 8, 1, 0), variant(8, 2, 11, 9, 1, 8),
|
|
60
|
+
variant(9, 2, 14, 9, 8, 0), variant(10, 2, 17, 10, 36, 0),
|
|
61
|
+
variant(11, 2, 20, 11, 19, 0), variant(12, 2, 23, 13, 9, 8),
|
|
62
|
+
variant(13, 2, 26, 15, 27, 8),
|
|
63
|
+
variant(14, 3, 6, 12, 1, 0), variant(15, 3, 8, 14, 7, 0),
|
|
64
|
+
variant(16, 3, 10, 16, 15, 0), variant(17, 3, 12, 18, 25, 0),
|
|
65
|
+
variant(18, 3, 15, 21, 37, 0), variant(19, 3, 20, 26, 1, 16),
|
|
66
|
+
variant(20, 3, 26, 32, 1, 8), variant(21, 3, 32, 38, 21, 8),
|
|
67
|
+
variant(22, 3, 38, 44, 15, 16), variant(23, 3, 44, 50, 1, 24),
|
|
68
|
+
variant(24, 4, 4, 8, 47, 24), variant(25, 4, 6, 12, 1, 0),
|
|
69
|
+
variant(26, 4, 8, 14, 7, 0), variant(27, 4, 10, 16, 15, 0),
|
|
70
|
+
variant(28, 4, 12, 18, 25, 0), variant(29, 4, 15, 21, 37, 0),
|
|
71
|
+
variant(30, 4, 20, 26, 1, 16), variant(31, 4, 26, 32, 1, 8),
|
|
72
|
+
variant(32, 4, 32, 38, 21, 8), variant(33, 4, 38, 44, 15, 16),
|
|
73
|
+
variant(34, 4, 44, 50, 1, 24),
|
|
77
74
|
]);
|
|
78
|
-
|
|
79
75
|
const byId = new Map(MICROPDF417_VARIANTS.map((entry) => [entry.id, entry]));
|
|
80
|
-
|
|
81
76
|
// Six run widths, ordered bar-space-bar-space-bar-space. A RAP is ten
|
|
82
77
|
// modules wide; the right RAP has one additional one-module stop bar when
|
|
83
78
|
// rendered. Keeping runs rather than bitmap literals makes each invariant
|
|
84
79
|
// inspectable and avoids a rendering-specific representation here.
|
|
85
80
|
const SIDE_RAP_RUNS = Object.freeze([
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
81
|
+
'221311', '311311', '312211', '222211', '213211', '214111', '223111', '313111',
|
|
82
|
+
'322111', '412111', '421111', '331111', '241111', '232111', '231211', '321211',
|
|
83
|
+
'411211', '411121', '411112', '321112', '312112', '311212', '311221', '311131',
|
|
84
|
+
'311122', '311113', '221113', '221122', '221131', '221221', '222121', '312121',
|
|
85
|
+
'321121', '231121', '231112', '222112', '213112', '212212', '212221', '212131',
|
|
86
|
+
'212122', '212113', '211213', '211123', '211132', '211141', '211231', '211222',
|
|
87
|
+
'211312', '211321', '211411', '212311',
|
|
93
88
|
]);
|
|
94
|
-
|
|
95
89
|
const CENTER_RAP_RUNS = Object.freeze([
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
90
|
+
'112231', '121231', '122131', '131131', '131221', '132121', '141121', '141211',
|
|
91
|
+
'142111', '133111', '132211', '131311', '122311', '123211', '124111', '115111',
|
|
92
|
+
'114211', '114121', '123121', '123112', '122212', '122221', '121321', '121411',
|
|
93
|
+
'112411', '113311', '113221', '113212', '113122', '122122', '131122', '131113',
|
|
94
|
+
'122113', '113113', '112213', '112222', '112312', '112321', '111421', '111331',
|
|
95
|
+
'111322', '111232', '111223', '111133', '111124', '111214', '112114', '121114',
|
|
96
|
+
'121123', '121132', '112132', '112141',
|
|
103
97
|
]);
|
|
104
|
-
|
|
105
98
|
/** @param {number} value @param {number} offset @returns {number} */
|
|
106
99
|
export function microPdf417NextRap(value, offset = 1) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
if (!Number.isInteger(value) || value < 1 || value > 52)
|
|
101
|
+
throw new RangeError('MicroPDF417: RAP number must be in 1..52');
|
|
102
|
+
if (!Number.isInteger(offset))
|
|
103
|
+
throw new RangeError('MicroPDF417: RAP offset must be an integer');
|
|
104
|
+
return ((value - 1 + offset) % 52 + 52) % 52 + 1;
|
|
110
105
|
}
|
|
111
|
-
|
|
112
106
|
/** @param {number} id @returns {Readonly<typeof MICROPDF417_VARIANTS[number]>} */
|
|
113
107
|
export function microPdf417VariantByNumber(id) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
const entry = byId.get(id);
|
|
109
|
+
if (!entry)
|
|
110
|
+
throw new RangeError('MicroPDF417: variant must be an integer in 1..34');
|
|
111
|
+
return entry;
|
|
117
112
|
}
|
|
118
|
-
|
|
119
113
|
/**
|
|
120
114
|
* Return the smallest data-region candidate that fits `codewords`.
|
|
121
115
|
* Ties are resolved by width, then height, so selection is deterministic.
|
|
122
116
|
*/
|
|
123
117
|
export function microPdf417VariantForCapacity(codewords) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
118
|
+
if (!Number.isInteger(codewords) || codewords < 1)
|
|
119
|
+
throw new RangeError('MicroPDF417: codeword capacity must be a positive integer');
|
|
120
|
+
const candidates = MICROPDF417_VARIANTS.filter((entry) => entry.dataCodewords >= codewords);
|
|
121
|
+
if (!candidates.length)
|
|
122
|
+
throw new RangeError('MicroPDF417: payload exceeds the largest symbol data region');
|
|
123
|
+
return candidates.slice().sort((a, b) => a.totalCodewords - b.totalCodewords || a.columns - b.columns || a.rows - b.rows)[0];
|
|
128
124
|
}
|
|
129
|
-
|
|
130
125
|
/** Return the six bar/space run widths for a numbered side or center RAP. */
|
|
131
126
|
export function microPdf417RapSequence(number, kind = 'side') {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
if (!Number.isInteger(number) || number < 1 || number > 52)
|
|
128
|
+
throw new RangeError('MicroPDF417: RAP number must be in 1..52');
|
|
129
|
+
if (kind === 'side')
|
|
130
|
+
return SIDE_RAP_RUNS[number - 1];
|
|
131
|
+
if (kind === 'center')
|
|
132
|
+
return CENTER_RAP_RUNS[number - 1];
|
|
133
|
+
throw new RangeError('MicroPDF417: RAP kind must be side or center');
|
|
136
134
|
}
|
|
137
|
-
|
|
138
135
|
/**
|
|
139
136
|
* Resolve all row-address data for a zero-based row within a variant.
|
|
140
137
|
* @returns {{left: number, center: number|null, right: number, cluster: 0|3|6}}
|
|
141
138
|
*/
|
|
142
139
|
export function microPdf417RowAddress(entry, row) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
140
|
+
if (!entry || !Number.isInteger(entry.columns) || !Number.isInteger(entry.rows))
|
|
141
|
+
throw new TypeError('MicroPDF417: a variant entry is required');
|
|
142
|
+
if (!Number.isInteger(row) || row < 0 || row >= entry.rows)
|
|
143
|
+
throw new RangeError(`MicroPDF417: row must be in 0..${entry.rows - 1}`);
|
|
144
|
+
const left = microPdf417NextRap(entry.rapStart, row);
|
|
145
|
+
const cluster = /** @type {0|3|6} */ (((left - 1) % 3) * 3);
|
|
146
|
+
if (entry.columns < 3)
|
|
147
|
+
return { left, center: null, right: microPdf417NextRap(left, entry.rapRotation), cluster };
|
|
148
|
+
const center = microPdf417NextRap(left, entry.rapRotation);
|
|
149
|
+
return { left, center, right: microPdf417NextRap(center, entry.rapRotation), cluster };
|
|
150
150
|
}
|
|
151
|
-
|
|
152
151
|
const validRuns = (runs) => runs.length === 6 && /^[1-9]{6}$/.test(runs) && [...runs].reduce((sum, digit) => sum + Number(digit), 0) === 10;
|
|
153
152
|
const oneEdgeShift = (from, to) => [...from].reduce((sum, digit, index) => sum + Math.abs(Number(digit) - Number(to[index])), 0) === 2;
|
|
154
|
-
|
|
155
153
|
/** Return any table-invariant failures; an empty result means the table is coherent. */
|
|
156
154
|
export function validateMicroPdf417Tables() {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
155
|
+
const issues = [];
|
|
156
|
+
if (MICROPDF417_VARIANTS.length !== 34)
|
|
157
|
+
issues.push('expected 34 variants');
|
|
158
|
+
const ids = new Set();
|
|
159
|
+
const formats = new Set();
|
|
160
|
+
for (const entry of MICROPDF417_VARIANTS) {
|
|
161
|
+
if (ids.has(entry.id))
|
|
162
|
+
issues.push(`duplicate variant ${entry.id}`);
|
|
163
|
+
ids.add(entry.id);
|
|
164
|
+
const format = `${entry.columns}x${entry.rows}`;
|
|
165
|
+
if (formats.has(format))
|
|
166
|
+
issues.push(`duplicate format ${format}`);
|
|
167
|
+
formats.add(format);
|
|
168
|
+
if (entry.totalCodewords !== entry.columns * entry.rows)
|
|
169
|
+
issues.push(`${format}: total codeword geometry mismatch`);
|
|
170
|
+
if (entry.dataCodewords + entry.eccCodewords !== entry.totalCodewords)
|
|
171
|
+
issues.push(`${format}: data/ECC capacity mismatch`);
|
|
172
|
+
if (entry.eccCodewords < 7 || entry.eccCodewords > 50)
|
|
173
|
+
issues.push(`${format}: invalid ECC length`);
|
|
174
|
+
if (entry.rapStart < 1 || entry.rapStart > 52 || entry.rapRotation < 0 || entry.rapRotation > 51)
|
|
175
|
+
issues.push(`${format}: invalid RAP assignment`);
|
|
176
|
+
for (let row = 0; row < entry.rows; row++) {
|
|
177
|
+
const address = microPdf417RowAddress(entry, row);
|
|
178
|
+
if (address.cluster !== ((address.left - 1) % 3) * 3)
|
|
179
|
+
issues.push(`${format}: cluster mismatch at row ${row}`);
|
|
180
|
+
if ((entry.columns < 3) !== (address.center === null))
|
|
181
|
+
issues.push(`${format}: center RAP layout mismatch`);
|
|
182
|
+
}
|
|
173
183
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
184
|
+
for (const [kind, runs] of [['side', SIDE_RAP_RUNS], ['center', CENTER_RAP_RUNS]]) {
|
|
185
|
+
if (runs.length !== 52)
|
|
186
|
+
issues.push(`${kind}: expected 52 RAPs`);
|
|
187
|
+
if (new Set(runs).size !== runs.length)
|
|
188
|
+
issues.push(`${kind}: duplicate RAP`);
|
|
189
|
+
for (let i = 0; i < runs.length; i++) {
|
|
190
|
+
if (!validRuns(runs[i]))
|
|
191
|
+
issues.push(`${kind}: invalid RAP ${i + 1}`);
|
|
192
|
+
if (runs.length && !oneEdgeShift(runs[i], runs[(i + 1) % runs.length]))
|
|
193
|
+
issues.push(`${kind}: RAP ${i + 1} is not adjacent to its successor`);
|
|
194
|
+
}
|
|
181
195
|
}
|
|
182
|
-
|
|
183
|
-
return issues;
|
|
196
|
+
return issues;
|
|
184
197
|
}
|