json-fs-query 1.0.4 → 1.0.6

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.
Files changed (139) hide show
  1. package/browser/jsonFsQuery.js +10158 -27750
  2. package/browser/jsonFsQuery.min.js +1 -1
  3. package/dist/data/introspect/create.d.ts +10 -10
  4. package/dist/data/introspect/create.js +47 -47
  5. package/dist/data/introspect/definitions/field.d.ts +27 -27
  6. package/dist/data/introspect/definitions/field.js +36 -36
  7. package/dist/data/introspect/definitions/key.d.ts +25 -25
  8. package/dist/data/introspect/definitions/key.js +53 -53
  9. package/dist/data/introspect/definitions/keyReference.d.ts +17 -17
  10. package/dist/data/introspect/definitions/keyReference.js +20 -20
  11. package/dist/data/introspect/definitions/record.d.ts +25 -25
  12. package/dist/data/introspect/definitions/record.js +32 -32
  13. package/dist/data/introspect/describe.js +15 -15
  14. package/dist/data/introspect/drop.js +37 -37
  15. package/dist/data/introspect/index.d.ts +7 -7
  16. package/dist/data/introspect/index.js +30 -30
  17. package/dist/data/introspect/policies/foreignKeyExists.d.ts +8 -8
  18. package/dist/data/introspect/policies/foreignKeyExists.js +25 -25
  19. package/dist/data/introspect/policies/hasDependents.d.ts +12 -12
  20. package/dist/data/introspect/policies/hasDependents.js +52 -52
  21. package/dist/data/introspect/policies/keyGenerate.d.ts +1 -1
  22. package/dist/data/introspect/policies/keyGenerate.js +17 -17
  23. package/dist/data/introspect/policies/keyUnique.d.ts +9 -9
  24. package/dist/data/introspect/policies/keyUnique.js +31 -31
  25. package/dist/data/introspect/policies/typeCheck.d.ts +11 -11
  26. package/dist/data/introspect/policies/typeCheck.js +57 -57
  27. package/dist/data/introspect/policies/typeEnum.d.ts +1 -1
  28. package/dist/data/introspect/policies/typeEnum.js +9 -9
  29. package/dist/data/introspect/policies/useDefault.d.ts +1 -1
  30. package/dist/data/introspect/policies/useDefault.js +8 -8
  31. package/dist/data/queries/deleteEntity.d.ts +1 -1
  32. package/dist/data/queries/deleteEntity.js +100 -100
  33. package/dist/data/queries/groupBy.d.ts +1 -1
  34. package/dist/data/queries/groupBy.js +22 -22
  35. package/dist/data/queries/insertEntity.d.ts +1 -1
  36. package/dist/data/queries/insertEntity.js +117 -117
  37. package/dist/data/queries/joinEntity.d.ts +1 -1
  38. package/dist/data/queries/joinEntity.js +32 -32
  39. package/dist/data/queries/joinEntity.min.js +1 -1
  40. package/dist/data/queries/limitOffset.d.ts +7 -7
  41. package/dist/data/queries/limitOffset.js +21 -21
  42. package/dist/data/queries/mergeJoins.d.ts +1 -1
  43. package/dist/data/queries/mergeJoins.js +19 -19
  44. package/dist/data/queries/mergeJoins.min.js +1 -1
  45. package/dist/data/queries/parser.d.ts +1 -1
  46. package/dist/data/queries/parser.js +19 -19
  47. package/dist/data/queries/parser.min.js +1 -1
  48. package/dist/data/queries/query.d.ts +1 -1
  49. package/dist/data/queries/query.js +18 -18
  50. package/dist/data/queries/query.min.js +1 -1
  51. package/dist/data/queries/readEntity.js +14 -14
  52. package/dist/data/queries/selectFields.d.ts +9 -9
  53. package/dist/data/queries/selectFields.js +36 -36
  54. package/dist/data/queries/sortBy.d.ts +1 -1
  55. package/dist/data/queries/sortBy.js +15 -15
  56. package/dist/data/queries/sortBy.min.js +1 -1
  57. package/dist/data/queries/updateEntity.d.ts +1 -1
  58. package/dist/data/queries/updateEntity.js +190 -190
  59. package/dist/data/queries/where.d.ts +6 -6
  60. package/dist/data/queries/where.js +56 -56
  61. package/dist/data/utilities/computeKeyValue.d.ts +12 -12
  62. package/dist/data/utilities/computeKeyValue.js +26 -26
  63. package/dist/data/utilities/config.d.ts +27 -27
  64. package/dist/data/utilities/config.js +45 -45
  65. package/dist/data/utilities/deregisterRecord.d.ts +7 -7
  66. package/dist/data/utilities/deregisterRecord.js +34 -34
  67. package/dist/data/utilities/getConditionIndexedList.js +47 -47
  68. package/dist/data/utilities/getConditionIndexedList.min.js +1 -1
  69. package/dist/data/utilities/getJoinIndexedList.js +76 -76
  70. package/dist/data/utilities/getJoinIndexedList.min.js +1 -1
  71. package/dist/data/utilities/getMatchingIndexes.js +28 -28
  72. package/dist/data/utilities/getMatchingIndexes.min.js +1 -1
  73. package/dist/data/utilities/matchIndexedJoins.js +61 -61
  74. package/dist/data/utilities/matchIndexedJoins.min.js +1 -1
  75. package/dist/data/utilities/mergeJoin.js +44 -44
  76. package/dist/data/utilities/mergeJoin.min.js +1 -1
  77. package/dist/data/utilities/parsers/findCommand.d.ts +9 -9
  78. package/dist/data/utilities/parsers/findCommand.js +25 -25
  79. package/dist/data/utilities/parsers/findConditions.d.ts +14 -14
  80. package/dist/data/utilities/parsers/findConditions.js +28 -28
  81. package/dist/data/utilities/parsers/findConditions.min.js +1 -1
  82. package/dist/data/utilities/parsers/findGroupBy.d.ts +8 -8
  83. package/dist/data/utilities/parsers/findGroupBy.js +22 -22
  84. package/dist/data/utilities/parsers/findInsertValues.d.ts +12 -12
  85. package/dist/data/utilities/parsers/findInsertValues.js +34 -34
  86. package/dist/data/utilities/parsers/findJoinClauses.d.ts +12 -12
  87. package/dist/data/utilities/parsers/findJoinClauses.js +27 -27
  88. package/dist/data/utilities/parsers/findJoinClauses.min.js +1 -1
  89. package/dist/data/utilities/parsers/findJoinEntity.d.ts +8 -8
  90. package/dist/data/utilities/parsers/findJoinEntity.js +22 -22
  91. package/dist/data/utilities/parsers/findLimit.d.ts +8 -8
  92. package/dist/data/utilities/parsers/findLimit.js +22 -22
  93. package/dist/data/utilities/parsers/findMergeJoins.d.ts +11 -11
  94. package/dist/data/utilities/parsers/findMergeJoins.js +26 -26
  95. package/dist/data/utilities/parsers/findMergeJoins.min.js +1 -1
  96. package/dist/data/utilities/parsers/findOffset.d.ts +8 -8
  97. package/dist/data/utilities/parsers/findOffset.js +22 -22
  98. package/dist/data/utilities/parsers/findSelects.d.ts +11 -11
  99. package/dist/data/utilities/parsers/findSelects.js +30 -30
  100. package/dist/data/utilities/parsers/findSelects.min.js +1 -1
  101. package/dist/data/utilities/parsers/findSortClauses.d.ts +11 -11
  102. package/dist/data/utilities/parsers/findSortClauses.js +30 -30
  103. package/dist/data/utilities/parsers/findSortClauses.min.js +1 -1
  104. package/dist/data/utilities/parsers/findUpdateValues.d.ts +14 -14
  105. package/dist/data/utilities/parsers/findUpdateValues.js +34 -34
  106. package/dist/data/utilities/parsers/isEntityProperty.js +6 -6
  107. package/dist/data/utilities/parsers/parseLiteralValue.d.ts +11 -11
  108. package/dist/data/utilities/parsers/parseLiteralValue.js +34 -34
  109. package/dist/data/utilities/parsers/parseQuery.d.ts +32 -32
  110. package/dist/data/utilities/parsers/parseQuery.js +51 -51
  111. package/dist/data/utilities/parsers/parseQuery.min.js +1 -1
  112. package/dist/data/utilities/parsers/removeFromQuery.js +6 -6
  113. package/dist/data/utilities/parsers/splitEntityProperty.js +13 -13
  114. package/dist/data/utilities/parsers/splitQueries.js +9 -9
  115. package/dist/data/utilities/reconcileJoin.js +26 -26
  116. package/dist/data/utilities/reconcileJoins.js +26 -26
  117. package/dist/data/utilities/reconcileJoins.min.js +1 -1
  118. package/dist/data/utilities/registerRecord.d.ts +7 -7
  119. package/dist/data/utilities/registerRecord.js +67 -67
  120. package/dist/data/utilities/removeFromIndex.d.ts +13 -13
  121. package/dist/data/utilities/removeFromIndex.js +44 -46
  122. package/dist/data/utilities/restrictIndexedList.js +45 -45
  123. package/dist/data/utilities/retrieveFile.js +28 -28
  124. package/dist/data/utilities/retrieveFile.min.js +1 -1
  125. package/dist/data/utilities/retrieveIndexes.d.ts +1 -1
  126. package/dist/data/utilities/retrieveIndexes.js +24 -24
  127. package/dist/data/utilities/retrieveIndexes.min.js +1 -1
  128. package/dist/data/utilities/retrieveRecord.js +9 -9
  129. package/dist/data/utilities/retrieveRecords.js +21 -21
  130. package/dist/data/utilities/retrieveRecords.min.js +1 -1
  131. package/dist/data/utilities/runQuery.d.ts +1 -1
  132. package/dist/data/utilities/runQuery.js +87 -87
  133. package/dist/data/utilities/updateIndex.d.ts +16 -16
  134. package/dist/data/utilities/updateIndex.js +56 -56
  135. package/dist/data/utilities/useJoinClause.d.ts +5 -5
  136. package/dist/data/utilities/useJoinClause.js +51 -51
  137. package/dist/index.d.ts +4 -4
  138. package/dist/index.js +42 -42
  139. package/package.json +9 -5
@@ -1,11 +1,11 @@
1
- import { recordDefinition } from './definitions/record';
2
- import { keyProperties } from './definitions/key';
3
- import { fieldProperties } from './definitions/field';
4
- /**
5
- * Create a new record.
6
- * @param recordName
7
- * @param definition
8
- * @param keys
9
- */
10
- export declare const create: (recordName: string, definition?: fieldProperties[], keys?: keyProperties[]) => Promise<recordDefinition | null>;
1
+ import { recordDefinition } from './definitions/record';
2
+ import { keyProperties } from './definitions/key';
3
+ import { fieldProperties } from './definitions/field';
4
+ /**
5
+ * Create a new record.
6
+ * @param recordName
7
+ * @param definition
8
+ * @param keys
9
+ */
10
+ export declare const create: (recordName: string, definition?: fieldProperties[], keys?: keyProperties[]) => Promise<recordDefinition | null>;
11
11
  //# sourceMappingURL=create.d.ts.map
@@ -1,47 +1,47 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.create = void 0
7
- require('core-js/modules/es.json.stringify.js')
8
- const _record = require('./definitions/record')
9
- const _registerRecord = require('../utilities/registerRecord')
10
- const _config = require('../utilities/config')
11
- /**
12
- * Create a new record.
13
- * @param recordName
14
- * @param definition
15
- * @param keys
16
- */
17
- const create = async (recordName, definition = [], keys = []) => {
18
- const {
19
- writeFile,
20
- mkdir
21
- } = require('fs/promises')
22
- const {
23
- existsSync
24
- } = require('fs')
25
- const databasePath = (0, _config.getSetting)('databasePath', 'database/')
26
- if (recordName === '__RECORDS') {
27
- return null
28
- }
29
- if (existsSync(`${databasePath}${recordName}.json`)) {
30
- return null
31
- }
32
- await mkdir(databasePath, {
33
- recursive: true
34
- })
35
- const recordContent = (0, _record.record)({
36
- path: recordName,
37
- definition,
38
- keys
39
- })
40
- await writeFile(`${databasePath}${recordName}.json`, JSON.stringify(recordContent, null, 2))
41
- await mkdir(`${databasePath}${recordName}`, {
42
- recursive: true
43
- })
44
- await (0, _registerRecord.registerRecord)(recordName)
45
- return recordContent
46
- }
47
- exports.create = create
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.create = void 0;
7
+ require("core-js/modules/es.json.stringify.js");
8
+ var _record = require("./definitions/record");
9
+ var _registerRecord = require("../utilities/registerRecord");
10
+ var _config = require("../utilities/config");
11
+ /**
12
+ * Create a new record.
13
+ * @param recordName
14
+ * @param definition
15
+ * @param keys
16
+ */
17
+ const create = async (recordName, definition = [], keys = []) => {
18
+ const {
19
+ writeFile,
20
+ mkdir
21
+ } = require('fs/promises');
22
+ const {
23
+ existsSync
24
+ } = require('fs');
25
+ const databasePath = (0, _config.getSetting)('databasePath', 'database/');
26
+ if (recordName === '__RECORDS') {
27
+ return null;
28
+ }
29
+ if (existsSync(`${databasePath}${recordName}.json`)) {
30
+ return null;
31
+ }
32
+ await mkdir(databasePath, {
33
+ recursive: true
34
+ });
35
+ const recordContent = (0, _record.record)({
36
+ path: recordName,
37
+ definition,
38
+ keys
39
+ });
40
+ await writeFile(`${databasePath}${recordName}.json`, JSON.stringify(recordContent, null, 2));
41
+ await mkdir(`${databasePath}${recordName}`, {
42
+ recursive: true
43
+ });
44
+ await (0, _registerRecord.registerRecord)(recordName);
45
+ return recordContent;
46
+ };
47
+ exports.create = create;
@@ -1,28 +1,28 @@
1
- export type fieldName = string;
2
- export type fieldDefinition = {
3
- name: fieldName;
4
- type: string;
5
- optional: boolean;
6
- default?: any;
7
- autoGenerate: boolean;
8
- };
9
- export type fieldProperties = {
10
- name?: string;
11
- type?: string;
12
- optional?: boolean;
13
- useDefault?: boolean;
14
- defaultValue?: any;
15
- autoGenerate?: boolean;
16
- };
17
- /**
18
- * Generate a field for a record.
19
- * @param properties
20
- * @param properties.name
21
- * @param properties.type
22
- * @param properties.optional
23
- * @param properties.useDefault
24
- * @param properties.defaultValue
25
- * @param properties.autoGenerate
26
- */
27
- export declare const field: ({ name, type, optional, useDefault, defaultValue, autoGenerate }?: fieldProperties) => fieldDefinition;
1
+ export type fieldName = string;
2
+ export type fieldDefinition = {
3
+ name: fieldName;
4
+ type: string;
5
+ optional: boolean;
6
+ default?: any;
7
+ autoGenerate: boolean;
8
+ };
9
+ export type fieldProperties = {
10
+ name?: string;
11
+ type?: string;
12
+ optional?: boolean;
13
+ useDefault?: boolean;
14
+ defaultValue?: any;
15
+ autoGenerate?: boolean;
16
+ };
17
+ /**
18
+ * Generate a field for a record.
19
+ * @param properties
20
+ * @param properties.name
21
+ * @param properties.type
22
+ * @param properties.optional
23
+ * @param properties.useDefault
24
+ * @param properties.defaultValue
25
+ * @param properties.autoGenerate
26
+ */
27
+ export declare const field: ({ name, type, optional, useDefault, defaultValue, autoGenerate }?: fieldProperties) => fieldDefinition;
28
28
  //# sourceMappingURL=field.d.ts.map
