@signaldb/core 2.0.0-beta.6 → 2.0.0-beta.8

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 (126) hide show
  1. package/dist/.vite/manifest.json +118 -84
  2. package/dist/AsyncDataAdapter.d.ts +4 -6
  3. package/dist/AutoFetchDataAdapter.d.ts +4 -6
  4. package/dist/Collection/Cursor.d.ts +3 -3
  5. package/dist/Collection/index.d.ts +8 -9
  6. package/dist/Collection/types.d.ts +2 -2
  7. package/dist/DataAdapter.d.ts +3 -4
  8. package/dist/DefaultDataAdapter.d.ts +3 -5
  9. package/dist/WorkerDataAdapter.d.ts +2 -4
  10. package/dist/WorkerDataAdapterHost.d.ts +5 -5
  11. package/dist/createIndex.d.ts +2 -2
  12. package/dist/createIndexProvider.d.ts +2 -2
  13. package/dist/createReactivityAdapter.d.ts +2 -2
  14. package/dist/createStorageAdapter.d.ts +1 -1
  15. package/dist/getIndexInfo.d.ts +3 -4
  16. package/dist/index.cjs.js +33 -34
  17. package/dist/index.mjs +17 -35
  18. package/dist/index10.cjs.js +23 -0
  19. package/dist/index10.mjs +21 -17
  20. package/dist/index11.cjs.js +45 -0
  21. package/dist/index11.mjs +44 -15
  22. package/dist/index12.cjs.js +22 -0
  23. package/dist/index12.mjs +21 -47
  24. package/dist/index13.cjs.js +45 -0
  25. package/dist/index13.mjs +44 -365
  26. package/dist/index14.cjs.js +86 -0
  27. package/dist/index14.mjs +85 -416
  28. package/dist/index15.cjs.js +15 -0
  29. package/dist/index15.mjs +14 -206
  30. package/dist/index16.cjs.js +136 -0
  31. package/dist/index16.mjs +135 -388
  32. package/dist/index17.cjs.js +47 -0
  33. package/dist/index17.mjs +45 -578
  34. package/dist/index18.cjs.js +15 -0
  35. package/dist/index18.mjs +14 -157
  36. package/dist/index19.cjs.js +23 -0
  37. package/dist/index19.mjs +22 -26
  38. package/dist/index2.cjs.js +33 -0
  39. package/dist/index2.mjs +32 -258
  40. package/dist/index20.cjs.js +37 -0
  41. package/dist/index20.mjs +36 -41
  42. package/dist/index21.cjs.js +35 -0
  43. package/dist/index21.mjs +34 -16
  44. package/dist/index22.cjs.js +25 -0
  45. package/dist/index22.mjs +24 -104
  46. package/dist/index23.cjs.js +19 -0
  47. package/dist/index23.mjs +18 -128
  48. package/dist/index24.cjs.js +342 -0
  49. package/dist/index24.mjs +340 -6
  50. package/dist/index25.cjs.js +519 -0
  51. package/dist/index25.mjs +518 -27
  52. package/dist/index26.cjs.js +11 -0
  53. package/dist/index26.mjs +10 -10
  54. package/dist/index27.cjs.js +11 -0
  55. package/dist/index27.mjs +10 -29
  56. package/dist/index28.cjs.js +90 -0
  57. package/dist/index28.mjs +88 -46
  58. package/dist/index29.cjs.js +370 -0
  59. package/dist/index29.mjs +369 -8
  60. package/dist/index3.cjs.js +19 -0
  61. package/dist/index3.mjs +18 -539
  62. package/dist/index30.cjs.js +72 -0
  63. package/dist/index30.mjs +71 -9
  64. package/dist/index31.cjs.js +191 -0
  65. package/dist/index31.mjs +190 -7
  66. package/dist/index32.cjs.js +21 -0
  67. package/dist/index32.mjs +20 -42
  68. package/dist/index33.cjs.js +336 -0
  69. package/dist/index33.mjs +335 -29
  70. package/dist/index34.cjs.js +539 -0
  71. package/dist/index34.mjs +537 -4
  72. package/dist/index4.cjs.js +150 -0
  73. package/dist/index4.mjs +149 -5
  74. package/dist/index5.cjs.js +254 -0
  75. package/dist/index5.mjs +252 -4
  76. package/dist/index6.cjs.js +125 -0
  77. package/dist/index6.mjs +124 -29
  78. package/dist/index7.cjs.js +33 -0
  79. package/dist/index7.mjs +32 -12
  80. package/dist/index8.cjs.js +12 -0
  81. package/dist/index8.mjs +10 -4
  82. package/dist/index9.cjs.js +11 -0
  83. package/dist/index9.mjs +10 -133
  84. package/dist/types/IndexProvider.d.ts +2 -2
  85. package/dist/types/Modifier.d.ts +1 -1
  86. package/dist/types/ReactivityAdapter.d.ts +1 -1
  87. package/dist/utils/createSignal.d.ts +2 -2
  88. package/dist/utils/getMatchingKeys.d.ts +2 -2
  89. package/dist/utils/isFieldExpression.d.ts +1 -1
  90. package/dist/utils/match.d.ts +1 -1
  91. package/dist/utils/modify.d.ts +1 -1
  92. package/dist/utils/queryId.d.ts +2 -2
  93. package/package.json +1 -1
  94. package/dist/index.cjs10.js +0 -18
  95. package/dist/index.cjs11.js +0 -15
  96. package/dist/index.cjs12.js +0 -48
  97. package/dist/index.cjs13.js +0 -365
  98. package/dist/index.cjs14.js +0 -416
  99. package/dist/index.cjs15.js +0 -206
  100. package/dist/index.cjs16.js +0 -388
  101. package/dist/index.cjs17.js +0 -579
  102. package/dist/index.cjs18.js +0 -157
  103. package/dist/index.cjs19.js +0 -26
  104. package/dist/index.cjs2.js +0 -259
  105. package/dist/index.cjs20.js +0 -42
  106. package/dist/index.cjs21.js +0 -16
  107. package/dist/index.cjs22.js +0 -104
  108. package/dist/index.cjs23.js +0 -129
  109. package/dist/index.cjs24.js +0 -7
  110. package/dist/index.cjs25.js +0 -27
  111. package/dist/index.cjs26.js +0 -10
  112. package/dist/index.cjs27.js +0 -29
  113. package/dist/index.cjs28.js +0 -46
  114. package/dist/index.cjs29.js +0 -8
  115. package/dist/index.cjs3.js +0 -540
  116. package/dist/index.cjs30.js +0 -9
  117. package/dist/index.cjs31.js +0 -7
  118. package/dist/index.cjs32.js +0 -42
  119. package/dist/index.cjs33.js +0 -29
  120. package/dist/index.cjs34.js +0 -5
  121. package/dist/index.cjs4.js +0 -5
  122. package/dist/index.cjs5.js +0 -5
  123. package/dist/index.cjs6.js +0 -29
  124. package/dist/index.cjs7.js +0 -12
  125. package/dist/index.cjs8.js +0 -5
  126. package/dist/index.cjs9.js +0 -133
