Giter Club home page Giter Club logo

gs1-128-encoder's People

Contributors

fogine avatar mugeso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gs1-128-encoder's Issues

npm package cannot be imported in TypeScript projects

Hello, the npm package includes TypeScript code mixed with the js library. Can you republish to exclude the TypeScript code?

As is, it results in errors when importing:

node_modules/gs1-128-encoder/lib/code128.ts:167:30 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
    Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.
  Overload 2 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
    Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.

167         codes = codes.concat(context.startCode, context.consume(context));
                                 ~~~~~~~~~~~~~~~~~


node_modules/gs1-128-encoder/lib/code128.ts:244:11 - error TS2488: Type 'RegExpMatchArray | null' must have a '[Symbol.iterator]()' method that returns an iterator.

244     const [, target, rest] = context.rest.match(/^((?:\d{2}|Ï)+)(.*)$/);
              ~~~~~~~~~~~~~~~~

node_modules/gs1-128-encoder/lib/code128.ts:255:12 - error TS2531: Object is possibly 'null'.

255     return target.match(/\d{2}|Ï/g).map(mapCToCode);
               ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/gs1-128-encoder/lib/code128.ts:275:29 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
    Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.
  Overload 2 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
    Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.

275         return codes.concat(checksum, STOP);

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.