Code Monkey home page Code Monkey logo

Comments (4)

serious-sammy avatar serious-sammy commented on June 2, 2024 1

Replacing with the following seems to help:

.trim()
// Replace one or more consecutive whitespace characters (spaces, tabs,
// or line breaks) with a single space.
.replace(/\s+/g, ' ')
// Now encode numbers to little endian hex. Note that numbers are not
// enclosed in <>, since <> represents hex code already encoded.
// The regex below will match one or more digits within a string,
// except if the sequence is surrounded by "<" and ">"
.replace(/(<\d+>)|\b\d+\b/g, (match) => 
  match.startsWith('<') ? match : numberEncodeAsm(Number(match))
)
// we don't have numbers anymore, now it's safe to remove < and > since we
// know that every remaining is either an op_code or a hex encoded number
.replace(/[<>]/g, '');

from descriptors.

landabaso avatar landabaso commented on June 2, 2024

Thanks @serious-sammy . This looks good to me. Do you want to submit a PR with the proposal? I can do it for you if you don't want to (or have the time). Let me know.

from descriptors.

serious-sammy avatar serious-sammy commented on June 2, 2024

I'd appreciate if you would do it 🙏

from descriptors.

landabaso avatar landabaso commented on June 2, 2024

Thanks for the report @serious-sammy . I've updated npm with a new version with the change.

from descriptors.

Related Issues (20)

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.