@azure/data-tables 12.1.2-alpha.20210902.1 → 12.1.2-alpha.20210930.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/CHANGELOG.md CHANGED
@@ -1,14 +1,10 @@
1
1
  # Release History
2
2
 
3
- ## 12.1.2 (Unreleased)
4
-
5
- ### Features Added
6
-
7
- ### Breaking Changes
3
+ ## 12.1.2 (2021-09-07)
8
4
 
9
5
  ### Bugs Fixed
10
6
 
11
- ### Other Changes
7
+ - Fix `disableTypeConversion` to also apply for booleans and convert value to string when there is no type metadata. [#17385](https://github.com/Azure/azure-sdk-for-js/pull/17385)
12
8
 
13
9
  ## 12.1.1 (2021-08-10)
14
10
 
package/dist/index.js CHANGED
@@ -4189,8 +4189,8 @@ function deserialize(obj, disableTypeConversion = false) {
4189
4189
  const type = obj[`${key}@odata.type`];
4190
4190
  typedValue = getTypedObject(value, type, disableTypeConversion);
4191
4191
  }
4192
- else if (disableTypeConversion && ["number", "string"].includes(typeof value)) {
4193
- // The service, doesn't return type metadata for number or strings
4192
+ else if (disableTypeConversion && ["number", "string", "boolean"].includes(typeof value)) {
4193
+ // The service, doesn't return type metadata for number, strings or booleans
4194
4194
  // if automatic type conversion is disabled we'll infer the EDM object
4195
4195
  typedValue = inferTypedObject(key, value);
4196
4196
  }
@@ -4204,17 +4204,27 @@ function inferTypedObject(propertyName, value) {
4204
4204
  if (propertyCaseMap.has(propertyName)) {
4205
4205
  return value;
4206
4206
  }
4207
- return typeof value === "string" ? { value, type: "String" } : getTypedNumber(value);
4207
+ switch (typeof value) {
4208
+ case "boolean":
4209
+ return { value: String(value), type: "Boolean" };
4210
+ case "number":
4211
+ return getTypedNumber(value);
4212
+ case "string":
4213
+ return { value, type: "String" };
4214
+ default:
4215
+ return value;
4216
+ }
4208
4217
  }
4209
4218
  /**
4210
4219
  * Returns the number when typeConversion is enabled or the EDM object with the correct number format Double or Int32 if disabled
4211
4220
  */
4212
4221
  function getTypedNumber(value) {
4222
+ const valueStr = String(value);
4213
4223
  if (Number.isInteger(value)) {
4214
- return { value, type: "Int32" };
4224
+ return { value: valueStr, type: "Int32" };
4215
4225
  }
4216
4226
  else {
4217
- return { value, type: "Double" };
4227
+ return { value: valueStr, type: "Double" };
4218
4228
  }
4219
4229
  }
4220
4230
  function deserializeObjectsArray(objArray, disableTypeConversion) {