We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 90a4381 + 2e15c28 commit 0bce8feCopy full SHA for 0bce8fe
1 file changed
isType.mjs.js
@@ -147,10 +147,12 @@ function is(value){
147
for(const propName in new TypeTest()){
148
// For each descriptor name:
149
150
- // Add an enumerable property to the `is` function.
+ // 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')`.
152
Object.defineProperty(is, propName, {
- value: propName,
153
+ get: function(){ return propName; },
154
enumerable: true,
155
+ configurable: true,
156
});
157
}
158
0 commit comments