evrythng / digital-link.js

GS1 Digital Link SDK for working with Digital Links as objects, including validation.
Apache License 2.0
3 stars 1 forks source link

Issue on table optimizations for compression #26

Closed mcarezzato closed 10 months ago

mcarezzato commented 10 months ago

Hi,

In the Optimizations table, at the code 1A, we have the sequence ["01","10","21","17"]. But, when I use digital-link.js, the Sequence of GS1 Application Identifiers is ["01","10","17","21"].

This happens because this line of the library: tableOptReverse[JSON.stringify(tableOpt[tableOptKeys[i]].sort())]=tableOptKeys[i];

The function sort() is changing the original array and sort the application identifiers in natural order.

But this order is different from the GS1 standards, and generate a compressed URI with a wrong sequence of identifiers.

mcarezzato commented 10 months ago

I will post this issue at the https://github.com/gs1/GS1DigitalLinkToolkit.js repository. The bug is in the library GS1DigitalLinkToolkit.js used by digital-link.js.