Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

_.isInteger([1]) returns true #252

Open

Description

There is an issue with the function predictates isInteger() and isFloat() where a number is passed in an array of length 1.

eg:

_.isInteger([1])
// true
_.isFloat([1.1])
// true
// both should be false.

The fix for this should be pretty easy by just adding if (i === undefined || i === null || i instanceof Array) return false to the top of isNumeric.

This simple gate will block undefined, null and array.

Suggestions?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /