fix(node-engine): glob null drilldown error, typeof null is object (#417)

This commit is contained in:
Yiwei Mao 2025-06-27 11:54:25 +08:00 committed by GitHub
parent 629a9e564f
commit bf69e6cb89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -146,7 +146,7 @@ export namespace Glob {
let curPaths: string[] = []; let curPaths: string[] = [];
let curValue = obj; let curValue = obj;
while (curKey) { while (curKey) {
let isObject = typeof curValue === 'object'; let isObject = typeof curValue === 'object' && curValue !== null;
if (!isObject) return []; if (!isObject) return [];
// 匹配 * // 匹配 *
if (curKey === ALL) { if (curKey === ALL) {