@mega-yfue/eufy-sdk 0.5.0-beta.67 → 0.5.0-beta.68
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.js +3 -0
- package/dist/index.js.map +2 -2
- package/dist/model/types.d.ts +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13564,9 +13564,12 @@ function coerceByType(type, raw, name, logger = noopLogger) {
|
|
|
13564
13564
|
return String(raw);
|
|
13565
13565
|
}
|
|
13566
13566
|
}
|
|
13567
|
+
var BOOL_WIRE = /* @__PURE__ */ new Set(["0", "1", "true", "false"]);
|
|
13567
13568
|
function coerce(spec, raw, invert = false, logger = noopLogger) {
|
|
13568
13569
|
if (spec.decode)
|
|
13569
13570
|
return spec.decode(raw);
|
|
13571
|
+
if (spec.raw && spec.type === "bool" && typeof raw === "string" && !BOOL_WIRE.has(raw))
|
|
13572
|
+
return raw;
|
|
13570
13573
|
const v = coerceByType(spec.type, raw, spec.name, spec.raw ? noopLogger : logger);
|
|
13571
13574
|
return spec.type === "bool" && invert ? !v : v;
|
|
13572
13575
|
}
|