package/dist/index.cjs.js CHANGED
@@ -1,35 +1,34 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const Cursor = require("./index.cjs2.js");
4
- const index = require("./index.cjs3.js");
5
- const createStorageAdapter = require("./index.cjs4.js");
6
- const createReactivityAdapter = require("./index.cjs5.js");
7
- const isEqual = require("./index.cjs6.js");
8
- const modify = require("./index.cjs7.js");
9
- const randomId = require("./index.cjs8.js");
10
- const EventEmitter = require("./index.cjs9.js");
11
- const get = require("./index.cjs10.js");
12
- const serializeValue = require("./index.cjs11.js");
13
- const reactiveOrAsync = require("./index.cjs12.js");
14
- const DefaultDataAdapter = require("./index.cjs13.js");
15
- const AsyncDataAdapter = require("./index.cjs14.js");
16
- const WorkerDataAdapter = require("./index.cjs15.js");
17
- const WorkerDataAdapterHost = require("./index.cjs16.js");
18
- const AutoFetchDataAdapter = require("./index.cjs17.js");
19
- exports.Cursor = Cursor.default;
20
- exports.Collection = index.default;
21
- exports.createStorageAdapter = createStorageAdapter;
22
- exports.createReactivityAdapter = createReactivityAdapter;
23
- exports.isEqual = isEqual;
24
- exports.modify = modify;
25
- exports.randomId = randomId;
26
- exports.EventEmitter = EventEmitter;
27
- exports.get = get;
28
- exports.serializeValue = serializeValue;
29
- exports.reactiveOrAsync = reactiveOrAsync.default;
30
- exports.unwrap = reactiveOrAsync.unwrap;
31
- exports.DefaultDataAdapter = DefaultDataAdapter;
32
- exports.AsyncDataAdapter = AsyncDataAdapter;
33
- exports.WorkerDataAdapter = WorkerDataAdapter;
34
- exports.WorkerDataAdapterHost = WorkerDataAdapterHost;
35
- exports.AutoFetchDataAdapter = AutoFetchDataAdapter;
2
+ const require_isEqual = require("./index2.cjs.js");
3
+ const require_Cursor = require("./index5.cjs.js");
4
+ const require_EventEmitter = require("./index6.cjs.js");
5
+ const require_randomId = require("./index8.cjs.js");
6
+ const require_get = require("./index10.cjs.js");
7
+ const require_serializeValue = require("./index12.cjs.js");
8
+ const require_modify = require("./index19.cjs.js");
9
+ const require_DefaultDataAdapter = require("./index24.cjs.js");
10
+ const require_index = require("./index25.cjs.js");
11
+ const require_createStorageAdapter = require("./index26.cjs.js");
12
+ const require_createReactivityAdapter = require("./index27.cjs.js");
13
+ const require_reactiveOrAsync = require("./index28.cjs.js");
14
+ const require_AsyncDataAdapter = require("./index29.cjs.js");
15
+ const require_WorkerDataAdapter = require("./index31.cjs.js");
16
+ const require_WorkerDataAdapterHost = require("./index33.cjs.js");
17
+ const require_AutoFetchDataAdapter = require("./index34.cjs.js");
18
+ exports.AsyncDataAdapter = require_AsyncDataAdapter.default;
19
+ exports.AutoFetchDataAdapter = require_AutoFetchDataAdapter.default;
20
+ exports.Collection = require_index.default;
21
+ exports.Cursor = require_Cursor.default;
22
+ exports.DefaultDataAdapter = require_DefaultDataAdapter.default;
23
+ exports.EventEmitter = require_EventEmitter.default;
24
+ exports.WorkerDataAdapter = require_WorkerDataAdapter.default;
25
+ exports.WorkerDataAdapterHost = require_WorkerDataAdapterHost.default;
26
+ exports.createReactivityAdapter = require_createReactivityAdapter.default;
27
+ exports.createStorageAdapter = require_createStorageAdapter.default;
28
+ exports.get = require_get.default;
29
+ exports.isEqual = require_isEqual.default;
30
+ exports.modify = require_modify.default;
31
+ exports.randomId = require_randomId.default;
32
+ exports.reactiveOrAsync = require_reactiveOrAsync.default;
33
+ exports.serializeValue = require_serializeValue.default;
34
+ exports.unwrap = require_reactiveOrAsync.unwrap;
package/dist/index.mjs CHANGED
@@ -1,35 +1,17 @@
1
- import { default as default2 } from "./index2.mjs";
2
- import { default as default3 } from "./index3.mjs";
3
- import { default as default4 } from "./index4.mjs";
4
- import { default as default5 } from "./index5.mjs";
5
- import { default as default6 } from "./index6.mjs";
6
- import { default as default7 } from "./index7.mjs";
7
- import { default as default8 } from "./index8.mjs";
8
- import { default as default9 } from "./index9.mjs";
9
- import { default as default10 } from "./index10.mjs";
10
- import { default as default11 } from "./index11.mjs";
11
- import { default as default12, unwrap } from "./index12.mjs";
12
- import { default as default13 } from "./index13.mjs";
13
- import { default as default14 } from "./index14.mjs";
14
- import { default as default15 } from "./index15.mjs";
15
- import { default as default16 } from "./index16.mjs";
16
- import { default as default17 } from "./index17.mjs";
17
- export {
18
- default14 as AsyncDataAdapter,
19
- default17 as AutoFetchDataAdapter,
20
- default3 as Collection,
21
- default2 as Cursor,
22
- default13 as DefaultDataAdapter,
23
- default9 as EventEmitter,
24
- default15 as WorkerDataAdapter,
25
- default16 as WorkerDataAdapterHost,
26
- default5 as createReactivityAdapter,
27
- default4 as createStorageAdapter,
28
- default10 as get,
29
- default6 as isEqual,
30
- default7 as modify,
31
- default8 as randomId,
32
- default12 as reactiveOrAsync,
33
- default11 as serializeValue,
34
- unwrap
35
- };
1
+ import isEqual from "./index2.mjs";
2
+ import Cursor from "./index5.mjs";
3
+ import EventEmitter from "./index6.mjs";
4
+ import randomId from "./index8.mjs";
5
+ import get from "./index10.mjs";
6
+ import serializeValue from "./index12.mjs";
7
+ import modify from "./index19.mjs";
8
+ import DefaultDataAdapter from "./index24.mjs";
9
+ import Collection from "./index25.mjs";
10
+ import createStorageAdapter from "./index26.mjs";
11
+ import createReactivityAdapter from "./index27.mjs";
12
+ import reactiveOrAsync, { unwrap } from "./index28.mjs";
13
+ import AsyncDataAdapter from "./index29.mjs";
14
+ import WorkerDataAdapter from "./index31.mjs";
15
+ import WorkerDataAdapterHost from "./index33.mjs";
16
+ import AutoFetchDataAdapter from "./index34.mjs";
17
+ export { AsyncDataAdapter, AutoFetchDataAdapter, Collection, Cursor, DefaultDataAdapter, EventEmitter, WorkerDataAdapter, WorkerDataAdapterHost, createReactivityAdapter, createStorageAdapter, get, isEqual, modify, randomId, reactiveOrAsync, serializeValue, unwrap };
@@ -0,0 +1,23 @@
1
+ //#region src/utils/get.ts
2
+ /**
3
+ * Retrieves the value at a specified path within an object.
4
+ * Supports dot and bracket notation for navigating nested properties.
5
+ * @template T - The type of the object to retrieve the value from.
6
+ * @param value - The object to navigate.
7
+ * @param path - The path (dot or bracket notation) to the desired value.
8
+ * @returns The value at the specified path, or `undefined` if the path does not exist.
9
+ */
10
+ function get(value, path) {
11
+ const normalized = path.replaceAll(/\[(\w+)\]/g, ".$1");
12
+ if (normalized.includes("..") || normalized.startsWith(".") || normalized.endsWith(".")) return;
13
+ const segments = normalized.split(".");
14
+ let current = value;
15
+ for (const key of segments) {
16
+ if (current == null) return;
17
+ current = current[key];
18
+ }
19
+ if (current === void 0) return;
20
+ return current;
21
+ }
22
+ //#endregion
23
+ exports.default = get;
package/dist/index10.mjs CHANGED
@@ -1,19 +1,23 @@
1
+ //#region src/utils/get.ts
2
+ /**
3
+ * Retrieves the value at a specified path within an object.
4
+ * Supports dot and bracket notation for navigating nested properties.
5
+ * @template T - The type of the object to retrieve the value from.
6
+ * @param value - The object to navigate.
7
+ * @param path - The path (dot or bracket notation) to the desired value.
8
+ * @returns The value at the specified path, or `undefined` if the path does not exist.
9
+ */
1
10
  function get(value, path) {
2
- const normalized = path.replaceAll(/\[(\w+)\]/g, ".$1");
3
- if (normalized.includes("..") || normalized.startsWith(".") || normalized.endsWith(".")) {
4
- return;
5
- }
6
- const segments = normalized.split(".");
7
- let current = value;
8
- for (const key of segments) {
9
- if (current == null)
10
- return;
11
- current = current[key];
12
- }
13
- if (current === void 0)
14
- return;
15
- return current;
11
+ const normalized = path.replaceAll(/\[(\w+)\]/g, ".$1");
12
+ if (normalized.includes("..") || normalized.startsWith(".") || normalized.endsWith(".")) return;
13
+ const segments = normalized.split(".");
14
+ let current = value;
15
+ for (const key of segments) {
16
+ if (current == null) return;
17
+ current = current[key];
18
+ }
19
+ if (current === void 0) return;
20
+ return current;
16
21
  }
