Neaten extract.DEFAULT resolution (#5778)

This commit is contained in:
Brad Cornes 2021-10-13 19:58:58 +01:00 • committed by GitHub
parent 92df04d0c3
commit 84a6c5d096
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -170,7 +170,7 @@ export function normalizeConfig(config) {
let extractors = {}
extractors.DEFAULT = (() => {
let defaultExtractor = (() => {
if (config.purge?.options?.defaultExtractor) {
return config.purge.options.defaultExtractor
}
@ -182,6 +182,10 @@ export function normalizeConfig(config) {
return undefined
})()
if (defaultExtractor !== undefined) {
extractors.DEFAULT = defaultExtractor
}
// Functions
if (typeof extract === 'function') {
extractors.DEFAULT = extract