diff --git a/package.json b/package.json index acf247c05ee4cc32070b15aff9be93c11784c6e5..0fff63c1215030417697df99df3fdd6ba0fefcb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "usp-js", - "version": "0.1.14", + "version": "0.1.15", "description": "Helper library for easy usp communication using mqtt over tcp or ws.", "main": "build/src/index.js", "scripts": { diff --git a/src/commands/set.ts b/src/commands/set.ts index 290d61420fbe2cf50510b3f3650df1d72de628c4..365db836134e880b315d2c547e2d8c3550b784af 100644 --- a/src/commands/set.ts +++ b/src/commands/set.ts @@ -9,8 +9,8 @@ const isObject = (v) => typeof v === "object" && v.required !== undefined && v.value !== undefined; const encode: EncodeFn = ({ value, path: initialPath }) => { - const allowPartial = value && value.allowPartial; const isObj = typeof value === "object"; + const allowPartial = isObj && value.allowPartial !== undefined ? value.allowPartial : false; const attr = initialPath.split(".").pop() || ""; const pairs = isObj ? Object.entries(value as any[]).map(([k, v]) =>