tuijs-util 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cjs/index.cjs +2 -2
- package/src/esm/lib/util.check.js +2 -2
package/package.json
CHANGED
package/src/cjs/index.cjs
CHANGED
|
@@ -167,7 +167,7 @@ function checkIsList(input) {
|
|
|
167
167
|
*/
|
|
168
168
|
function checkIsArray(input) {
|
|
169
169
|
try {
|
|
170
|
-
return input
|
|
170
|
+
return Array.isArray(input);
|
|
171
171
|
} catch (er) {
|
|
172
172
|
throw new Error(er.message);
|
|
173
173
|
}
|
|
@@ -181,7 +181,7 @@ function checkIsArray(input) {
|
|
|
181
181
|
*/
|
|
182
182
|
function checkIsObject(input) {
|
|
183
183
|
try {
|
|
184
|
-
return input.constructor === Object;
|
|
184
|
+
return input !== null && typeof input === 'object' && input.constructor === Object;
|
|
185
185
|
} catch (er) {
|
|
186
186
|
throw new Error(er.message);
|
|
187
187
|
}
|
|
@@ -119,7 +119,7 @@ export function checkIsList(input) {
|
|
|
119
119
|
*/
|
|
120
120
|
export function checkIsArray(input) {
|
|
121
121
|
try {
|
|
122
|
-
return input
|
|
122
|
+
return Array.isArray(input);
|
|
123
123
|
} catch (er) {
|
|
124
124
|
throw new Error(er.message);
|
|
125
125
|
}
|
|
@@ -133,7 +133,7 @@ export function checkIsArray(input) {
|
|
|
133
133
|
*/
|
|
134
134
|
export function checkIsObject(input) {
|
|
135
135
|
try {
|
|
136
|
-
return input.constructor === Object;
|
|
136
|
+
return input !== null && typeof input === 'object' && input.constructor === Object;
|
|
137
137
|
} catch (er) {
|
|
138
138
|
throw new Error(er.message);
|
|
139
139
|
}
|