Giter Site home page Giter Site logo

code-128-encoder's Issues

Uncaught TypeError when used in 'use strict' mode

Very nice app! It works really well when I reference the file as instructed.

I thought it would be nice to use it as a module but ran into issues when doing so. I think it's because ES6 javascript modules enforce strict mode.

When imported with import './code-128-encoder.min.js'; I get this error code-128-encoder.min.js:3 Uncaught TypeError: Cannot use 'in' operator to search for 'String' in undefined at Object.$jscomp.polyfill.

Problems that code number can not be generated properly

Hi,

I found your Code 128 font and encoder.
I generated a barcode with Code C for a code composed only of numerical values, but it did not work properly.
The cause is ascii [0] when multiple ascii are allocated in Code 128 Generator.codes
It is necessary to encode with ascii [1] with error.

In your library, you can change the getASCIIFromCode () method with options.mapping, but this does not work properly. If only one ascii is allocated, undefined is returned. You understand?

getASCIIFromCodeC () is fixedly called in optimize (), and ascii [0] is permanently specified in it. This does not call ascii [1], is it?

Therefore, the font you defined is useful, but the library of this project could not be used.

Wrong checksum glyph

Encoding 1hnL9wrba2JYA3xxYGGcGq results in Ì1hnL9wrba2JYA3xxYGGcGq Î, when it ought to be Ì1hnL9wrba2JYA3xxYGGcGqÂÎ.

Repro:

describe('Code128Encoder', () => {
    const code128Encoder = new Code128Encoder()

    it('encodes a problematic ID', () => {
        const encoded = code128Encoder.encode('1hnL9wrba2JYA3xxYGGcGq', { output: 'ascii' as any })
        expect(encoded).toBe('Ì1hnL9wrba2JYA3xxYGGcGqÂÎ')
    })
})

Changelog?

I didn't find a change log and also noticed their weren't tags/releases for later versions that are published to NPM.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.