@signaldb/core 1.5.1 → 1.5.3
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/.vite/manifest.json +4 -1
- package/dist/index.cjs10.js +2 -1
- package/dist/index10.mjs +2 -1
- package/dist/types/Selector.d.ts +2 -2
- package/package.json +2 -1
package/dist/.vite/manifest.json
CHANGED
|
@@ -175,7 +175,10 @@
|
|
|
175
175
|
"src/utils/modify.ts": {
|
|
176
176
|
"file": "index.cjs10.js",
|
|
177
177
|
"name": "utils/modify",
|
|
178
|
-
"src": "src/utils/modify.ts"
|
|
178
|
+
"src": "src/utils/modify.ts",
|
|
179
|
+
"imports": [
|
|
180
|
+
"src/utils/deepClone.ts"
|
|
181
|
+
]
|
|
179
182
|
},
|
|
180
183
|
"src/utils/project.ts": {
|
|
181
184
|
"file": "index.cjs22.js",
|
package/dist/index.cjs10.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const mingo = require("mingo");
|
|
3
|
+
const deepClone = require("./index.cjs15.js");
|
|
3
4
|
function modify(item, modifier) {
|
|
4
5
|
const hasOperators = Object.keys(modifier).some((key) => key.startsWith("$"));
|
|
5
6
|
if (!hasOperators)
|
|
6
7
|
return modifier;
|
|
7
|
-
const clonedItem =
|
|
8
|
+
const clonedItem = deepClone.default(item);
|
|
8
9
|
mingo.update(clonedItem, modifier);
|
|
9
10
|
return clonedItem;
|
|
10
11
|
}
|
package/dist/index10.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { update } from "mingo";
|
|
2
|
+
import deepClone from "./index15.mjs";
|
|
2
3
|
function modify(item, modifier) {
|
|
3
4
|
const hasOperators = Object.keys(modifier).some((key) => key.startsWith("$"));
|
|
4
5
|
if (!hasOperators)
|
|
5
6
|
return modifier;
|
|
6
|
-
const clonedItem =
|
|
7
|
+
const clonedItem = deepClone(item);
|
|
7
8
|
update(clonedItem, modifier);
|
|
8
9
|
return clonedItem;
|
|
9
10
|
}
|
package/dist/types/Selector.d.ts
CHANGED
|
@@ -29,10 +29,10 @@ export interface FieldExpression<T> {
|
|
|
29
29
|
$bitsAnyClear?: any;
|
|
30
30
|
$bitsAnySet?: any;
|
|
31
31
|
}
|
|
32
|
-
type DotNotation<T> = {
|
|
32
|
+
export type DotNotation<T> = {
|
|
33
33
|
[K in keyof T & string]: T[K] extends Array<infer U> ? `${K}` | `${K}.$` | `${K}.${DotNotation<U>}` : T[K] extends object ? `${K}` | `${K}.${DotNotation<T[K]>}` : `${K}`;
|
|
34
34
|
}[keyof T & string];
|
|
35
|
-
type GetType<T, P extends string> = P extends `${infer H}.${infer R}` ? H extends keyof T ? T[H] extends Array<infer U> ? GetType<U, R> : GetType<T[H], R> : H extends '$' ? T extends Array<infer U> ? GetType<U, R> : never : never : P extends keyof T ? T[P] : never;
|
|
35
|
+
export type GetType<T, P extends string> = P extends `${infer H}.${infer R}` ? H extends keyof T ? T[H] extends Array<infer U> ? GetType<U, R> : GetType<T[H], R> : H extends '$' ? T extends Array<infer U> ? GetType<U, R> : never : never : P extends keyof T ? T[P] : never;
|
|
36
36
|
type FlatQuery<T> = {
|
|
37
37
|
[P in DotNotation<T>]?: FlatQueryValue<T, P>;
|
|
38
38
|
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signaldb/core",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "SignalDB is a client-side database that provides a simple MongoDB-like interface to the data with first-class typescript support to achieve an optimistic UI. Data persistence can be achieved by using storage providers that store the data through a JSON interface to places such as localStorage.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rimraf dist && vite build",
|
|
7
|
+
"analyze-bundle": "bundle-analyzer ./dist --upload-token=$BUNDLE_ANALYZER_UPLOAD_TOKEN --bundle-name=@signaldb/core",
|
|
7
8
|
"test": "vitest"
|
|
8
9
|
},
|
|
9
10
|
"repository": {
|