@@ -1,36 +1,36 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.field = void 0
7
- /**
8
- * Generate a field for a record.
9
- * @param properties
10
- * @param properties.name
11
- * @param properties.type
12
- * @param properties.optional
13
- * @param properties.useDefault
14
- * @param properties.defaultValue
15
- * @param properties.autoGenerate
16
- */
17
- const field = ({
18
- name = '',
19
- type = 'string',
20
- optional = false,
21
- useDefault = false,
22
- defaultValue = '',
23
- autoGenerate = false
24
- } = {}) => {
25
- const returnField = {
26
- name,
27
- type,
28
- optional,
29
- autoGenerate
30
- }
31
- if (useDefault) {
32
- returnField.default = defaultValue
33
- }
34
- return returnField
35
- }
36
- exports.field = field
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.field = void 0;
7
+ /**
8
+ * Generate a field for a record.
9
+ * @param properties
10
+ * @param properties.name
11
+ * @param properties.type
12
+ * @param properties.optional
13
+ * @param properties.useDefault
14
+ * @param properties.defaultValue
15
+ * @param properties.autoGenerate
16
+ */
17
+ const field = ({
18
+ name = '',
19
+ type = 'string',
20
+ optional = false,
21
+ useDefault = false,
22
+ defaultValue = '',
23
+ autoGenerate = false
24
+ } = {}) => {
25
+ const returnField = {
26
+ name,
27
+ type,
28
+ optional,
29
+ autoGenerate
30
+ };
31
+ if (useDefault) {
32
+ returnField['default'] = defaultValue;
33
+ }
34
+ return returnField;
35
+ };
36
+ exports.field = field;
@@ -1,26 +1,26 @@
1
- import { reference } from './keyReference';
2
- import { fieldName } from './field';
3
- export type indexType = string;
4
- export type indexLocation = string;
5
- export type keyDefinition = {
6
- type: indexType;
7
- fields: Array<fieldName>;
8
- lookup: indexLocation;
9
- references?: Array<reference>;
10
- };
11
- export type keyProperties = {
12
- type?: indexType;
13
- fields?: Array<fieldName>;
14
- lookup?: indexLocation;
15
- references?: Array<reference>;
16
- };
17
- /**
18
- * Create a field key.
19
- * @param properties
20
- * @param properties.type
21
- * @param properties.fields
22
- * @param properties.lookup
23
- * @param properties.references
24
- */
25
- export declare const key: ({ type, fields, lookup, references }?: keyProperties) => keyDefinition;
1
+ import { reference } from './keyReference';
2
+ import { fieldName } from './field';
3
+ export type indexType = string;
4
+ export type indexLocation = string;
5
+ export type keyDefinition = {
6
+ type: indexType;
7
+ fields: Array<fieldName>;
8
+ lookup: indexLocation;
9
+ references?: Array<reference>;
10
+ };
11
+ export type keyProperties = {
12
+ type?: indexType;
13
+ fields?: Array<fieldName>;
14
+ lookup?: indexLocation;
15
+ references?: Array<reference>;
16
+ };
17
+ /**
18
+ * Create a field key.
19
+ * @param properties
20
+ * @param properties.type
21
+ * @param properties.fields
22
+ * @param properties.lookup
23
+ * @param properties.references
24
+ */
25
+ export declare const key: ({ type, fields, lookup, references }?: keyProperties) => keyDefinition;
26
26
  //# sourceMappingURL=key.d.ts.map
@@ -1,53 +1,53 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.key = void 0
7
- require('core-js/modules/esnext.iterator.constructor.js')
8
- require('core-js/modules/esnext.iterator.map.js')
9
- const _keyReference = require('./keyReference')
10
- /**
11
- * Create a field key.
12
- * @param properties
13
- * @param properties.type
14
- * @param properties.fields
15
- * @param properties.lookup
16
- * @param properties.references
17
- */
18
- const key = ({
19
- type = 'index',
20
- fields = [],
21
- lookup = '',
22
- references = []
23
- } = {}) => {
24
- switch (type) {
25
- case 'primary':
26
- case 'index':
27
- case 'unique':
28
- references = []
29
- break
30
- case 'multi':
31
- if (fields.length < 2) {
32
- throw new Error('Multi key indicated with less than two fields')
33
- }
34
- break
35
- case 'foreign':
36
- if (references.length < 1) {
37
- throw new Error('Foreign key must have one reference to an external record')
38
- }
39
- break
40
- default:
41
- throw new Error('Unrecognized key type; must be index, primary, unique, multi, or foreign')
42
- }
43
- const keyDefinition = {
44
- type,
45
- fields,
46
- lookup
47
- }
48
- if (typeof references !== 'undefined' && references.length > 0) {
49
- keyDefinition.references = references.map(_keyReference.keyReference)
50
- }
51
- return keyDefinition
52
- }
53
- exports.key = key
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.key = void 0;
7
+ require("core-js/modules/esnext.iterator.constructor.js");
8
+ require("core-js/modules/esnext.iterator.map.js");
9
+ var _keyReference = require("./keyReference");
10
+ /**
11
+ * Create a field key.
12
+ * @param properties
13
+ * @param properties.type
14
+ * @param properties.fields
15
+ * @param properties.lookup
16
+ * @param properties.references
17
+ */
18
+ const key = ({
19
+ type = 'index',
20
+ fields = [],
21
+ lookup = '',
22
+ references = []
23
+ } = {}) => {
24
+ switch (type) {
25
+ case 'primary':
26
+ case 'index':
27
+ case 'unique':
28
+ references = [];
29
+ break;
30
+ case 'multi':
31
+ if (fields.length < 2) {
32
+ throw new Error('Multi key indicated with less than two fields');
33
+ }
34
+ break;
35
+ case 'foreign':
36
+ if (references.length < 1) {
37
+ throw new Error('Foreign key must have one reference to an external record');
38
+ }
39
+ break;
40
+ default:
41
+ throw new Error('Unrecognized key type; must be index, primary, unique, multi, or foreign');
42
+ }
43
+ const keyDefinition = {
44
+ type,
45
+ fields,
46
+ lookup
47
+ };
48
+ if (typeof references !== 'undefined' && references.length > 0) {
49
+ keyDefinition['references'] = references.map(_keyReference.keyReference);
50
+ }
51
+ return keyDefinition;
52
+ };
53
+ exports.key = key;
@@ -1,18 +1,18 @@
1
- import { fieldName } from './field';
2
- import { recordPath } from './record';
3
- export type reference = {
4
- fields: fieldName[];
5
- lookup: recordPath;
6
- };
7
- export type referenceProperties = {
8
- fields?: fieldName[];
9
- lookup?: recordPath;
10
- };
11
- /**
12
- * Create a reference to a remote (foreign; existing on another record) key.
13
- * @param properties
14
- * @param properties.fields
15
- * @param properties.lookup
16
- */
17
- export declare const keyReference: ({ fields, lookup }?: referenceProperties) => reference;
1
+ import { fieldName } from './field';
2
+ import { recordPath } from './record';
3
+ export type reference = {
4
+ fields: fieldName[];
5
+ lookup: recordPath;
6
+ };
7
+ export type referenceProperties = {
8
+ fields?: fieldName[];
9
+ lookup?: recordPath;
10
+ };
11
+ /**
12
+ * Create a reference to a remote (foreign; existing on another record) key.
13
+ * @param properties
14
+ * @param properties.fields
15
+ * @param properties.lookup
16
+ */
17
+ export declare const keyReference: ({ fields, lookup }?: referenceProperties) => reference;
18
18
  //# sourceMappingURL=keyReference.d.ts.map
@@ -1,20 +1,20 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.keyReference = void 0
7
- /**
8
- * Create a reference to a remote (foreign; existing on another record) key.
9
- * @param properties
10
- * @param properties.fields
11
- * @param properties.lookup
12
- */
13
- const keyReference = ({
14
- fields = [],
15
- lookup = ''
16
- } = {}) => ({
17
- fields,
18
- lookup
19
- })
20
- exports.keyReference = keyReference
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.keyReference = void 0;
7
+ /**
8
+ * Create a reference to a remote (foreign; existing on another record) key.
9
+ * @param properties
10
+ * @param properties.fields
11
+ * @param properties.lookup
12
+ */
13
+ const keyReference = ({
14
+ fields = [],
15
+ lookup = ''
16
+ } = {}) => ({
17
+ fields,
18
+ lookup
19
+ });
20
+ exports.keyReference = keyReference;
@@ -1,26 +1,26 @@
1
- import { fieldDefinition, fieldProperties } from './field';
2
- import { keyDefinition, keyProperties } from './key';
3
- export type recordPath = string;
4
- export type entityPath = string;
5
- export type recordDefinition = {
6
- path: recordPath;
7
- definition: fieldDefinition[];
8
- keys: keyDefinition[];
9
- entries: entityPath[];
10
- };
11
- export type recordProperties = {
12
- path?: recordPath;
13
- definition?: fieldProperties[];
14
- keys?: keyProperties[];
15
- entries?: entityPath[];
16
- };
17
- /**
18
- *
19
- * @param properties
20
- * @param properties.path
21
- * @param properties.definition
22
- * @param properties.keys
23
- * @param properties.entries
24
- */
25
- export declare const record: ({ path, definition, keys, entries }?: recordProperties) => recordDefinition;
1
+ import { fieldDefinition, fieldProperties } from './field';
2
+ import { keyDefinition, keyProperties } from './key';
3
+ export type recordPath = string;
4
+ export type entityPath = string;
5
+ export type recordDefinition = {
6
+ path: recordPath;
7
+ definition: fieldDefinition[];
8
+ keys: keyDefinition[];
9
+ entries: entityPath[];
10
+ };
11
+ export type recordProperties = {
12
+ path?: recordPath;
13
+ definition?: fieldProperties[];
14
+ keys?: keyProperties[];
15
+ entries?: entityPath[];
16
+ };
17
+ /**
18
+ *
19
+ * @param properties
20
+ * @param properties.path
21
+ * @param properties.definition
22
+ * @param properties.keys
23
+ * @param properties.entries
24
+ */
25
+ export declare const record: ({ path, definition, keys, entries }?: recordProperties) => recordDefinition;
26
26
  //# sourceMappingURL=record.d.ts.map
