@camox/api-contract 0.59.0 → 0.61.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.d.ts CHANGED
@@ -29,7 +29,7 @@ export declare function templateFields(template: string): string[];
29
29
  * The fields a record template names that aren't String fields of the content schema's
30
30
  * properties: templates read fields as plain text, so they name no other field.
31
31
  */
32
- export declare function nonStringTemplateFields(template: string, properties: Readonly<Record<string, object | undefined>>): string[];
32
+ export declare function nonStringTemplateFields(template: string, properties: Readonly<Record<string, unknown>>): string[];
33
33
  /** How a record names itself: its title, and its description, or null when it has none. */
34
34
  export type RecordText = {
35
35
  title: string;
@@ -56,7 +56,7 @@ export type SystemOrderKey = "createdAt" | "publishedAt";
56
56
  export declare const SYSTEM_ORDER_KEYS: readonly SystemOrderKey[];
57
57
  export declare function isSystemOrderKey(key: string): key is SystemOrderKey;
58
58
  /** Whether a reference list field is query-backed: code defines its records, nothing is stored. */
59
- export declare function isQueryBacked(field: object | null | undefined): boolean;
59
+ export declare function isQueryBacked(field: unknown): boolean;
60
60
  /**
61
61
  * Why a query is invalid, if it is. `fieldTypeOf` gives the collection field type an ordering
62
62
  * key names; keys must name a `String` field or system metadata.
package/dist/index.js CHANGED
@@ -60,7 +60,7 @@ function templateFields(template) {
60
60
  * properties: templates read fields as plain text, so they name no other field.
61
61
  */
62
62
  function nonStringTemplateFields(template, properties) {
63
- const isString = (field) => field !== void 0 && "fieldType" in field && field.fieldType === "String";
63
+ const isString = (field) => typeof field === "object" && field !== null && "fieldType" in field && field.fieldType === "String";
64
64
  return templateFields(template).filter((name) => !isString(properties[name]));
65
65
  }
66
66
  /**
@@ -89,7 +89,7 @@ function isSystemOrderKey(key) {
89
89
  }
90
90
  /** Whether a reference list field is query-backed: code defines its records, nothing is stored. */
91
91
  function isQueryBacked(field) {
92
- return !!field && field.query !== void 0;
92
+ return typeof field === "object" && field !== null && "query" in field && field.query !== void 0;
93
93
  }
94
94
  /**
95
95
  * Why a query is invalid, if it is. `fieldTypeOf` gives the collection field type an ordering