Skip to content

Supposed error on line 435 of the lib / model.js file #167

Description

@emanuelmoraes-dev

Hi, I know the project is probably disabled, but I was analyzing its source code and found a supposed error in implementing the "contains" method at line 435 of the lib / model.js file

function contains (arr, key) {
if (arr.indexOf (key)> -1) return true;
for (var obj in arr) {
if (obj.method === key) {
return true;
}
}
return false;
};

on the line:

"for (var obj in arr)"

the "in" operator will not traverse the values contained in the Array. The variable "obj" will only contain the key name contained in the object and not its value. In the case of an Array the key of the object will be its index.

I would just like to pass on my observation so that someone can verify the truth of my suspicion, because I think this work is very good and it is a pity that it is stopped.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions