sindresorhus / is

Type check values

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is.function and is.class

jsneko opened this issue · comments

When attempting to use is.function and / or is.class I am getting a x is not a function error. I then noticed that those two methods / functions had underscores (_) appended to their name.

Is that to mean that we should no longer be using them? If not, should the README be changed to reflect their name change?

Are you using TypeScript or plain JavaScript? They should only have underscore appended in TS to work around those words being reserved there.

Plain JavaScript.

@jsneko please provide the version you're using and a code snippet if this is still an issue. Source below shows where is.function and is.class should be available to plain JS:

is/source/index.ts

Lines 629 to 650 in d528545

Object.defineProperties(is, {
class: {
value: is.class_
},
function: {
value: is.function_
},
null: {
value: is.null_
}
});
Object.defineProperties(assert, {
class: {
value: assert.class_
},
function: {
value: assert.function_
},
null: {
value: assert.null_
}
});