Skip to content

Commit b0f08b3

Browse files
refactor: object check
1 parent 43ae683 commit b0f08b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/minify.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ const minify = async (options) => {
2020
minifyOptions
2121
);
2222

23-
if (typeof minifyResult === "object" && "code" in minifyResult) {
23+
if (
24+
Object.prototype.toString.call(minifyResult) === "[object Object]" &&
25+
minifyResult !== null &&
26+
"code" in minifyResult
27+
) {
2428
result.code = minifyResult.code;
2529
result.warnings = result.warnings.concat(minifyResult.warnings || []);
2630
result.errors = result.errors.concat(minifyResult.errors || []);

0 commit comments

Comments
 (0)