From ec770b4e1b7054c23ce1a69573ab6b4fc0e203b5 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Mon, 13 Sep 2021 10:04:11 -0700 Subject: [PATCH] Fix redundant SPV triggered for unknown types Fix issue where declarations against parameters with non-standard value type trigger an SPV call when the value being declared is a boolean or a number. --- lib/device.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/device.ts b/lib/device.ts index 96ca975..e0f79d7 100644 --- a/lib/device.ts +++ b/lib/device.ts @@ -54,13 +54,6 @@ export function sanitizeParameterValue( else parameterValue[0] = b; } break; - case "xsd:string": - case "xsd:base64": - case "xsd:hexBinary": - if (typeof parameterValue[0] !== "string") - parameterValue[0] = "" + parameterValue[0]; - - break; case "xsd:int": case "xsd:unsignedInt": if (typeof parameterValue[0] !== "number") { @@ -83,7 +76,7 @@ export function sanitizeParameterValue( } break; default: - parameterValue[0] = JSON.parse(JSON.stringify(parameterValue[0])); + parameterValue[0] = "" + parameterValue[0]; break; } }