@wix/form-public 0.16.0 → 0.18.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.
package/dist/index.js CHANGED
@@ -29956,19 +29956,19 @@ var FIELD_TYPE_MAP = {
29956
29956
  RICH_TEXT: "TEXT",
29957
29957
  SUBMIT_BUTTON: "SUBMIT_BUTTON"
29958
29958
  };
29959
- function convertKeysToCamelCase(obj) {
29959
+ function normalizeSchema(obj) {
29960
29960
  if (Array.isArray(obj)) {
29961
- return obj.map(convertKeysToCamelCase);
29961
+ return obj.map(normalizeSchema);
29962
29962
  }
29963
29963
  if (obj !== null && typeof obj === "object") {
29964
- const converted = mapKeys(
29965
- obj,
29966
- (_23, key) => camelCase(key)
29967
- );
29964
+ const converted = mapKeys(obj, (_23, key) => {
29965
+ const keyWithoutUnderscore = key.startsWith("_") ? key.substring(1) : key;
29966
+ return camelCase(keyWithoutUnderscore);
29967
+ });
29968
29968
  return Object.fromEntries(
29969
29969
  Object.entries(converted).map(([key, value]) => [
29970
29970
  key,
29971
- convertKeysToCamelCase(value)
29971
+ normalizeSchema(value)
29972
29972
  ])
29973
29973
  );
29974
29974
  }
@@ -29994,7 +29994,7 @@ var Form2 = ({
29994
29994
  errors,
29995
29995
  onValidate
29996
29996
  }) => {
29997
- const form = convertKeysToCamelCase(unformattedForm);
29997
+ const form = normalizeSchema(unformattedForm);
29998
29998
  const siteConfig = {
29999
29999
  locale: {
30000
30000
  languageCode: "en"