You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* A collection of boolean properties indicating the typeof the given value.
60
+
* A collection of boolean properties set according to the type, and sometimes value, of the argument.
61
61
* @class TypeTest
62
62
*/
63
63
classTypeTest{
@@ -115,6 +115,8 @@ class TypeTest {
115
115
this.defined=!this.undefined;
116
116
this.nullish=this.undefined||this.null;
117
117
118
+
this.false=value===false;
119
+
this.true=value===true;
118
120
this.falsy=!value;
119
121
this.truthy=!this.falsy;
120
122
@@ -133,23 +135,35 @@ class TypeTest {
133
135
}
134
136
}
135
137
138
+
classIsextendsTypeTest{
139
+
140
+
constructor(value){
141
+
142
+
super(value);
143
+
144
+
this.type=this.toString();
145
+
}
146
+
147
+
all(...propNames){
148
+
returnpropNames.every(propName=>this[propName]);
149
+
}
150
+
151
+
any(...propNames){
152
+
returnpropNames.some(propName=>this[propName]);
153
+
}
154
+
}
155
+
136
156
/**
137
157
* Determine the type of a value. The returned object includes boolean properties to quickly test against specific types or for specific states (e.g., 'empty').
138
158
* @param {*} value - The value to be tested.
139
-
* @returns {TypeTest} - Plus methods `all` and `any`.
0 commit comments