html-validate 8.19.1 → 8.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/core.js CHANGED
@@ -5053,11 +5053,7 @@ class AttributeAllowedValues extends Rule {
5053
5053
  }
5054
5054
  }
5055
5055
  getLocation(attr) {
5056
- if (attr.value !== null) {
5057
- return attr.valueLocation;
5058
- } else {
5059
- return attr.keyLocation;
5060
- }
5056
+ return attr.valueLocation ?? attr.keyLocation;
5061
5057
  }
5062
5058
  }
5063
5059
 
@@ -12323,6 +12319,18 @@ class StaticConfigLoader extends ConfigLoader {
12323
12319
  super(defaultResolvers, config);
12324
12320
  }
12325
12321
  }
12322
+ /**
12323
+ * Set a new configuration for this loader.
12324
+ *
12325
+ * @public
12326
+ * @since 8.20.0
12327
+ * @param config - New configuration to use.
12328
+ */
12329
+ /* istanbul ignore next -- not testing setters/getters */
12330
+ setConfig(config) {
12331
+ const defaults = Config.empty();
12332
+ this.globalConfig = defaults.merge(this.resolvers, this.loadFromObject(config));
12333
+ }
12326
12334
  getConfigFor(_handle, configOverride) {
12327
12335
  const override = this.loadFromObject(configOverride ?? {});
12328
12336
  if (override.isRootFound()) {
@@ -12712,6 +12720,28 @@ class HtmlValidate {
12712
12720
  getConfigForSync(filename, configOverride) {
12713
12721
  return this.configLoader.getConfigFor(filename, configOverride);
12714
12722
  }
12723
+ /**
12724
+ * Get current configuration loader.
12725
+ *
12726
+ * @public
12727
+ * @since %version%
12728
+ * @returns Current configuration loader.
12729
+ */
12730
+ /* istanbul ignore next -- not testing setters/getters */
12731
+ getConfigLoader() {
12732
+ return this.configLoader;
12733
+ }
12734
+ /**
12735
+ * Set configuration loader.
12736
+ *
12737
+ * @public
12738
+ * @since %version%
12739
+ * @param loader - New configuration loader to use.
12740
+ */
12741
+ /* istanbul ignore next -- not testing setters/getters */
12742
+ setConfigLoader(loader) {
12743
+ this.configLoader = loader;
12744
+ }
12715
12745
  /**
12716
12746
  * Flush configuration cache. Clears full cache unless a filename is given.
12717
12747
  *
@@ -12726,7 +12756,7 @@ class HtmlValidate {
12726
12756
  }
12727
12757
 
12728
12758
  const name = "html-validate";
12729
- const version = "8.19.1";
12759
+ const version = "8.20.1";
12730
12760
  const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
12731
12761
 
12732
12762
  function definePlugin(plugin) {