GithubHelp home page GithubHelp logo

is.js's Issues

Incorrect result of deepEqual for dates

Try

is.deepEqual(new Date("2012-12-12T00:30:00.000Z"), new Date("2021-11-11T13:12:00.000Z"))

Expected

false because dates are different (timestamps are 1355272200000 and 1636636320000)

Actual

true

"is" version: 1.0.2
node: 6.2.0

Consider adding isBitwiseSafeInteger OR is.i32 & is.u32 ?

There are operations (mostly bit-wise), which convert number to signed (and sometimes unsigned) 32-bit integer.

  • Math.imul(1e15, 1e16) === -2147483648
  • 1 << 31 === -2147483648
  • 1e11 & -1 === 1215752192
  • 1e10 ^ 3e10 === -1473755136

but there is also unsigned right shift, which converts to 32-bit unsigned int: -1 >>> 0 === 4294967295.

This is not needed very often, but might be useful.

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.