Closed dicksonhk closed 1 year ago
7.0.4
continue, instead of return, should be used for flow control
continue
return
// specification.forEach((spec: ConstructedElementSpecification): void => { // <-- 7.0.3 for (const spec of specification) { // <-- 7.0.4 if ( (i >= elements.length) || (spec.tagClass && spec.tagClass !== elements[i].tagClass) || (spec.construction && spec.construction !== elements[i].construction) || (spec.tagNumber && spec.tagNumber !== elements[i].tagNumber) ) { if (!spec.optional) { throw new errors.ASN1ConstructionError(`Missing required element '${spec.name}'.`); } // return; // <-- this return statement "breaks out" of the loop, ending the whole function early continue; } // ... }
P.S. The validateConstruction function was working just fine up until 7.0.3. I understand it is now deprecated, but I had been using it for validation and decode.
The validateConstruction function was working just fine up until 7.0.3.
validateConstruction
7.0.3
I understand it is now deprecated, but I had been using it for validation and decode.
7.0.4
continue
,instead ofshould be used for flow controlreturn
,