Skip to content

Commit 0bce8fe

Browse files
committed
Merge branch 'dev'
2 parents 90a4381 + 2e15c28 commit 0bce8fe

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

isType.mjs.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,12 @@ function is(value){
147147
for(const propName in new TypeTest()){
148148
// For each descriptor name:
149149

150-
// Add an enumerable property to the `is` function.
150+
// Add a getter to the `is` function that returns the name of the descriptor.
151+
// This allows you to do `is(val).all(is.number, is.object)` instead of `is(val).all('number', 'object')`.
151152
Object.defineProperty(is, propName, {
152-
value: propName,
153+
get: function(){ return propName; },
153154
enumerable: true,
155+
configurable: true,
154156
});
155157
}
156158

0 commit comments

Comments
 (0)