Skip to content

Replace Number to Primordials

Update some file to replace Number to the primordial Number. And i just have created a line in "/lib/.eslintrc.yaml".

rules:
  no-restricted-globals:
    - name: Number
      message: "Use `const { Number } = primordials;` instead of the global."

And replace every code :

const {
  ArrayIsArray,
  MathMax,
  ObjectCreate,
  ObjectKeys,
} = primordials;

By

const {
  ArrayIsArray,
  MathMax,
  ObjectCreate,
  ObjectKeys,
  Number,
} = primordials;

in theses files :

  • lib/internal/buffer.js
  • lib/internal/console/constructor.js
  • lib/internal/fs/utils.js
  • lib/internal/http2/util.js
  • lib/internal/repl.js
  • lib/internal/url.js
  • lib/internal/util/inspect.js
  • lib/net.js

This task was given to me by @targos thanks

I hope this PR will help you :x

Merge request reports

Loading