@@ -1,32 +1,32 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.record = void 0
7
- require('core-js/modules/esnext.iterator.constructor.js')
8
- require('core-js/modules/esnext.iterator.map.js')
9
- const _field = require('./field')
10
- const _key = require('./key')
11
- /**
12
- *
13
- * @param properties
14
- * @param properties.path
15
- * @param properties.definition
16
- * @param properties.keys
17
- * @param properties.entries
18
- */
19
- const record = ({
20
- path = '',
21
- definition = [],
22
- keys = [],
23
- entries = []
24
- } = {}) => {
25
- return {
26
- path,
27
- definition: definition.map(_field.field),
28
- keys: keys.map(_key.key),
29
- entries
30
- }
31
- }
32
- exports.record = record
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.record = void 0;
7
+ require("core-js/modules/esnext.iterator.constructor.js");
8
+ require("core-js/modules/esnext.iterator.map.js");
9
+ var _field = require("./field");
10
+ var _key = require("./key");
11
+ /**
12
+ *
13
+ * @param properties
14
+ * @param properties.path
15
+ * @param properties.definition
16
+ * @param properties.keys
17
+ * @param properties.entries
18
+ */
19
+ const record = ({
20
+ path = '',
21
+ definition = [],
22
+ keys = [],
23
+ entries = []
24
+ } = {}) => {
25
+ return {
26
+ path,
27
+ definition: definition.map(_field.field),
28
+ keys: keys.map(_key.key),
29
+ entries
30
+ };
31
+ };
32
+ exports.record = record;
@@ -1,15 +1,15 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.describe = void 0
7
- const _retrieveFile = require('../utilities/retrieveFile')
8
- const describe = async (record = '__RECORDS') => {
9
- const recordFile = await (0, _retrieveFile.retrieveFile)(`${record}.json`)
10
- if (record === '__RECORDS') {
11
- return recordFile.entries
12
- }
13
- return recordFile.definition
14
- }
15
- exports.describe = describe
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.describe = void 0;
7
+ var _retrieveFile = require("../utilities/retrieveFile");
8
+ const describe = async (record = '__RECORDS') => {
9
+ const recordFile = await (0, _retrieveFile.retrieveFile)(`${record}.json`);
10
+ if (record === '__RECORDS') {
11
+ return recordFile.entries;
12
+ }
13
+ return recordFile.definition;
14
+ };
15
+ exports.describe = describe;