thunderous 2.3.10 → 2.3.12

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/index.cjs CHANGED
@@ -854,8 +854,8 @@ You must set an initial value before calling a property signal's getter.
854
854
  busy = true;
855
855
  const value = getter();
856
856
  if (value === void 0) return;
857
- if (value !== null) {
858
- this.setAttribute(attrName, String(value));
857
+ if (value !== null && value !== false) {
858
+ this.setAttribute(attrName, String(value === true ? "" : value));
859
859
  } else {
860
860
  this.removeAttribute(attrName);
861
861
  }
@@ -887,8 +887,14 @@ You must set an initial value before calling a property signal's getter.
887
887
  const propName = prop.prop;
888
888
  this.#attributesBusy = true;
889
889
  const [, propSetter] = this.#getPropSignal(propName);
890
- const propValue = newValue === null ? null : prop.coerce(newValue);
891
- propSetter(propValue);
890
+ if (prop.coerce === Boolean) {
891
+ const bool = newValue !== null && newValue !== "false";
892
+ const propValue = newValue === null ? null : bool;
893
+ propSetter(propValue);
894
+ } else {
895
+ const propValue = newValue === null ? null : prop.coerce(newValue);
896
+ propSetter(propValue);
897
+ }
892
898
  this.#attributesBusy = false;
893
899
  }
894
900
  for (const fn of this.#attributeChangedFns) {
package/dist/index.js CHANGED
@@ -819,8 +819,8 @@ You must set an initial value before calling a property signal's getter.
819
819
  busy = true;
820
820
  const value = getter();
821
821
  if (value === void 0) return;
822
- if (value !== null) {
823
- this.setAttribute(attrName, String(value));
822
+ if (value !== null && value !== false) {
823
+ this.setAttribute(attrName, String(value === true ? "" : value));
824
824
  } else {
825
825
  this.removeAttribute(attrName);
826
826
  }
@@ -852,8 +852,14 @@ You must set an initial value before calling a property signal's getter.
852
852
  const propName = prop.prop;
853
853
  this.#attributesBusy = true;
854
854
  const [, propSetter] = this.#getPropSignal(propName);
855
- const propValue = newValue === null ? null : prop.coerce(newValue);
856
- propSetter(propValue);
855
+ if (prop.coerce === Boolean) {
856
+ const bool = newValue !== null && newValue !== "false";
857
+ const propValue = newValue === null ? null : bool;
858
+ propSetter(propValue);
859
+ } else {
860
+ const propValue = newValue === null ? null : prop.coerce(newValue);
861
+ propSetter(propValue);
862
+ }
857
863
  this.#attributesBusy = false;
858
864
  }
859
865
  for (const fn of this.#attributeChangedFns) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thunderous",
3
- "version": "2.3.10",
3
+ "version": "2.3.12",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",