Closed numfin closed 1 year ago
From source code:
Object.entries(config).map(([key, value]) => { if (typeof value === 'string') { fileTypes[key] = { type: value in patterns ? value : 'css' }; } else { const pattern = (value.patterns === undefined || value.patterns.length === 0) ? undefined : value.patterns; if (key in fileTypes) { fileTypes[key] = { type: value.type || fileTypes[key].type, pattern: fileTypes[key].pattern ? pattern ? connect([(fileTypes[key].pattern as RegExp).source, ...pattern]) : fileTypes[key].pattern : pattern ? connect([...pattern]) : undefined }; } else if (value.type && value.type in fileTypes) { fileTypes[key] = { type: value.type || fileTypes[value.type].type, pattern: fileTypes[value.type].pattern ? pattern ? connect([(fileTypes[value.type].pattern as RegExp).source, ...pattern]) : fileTypes[value.type].pattern : pattern ? connect([...pattern]) : undefined }; } } });
Here basically 3 conditions:
includeLanguages.[language]
includeLanguages.[language].type
Why i cannot just use my own pattern without predefined one (omit type field)?
type
From source code:
Here basically 3 conditions:
includeLanguages.[language]
exists in your pattern collection (html,js,css) we use predefined patternincludeLanguages.[language]
exists in your fileType collection - we still using predefined patternincludeLanguages.[language].type
in your fileType collection - we use predefined collection.Why i cannot just use my own pattern without predefined one (omit
type
field)?