Skip to content

question: isObjectOf() intended to check prototype properties? #92

@Milly

Description

@Milly

Question

isObjectOf() checks prototype properties. This is intended?

const parent = { a: is.Number };
const child = Object.create(parent);
child.b = is.String;

is.ObjectOf(child)({ a: 0 }); // false
is.ObjectOf(child)({ b: "a" }); // false
is.ObjectOf(child)({ a: 0, b: "a" }); // true

Additional

isStrictOf() does not support this behavior.

is.StrictOf(is.ObjectOf(child))({ a: 0, b: "a" }); // false

Version

v4.0.1 7d8bcbd

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions