@sprucelabs/schema 30.0.577 → 30.0.578

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.
@@ -117,7 +117,7 @@ export interface SchemaNormalizeOptions<S extends Schema, CreateEntityInstances
117
117
  [K in SchemaFieldNames<S>]?: S['fields'][K] extends FieldDefinition ? Partial<FieldDefinitionMap[S['fields'][K]['type']]['options']> : never;
118
118
  };
119
119
  shouldIncludeNullAndUndefinedFields?: ShouldIncludeNullAndUndefinedFields;
120
- shouldRetainDotSyntaxKeys?: boolean;
120
+ shouldRetainDotNotationKeys?: boolean;
121
121
  }
122
122
  export interface DynamicSchemaNormalizeOptions<CreateEntityInstances extends boolean> extends SchemaNormalizeFieldValueOptions<CreateEntityInstances> {
123
123
  }
@@ -2,7 +2,7 @@ import get from 'just-safe-get';
2
2
  import EntityFactory from '../factories/SchemaEntityFactory.js';
3
3
  export default function normalizeSchemaValues(schema, values, options) {
4
4
  const instance = EntityFactory.Entity(schema, expandValues(values));
5
- const { shouldCreateEntityInstances = false, fields, shouldRetainDotSyntaxKeys, ...rest } = options || {};
5
+ const { shouldCreateEntityInstances = false, fields, shouldRetainDotNotationKeys, ...rest } = options || {};
6
6
  let areAnyKeysDotted = false;
7
7
  let normalizedFields = fields === null || fields === void 0 ? void 0 : fields.map((f) => {
8
8
  const hasDotKey = f.includes('.');
@@ -15,8 +15,8 @@ export default function normalizeSchemaValues(schema, values, options) {
15
15
  ...rest,
16
16
  };
17
17
  let normalized = instance.getValues(normalizedOptions);
18
- const shouldConvertToDotSyntax = areAnyKeysDotted || shouldRetainDotSyntaxKeys;
19
- if (shouldRetainDotSyntaxKeys || shouldConvertToDotSyntax) {
18
+ const shouldConvertToDotNotation = areAnyKeysDotted || shouldRetainDotNotationKeys;
19
+ if (shouldRetainDotNotationKeys || shouldConvertToDotNotation) {
20
20
  const normalizedWithKeys = {};
21
21
  const keys = fields || Object.keys(values);
22
22
  for (const key of keys) {
@@ -24,7 +24,7 @@ export default function normalizeSchemaValues(schema, values, options) {
24
24
  }
25
25
  normalized = normalizedWithKeys;
26
26
  }
27
- if (!shouldRetainDotSyntaxKeys && shouldConvertToDotSyntax) {
27
+ if (!shouldRetainDotNotationKeys && shouldConvertToDotNotation) {
28
28
  normalized = expandValues(normalized);
29
29
  }
30
30
  return normalized;
@@ -117,7 +117,7 @@ export interface SchemaNormalizeOptions<S extends Schema, CreateEntityInstances
117
117
  [K in SchemaFieldNames<S>]?: S['fields'][K] extends FieldDefinition ? Partial<FieldDefinitionMap[S['fields'][K]['type']]['options']> : never;
118
118
  };
119
119
  shouldIncludeNullAndUndefinedFields?: ShouldIncludeNullAndUndefinedFields;
120
- shouldRetainDotSyntaxKeys?: boolean;
120
+ shouldRetainDotNotationKeys?: boolean;
121
121
  }
122
122
  export interface DynamicSchemaNormalizeOptions<CreateEntityInstances extends boolean> extends SchemaNormalizeFieldValueOptions<CreateEntityInstances> {
123
123
  }
@@ -8,7 +8,7 @@ const just_safe_get_1 = __importDefault(require("just-safe-get"));
8
8
  const SchemaEntityFactory_1 = __importDefault(require("../factories/SchemaEntityFactory"));
9
9
  function normalizeSchemaValues(schema, values, options) {
10
10
  const instance = SchemaEntityFactory_1.default.Entity(schema, expandValues(values));
11
- const { shouldCreateEntityInstances = false, fields, shouldRetainDotSyntaxKeys, ...rest } = options || {};
11
+ const { shouldCreateEntityInstances = false, fields, shouldRetainDotNotationKeys, ...rest } = options || {};
12
12
  let areAnyKeysDotted = false;
13
13
  let normalizedFields = fields?.map((f) => {
14
14
  const hasDotKey = f.includes('.');
@@ -21,8 +21,8 @@ function normalizeSchemaValues(schema, values, options) {
21
21
  ...rest,
22
22
  };
23
23
  let normalized = instance.getValues(normalizedOptions);
24
- const shouldConvertToDotSyntax = areAnyKeysDotted || shouldRetainDotSyntaxKeys;
25
- if (shouldRetainDotSyntaxKeys || shouldConvertToDotSyntax) {
24
+ const shouldConvertToDotNotation = areAnyKeysDotted || shouldRetainDotNotationKeys;
25
+ if (shouldRetainDotNotationKeys || shouldConvertToDotNotation) {
26
26
  const normalizedWithKeys = {};
27
27
  const keys = fields || Object.keys(values);
28
28
  for (const key of keys) {
@@ -30,7 +30,7 @@ function normalizeSchemaValues(schema, values, options) {
30
30
  }
31
31
  normalized = normalizedWithKeys;
32
32
  }
33
- if (!shouldRetainDotSyntaxKeys && shouldConvertToDotSyntax) {
33
+ if (!shouldRetainDotNotationKeys && shouldConvertToDotNotation) {
34
34
  normalized = expandValues(normalized);
35
35
  }
36
36
  return normalized;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "!build/__tests__",
9
9
  "esm"
10
10
  ],
11
- "version": "30.0.577",
11
+ "version": "30.0.578",
12
12
  "main": "./build/index.js",
13
13
  "types": "./build/index.d.ts",
14
14
  "module": "./build/esm/index.js",