@humanwhocodes/config-array
Advanced tools
Comparing version 0.4.0 to 0.5.0
17
api.js
@@ -231,3 +231,4 @@ 'use strict'; | ||
schema: Symbol('schema'), | ||
finalizeConfig: Symbol('finalizeConfig') | ||
finalizeConfig: Symbol('finalizeConfig'), | ||
preprocessConfig: Symbol('preprocessConfig') | ||
}; | ||
@@ -381,3 +382,3 @@ | ||
this.length = 0; | ||
this.push(...normalizedConfigs); | ||
this.push(...normalizedConfigs.map(this[ConfigArraySymbol.preprocessConfig])); | ||
this[ConfigArraySymbol.isNormalized] = true; | ||
@@ -404,2 +405,14 @@ | ||
/** | ||
* Preprocesses a config during the normalization process. This is the | ||
* method to override if you want to convert an array item before it is | ||
* validated for the first time. For example, if you want to replace a | ||
* string with an object, this is the method to override. | ||
* @param {Object} config The config to preprocess. | ||
* @returns {Object} The config to use in place of the argument. | ||
*/ | ||
[ConfigArraySymbol.preprocessConfig](config) { | ||
return config; | ||
} | ||
/** | ||
* Returns the config object for a given file path. | ||
@@ -406,0 +419,0 @@ * @param {string} filePath The complete path of a file to get a config for. |
{ | ||
"name": "@humanwhocodes/config-array", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Glob-based configuration matching.", | ||
@@ -5,0 +5,0 @@ "author": "Nicholas C. Zakas", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34904
382