@configdirector/react-native-sdk 0.5.0 → 0.6.0

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.
@@ -1091,11 +1091,12 @@ var DefaultConfigDirectorClient = class {
1091
1091
  const CONFIG_VALUE_MAX_LENGTH = 500;
1092
1092
  const sanitizeValue = (value, type) => {
1093
1093
  if (type === "json" || type == null && typeof value === "object") try {
1094
- return djb2Hash(JSON.stringify(value));
1094
+ return { digest: djb2Hash(JSON.stringify(value)) };
1095
1095
  } catch {
1096
- return value.toString().slice(0, CONFIG_VALUE_MAX_LENGTH);
1096
+ return { digest: value.toString() };
1097
1097
  }
1098
- return value.toString().slice(0, CONFIG_VALUE_MAX_LENGTH);
1098
+ if (value.toString().length > CONFIG_VALUE_MAX_LENGTH) return { digest: djb2Hash(value.toString()) };
1099
+ else return { value: value.toString() };
1099
1100
  };
1100
1101
  const djb2Hash = (data) => {
1101
1102
  return djb2(new TextEncoder().encode(data)).toString(16).padStart(8, "0");
@@ -1519,7 +1520,7 @@ const createClient = (clientSdkKey, clientOptions) => {
1519
1520
  const logger = (_clientOptions$logger = clientOptions === null || clientOptions === void 0 ? void 0 : clientOptions.logger) !== null && _clientOptions$logger !== void 0 ? _clientOptions$logger : createConsoleLogger("warn");
1520
1521
  return new DefaultConfigDirectorClient(new ReactNativeTelemetryClient(clientSdkKey, (clientOptions === null || clientOptions === void 0 || (_clientOptions$connec = clientOptions.connection) === null || _clientOptions$connec === void 0 ? void 0 : _clientOptions$connec.url) ? urlFactory(clientOptions.connection.url) : CLIENT_BASE_URL, logger, urlFactory), clientSdkKey, {
1521
1522
  sdkName: "react-native-sdk",
1522
- sdkVersion: "0.5.0"
1523
+ sdkVersion: "0.6.0"
1523
1524
  }, {
1524
1525
  ...clientOptions,
1525
1526
  logger
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configdirector/react-native-sdk",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "React Native client SDK for ConfigDirector. ConfigDirector is a remote configuration and feature flag service.",
5
5
  "license": "MIT",
6
6
  "author": "ConfigDirector",