17
- export {
18
- get as default
19
- };
22
+ //#endregion
23
+ export { get as default };
@@ -0,0 +1,45 @@
1
+ //#region src/utils/isFieldExpression.ts
2
+ var expressionKeys = new Set([
3
+ "$eq",
4
+ "$gt",
5
+ "$gte",
6
+ "$lt",
7
+ "$lte",
8
+ "$in",
9
+ "$nin",
10
+ "$ne",
11
+ "$exists",
12
+ "$not",
13
+ "$expr",
14
+ "$jsonSchema",
15
+ "$mod",
16
+ "$regex",
17
+ "$options",
18
+ "$text",
19
+ "$where",
20
+ "$all",
21
+ "$elemMatch",
22
+ "$size",
23
+ "$bitsAllClear",
24
+ "$bitsAllSet",
25
+ "$bitsAnyClear",
26
+ "$bitsAnySet"
27
+ ]);
28
+ /**
29
+ * Determines whether a given object is a valid field expression.
30
+ * A field expression is an object containing query operators supported by MongoDB-style queries.
31
+ * @template T - The type of the field expression.
32
+ * @param expression - The object to test.
33
+ * @returns A boolean indicating whether the object is a valid field expression.
34
+ * - `true` if the object contains only recognized query operators.
35
+ * - `false` otherwise.
36
+ */
37
+ function isFieldExpression(expression) {
38
+ if (typeof expression !== "object" || expression == null) return false;
39
+ const keys = Object.keys(expression);
40
+ if (keys.length === 0) return false;
41
+ if (keys.some((key) => !expressionKeys.has(key))) return false;
42
+ return keys.every((key) => expressionKeys.has(key));
43
+ }
44
+ //#endregion
45
+ exports.default = isFieldExpression;
package/dist/index11.mjs CHANGED
@@ -1,16 +1,45 @@
1
- function serializeValue(value) {
2
- if (value == null)
3
- return null;
4
- if (typeof value === "string")
5
- return value;
6
- if (typeof value === "number")
7
- return value.toString();
8
- if (typeof value === "boolean")
9
- return value.toString();
10
- if (value instanceof Date)
11
- return value.toISOString();
12
- return JSON.stringify(value);
1
+ //#region src/utils/isFieldExpression.ts
2
+ var expressionKeys = new Set([
3
+ "$eq",
4
+ "$gt",
5
+ "$gte",
6
+ "$lt",
7
+ "$lte",
8
+ "$in",
9
+ "$nin",
10
+ "$ne",
11
+ "$exists",
12
+ "$not",
13
+ "$expr",
14
+ "$jsonSchema",
15
+ "$mod",
16
+ "$regex",
17
+ "$options",
18
+ "$text",
19
+ "$where",
20
+ "$all",
21
+ "$elemMatch",
22
+ "$size",
23
+ "$bitsAllClear",
24
+ "$bitsAllSet",
25
+ "$bitsAnyClear",
26
+ "$bitsAnySet"
27
+ ]);
28
+ /**
29
+ * Determines whether a given object is a valid field expression.
30
+ * A field expression is an object containing query operators supported by MongoDB-style queries.
31
+ * @template T - The type of the field expression.
32
+ * @param expression - The object to test.
33
+ * @returns A boolean indicating whether the object is a valid field expression.
34
+ * - `true` if the object contains only recognized query operators.
35
+ * - `false` otherwise.
36
+ */
37
+ function isFieldExpression(expression) {
38
+ if (typeof expression !== "object" || expression == null) return false;
39
+ const keys = Object.keys(expression);
40
+ if (keys.length === 0) return false;
41
+ if (keys.some((key) => !expressionKeys.has(key))) return false;
42
+ return keys.every((key) => expressionKeys.has(key));
13
43
  }
14
- export {
15
- serializeValue as default
16
- };
44
+ //#endregion
45
+ export { isFieldExpression as default };
@@ -0,0 +1,22 @@
1
+ //#region src/utils/serializeValue.ts
2
+ /**
3
+ * Serializes a value into a string representation.
4
+ * Handles various types, including strings, numbers, booleans, dates, and objects.
5
+ * Falls back to JSON stringification for unsupported types.
6
+ * @param value - The value to serialize.
7
+ * - Strings are returned as-is.
8
+ * - Numbers and booleans are converted to their string representation.
9
+ * - Dates are converted to ISO string format.
10
+ * - Other values are stringified using `JSON.stringify`.
11
+ * @returns A string representation of the value.
12
+ */
13
+ function serializeValue(value) {
14
+ if (value == null) return null;
15
+ if (typeof value === "string") return value;
16
+ if (typeof value === "number") return value.toString();
17
+ if (typeof value === "boolean") return value.toString();
18
+ if (value instanceof Date) return value.toISOString();
19
+ return JSON.stringify(value);
20
+ }
21
+ //#endregion
22
+ exports.default = serializeValue;
package/dist/index12.mjs CHANGED
@@ -1,48 +1,22 @@
1
- function unwrap(value) {
2
- return (function* () {
3
- return yield value;
4
- })();
1
+ //#region src/utils/serializeValue.ts
2
+ /**
3
+ * Serializes a value into a string representation.
4
+ * Handles various types, including strings, numbers, booleans, dates, and objects.
5
+ * Falls back to JSON stringification for unsupported types.
6
+ * @param value - The value to serialize.
7
+ * - Strings are returned as-is.
8
+ * - Numbers and booleans are converted to their string representation.
9
+ * - Dates are converted to ISO string format.
10
+ * - Other values are stringified using `JSON.stringify`.
11
+ * @returns A string representation of the value.
12
+ */
13
+ function serializeValue(value) {
14
+ if (value == null) return null;
15
+ if (typeof value === "string") return value;
16
+ if (typeof value === "number") return value.toString();
17
+ if (typeof value === "boolean") return value.toString();
18
+ if (value instanceof Date) return value.toISOString();
19
+ return JSON.stringify(value);
5
20
  }
6
- function isThenable(value) {
7
- return typeof value === "object" && value !== null && typeof value.then === "function";
8
- }
9
- function runReactiveOrAsync(thisArgument, mode, gen) {
10
- const a = !!mode?.async;
11
- const it = gen.call(thisArgument, a);
12
- if (!a) {
13
- let step = it.next();
14
- while (!step.done) {
15
- const y = step.value;
16
- if (isThenable(y))
17
- throw new Error("Promise yielded in sync flow");
18
- step = it.next(y);
19
- }
20
- return step.value;
21
- }
22
- return (async function() {
23
- let step = it.next();
24
- while (!step.done) {
25
- const y = step.value;
26
- const v = isThenable(y) ? await y : y;
27
- step = it.next(v);
28
- }
29
- return step.value;
30
- })();
31
- }
32
- function reactiveOrAsync(gen) {
33
- function method(...allArguments) {
34
- const last = allArguments.length > 0 ? allArguments.at(-1) : void 0;
35
- const hasMode = typeof last === "object" && last !== null && "async" in last;
36
- const mode = hasMode ? last : void 0;
37
- const parameters = hasMode ? allArguments.slice(0, -1) : allArguments;
38
- return runReactiveOrAsync(this, mode, function* (a) {
39
- return yield* gen.call(this, a, ...parameters);
40
- });
41
- }
42
- method.generator = gen;
43
- return method;
44
- }
45
- export {
46
- reactiveOrAsync as default,
47
- unwrap
48
- };
21
+ //#endregion
22
+ export { serializeValue as default };
@@ -0,0 +1,45 @@
1
+ const require_isFieldExpression = require("./index11.cjs.js");
2
+ const require_serializeValue = require("./index12.cjs.js");
3
+ //#region src/utils/getMatchingKeys.ts
4
+ /**
5
+ * Extracts the matching and excluded keys for a given field in a selector.
6
+ * Supports serialized values and `$in`/`$nin` field expressions for optimization.
7
+ * Returns `null` for include/exclude if the field cannot be optimized.
8
+ * @template T - The type of the items in the selector.
9
+ * @template I - The type of the unique identifier for the items.
10
+ * @param field - The name of the field to extract matching keys for.
11
+ * @param selector - The selector object containing query criteria.
12
+ * @returns An object containing arrays of serialized included and excluded keys,
13
+ * or `null` if the field cannot be optimized.
14
+ */
15
+ function getMatchingKeys(field, selector) {
16
+ const result = {
17
+ include: null,
18
+ exclude: null
19
+ };
20
+ const fieldSelector = selector[field];
21
+ if (fieldSelector instanceof RegExp) return result;
22
+ if (fieldSelector == null) return result;
23
+ if (require_isFieldExpression.default(fieldSelector)) {
24
+ if (fieldSelector.$ne != null) {
25
+ result.exclude = [require_serializeValue.default(fieldSelector.$ne)];
26
+ return result;
27
+ }
28
+ if (Array.isArray(fieldSelector.$in) && fieldSelector.$in.length > 0) {
29
+ result.include = fieldSelector.$in.map(require_serializeValue.default);
30
+ return result;
31
+ }
32
+ if (Array.isArray(fieldSelector.$nin) && fieldSelector.$nin.length > 0) {
33
+ result.exclude = fieldSelector.$nin.map(require_serializeValue.default);
34
+ return result;
35
+ }
36
+ return {
37
+ include: null,
38
+ exclude: null
39
+ };
40
+ }
41
+ result.include = [require_serializeValue.default(fieldSelector)];
42
+ return result;
43
+ }
44
+ //#endregion
45
+ exports.default = getMatchingKeys;