@omegup/msync 0.1.48 → 0.1.49
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/index.d.ts +23 -18
- package/index.esm.js +2 -1
- package/index.js +2 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -26,6 +26,9 @@ type O<T = unknown> = Obj & T;
|
|
|
26
26
|
type RORec<K extends keyof never, T = unknown> = {
|
|
27
27
|
readonly [P in K]: T;
|
|
28
28
|
};
|
|
29
|
+
type PRRec<K extends keyof never, T = unknown> = {
|
|
30
|
+
[P in K]?: T;
|
|
31
|
+
};
|
|
29
32
|
type Rec<K extends string, T = unknown> = O<RORec<K, T>>;
|
|
30
33
|
type O2 = readonly [O, O];
|
|
31
34
|
type O3 = readonly [O, O, O];
|
|
@@ -352,27 +355,29 @@ declare const $getField: {
|
|
|
352
355
|
<T, K extends StrKey<T>, D, C = unknown>(expr: Expr<T, D, C>, field: K): Expr<T[K], D, C>;
|
|
353
356
|
<T, K extends StrKey<T>, D, C = unknown>(expr: Expr<T | N, D, C>, field: K): Expr<T[K] | null, D, C>;
|
|
354
357
|
};
|
|
355
|
-
type
|
|
356
|
-
|
|
357
|
-
} : T extends O ? {
|
|
358
|
-
[K in StrKey<T>]: NoRaw<T[K]>;
|
|
359
|
-
} : T;
|
|
360
|
-
type RONoRaw<T> = T extends Arr<infer U> ? readonly RONoRaw<U>[] : T extends readonly unknown[] ? {
|
|
361
|
-
readonly [K in keyof T]: RONoRaw<T[K]>;
|
|
362
|
-
} : T extends O ? {
|
|
363
|
-
readonly [K in StrKey<T>]: RONoRaw<T[K]>;
|
|
364
|
-
} : T;
|
|
365
|
-
declare const func: <T extends jsonItem, A extends readonly jsonItem[], D, C = unknown>(f: (...args: NoRaw<A>) => RONoRaw<T>, ...args: { [X in keyof A]: Expr<A[X], D, C>; }) => Expr<T, D, C>;
|
|
358
|
+
type AddO<T> = T extends notObj ? T : T extends Array<infer U> ? Arr<AddO<U>> : O<T>;
|
|
359
|
+
declare const func: <T extends jsonItem, A extends readonly jsonItem[], D, C = unknown>(f: (...args: A) => T, ...args: { [X in keyof A]: Expr<AddO<A[X]>, D, C>; }) => Expr<AddO<T>, D, C>;
|
|
366
360
|
declare const rand: () => string;
|
|
367
361
|
declare const $rand: Expr<string, unknown, unknown>;
|
|
368
362
|
|
|
363
|
+
type AddOs<A extends readonly unknown[]> = {
|
|
364
|
+
[K in keyof A]: AddO<A[K]>;
|
|
365
|
+
};
|
|
366
|
+
type PushSides<V> = {
|
|
367
|
+
0: V[];
|
|
368
|
+
1: V[];
|
|
369
|
+
};
|
|
370
|
+
type PushDict<V> = PRRec<string, PushSides<V>>;
|
|
369
371
|
declare const $sum: <D extends O, C = unknown>(expr: Expr<number | N, D, C>) => DeltaAccumulator<D, number, C>;
|
|
370
|
-
declare const $accumulator: <D, T, Ctx, A extends readonly unknown[]>(init: () =>
|
|
371
|
-
declare const $countDict: <D extends O, C = unknown>(expr: Expr<
|
|
372
|
-
declare const $countDictArray: <D extends O, C = unknown>(expr: Expr<
|
|
373
|
-
declare const $pushDict: <D extends O, V, C = unknown>(key: Expr<string, D, C>, value: Expr<V
|
|
374
|
-
declare const $keys: <D extends O, C = unknown>(expr: Expr<
|
|
375
|
-
declare const $entries: <D extends O, V, C = unknown>(expr: Expr<
|
|
372
|
+
declare const $accumulator: <D, T, Ctx, A extends readonly unknown[]>(init: () => T, accumulateArgs: AppMap<ExprHKT<Part<D>, Ctx>, AddOs<A>>, accumulate: (a: T, ...args: A) => T, merge: (...args: [T | N, T]) => T) => DeltaAccumulator<D, AddO<T>, Ctx>;
|
|
373
|
+
declare const $countDict: <D extends O, K extends string = string, C = unknown>(expr: Expr<AddO<K>, D, C>) => DeltaAccumulator<D, AddO<PRRec<K, number>>, C>;
|
|
374
|
+
declare const $countDictArray: <D extends O, K extends string = string, C = unknown>(expr: Expr<AddO<K[]>, D, C>) => DeltaAccumulator<D, AddO<PRRec<K, number>>, C>;
|
|
375
|
+
declare const $pushDict: <D extends O, V, C = unknown>(key: Expr<string, D, C>, value: Expr<AddO<V>, D, C>) => DeltaAccumulator<D, O<PushDict<V>>, C>;
|
|
376
|
+
declare const $keys: <D extends O, K extends string = string, C = unknown>(expr: Expr<AddO<PRRec<K, number>>, D, C>) => Expr<AddO<K[]>, D, C>;
|
|
377
|
+
declare const $entries: <D extends O, V, C = unknown>(expr: Expr<AddO<PushDict<V>>, D, C>) => Expr<AddO<{
|
|
378
|
+
k: string;
|
|
379
|
+
v: V;
|
|
380
|
+
}[]>, D, C>;
|
|
376
381
|
|
|
377
382
|
type DeltaPipe<Q extends O, T extends Q, F extends HKT<O2>, G extends HKT<O3>> = {
|
|
378
383
|
with: <Q2 extends O, V extends Q2>(map: (a: Stream<Q, T, F, G>) => Stream<Q | Q2, V, F, G>) => DeltaPipe<Q | Q2, V, F, G>;
|
|
@@ -738,4 +743,4 @@ declare const prepare: (testName?: string) => Promise<MongoClient$1>;
|
|
|
738
743
|
declare const makeCol: <T extends ID>(docs: readonly OptionalUnlessRequiredId<T>[], database: Db, name?: string) => Promise<Collection<T>>;
|
|
739
744
|
|
|
740
745
|
export { $accumulator, $and, $countDict, $countDictArray, $entries, $eq, $exists, $expr, $getField, $group, $groupId, $groupMerge, $group_, $gt, $gtTs, $gte, $gteTs, $ifNull, $in, $insert, $insertPart, $insertX, $keys, $let, $lookup, $lt, $lte, $map, $map0, $map1, $match, $matchDelta, $merge, $merge2, $mergeId, $mergePart, $merge_, $ne, $nin, $nor, $or, $outerLookup, $pushDict, $rand, $reduce, $replaceWith, $set, $simpleInsert, $simpleMerge, $simpleMergePart, $substr, $sum, $type, $unwind, $unwindDelta, Expr, Field, Machine, Type, add, and, anyElementTrue, array, ceil, comp, concat, concatArray, createIndex, ctx, current, dateAdd, dateDiff, dateLt, datePart, dayAndMonthPart, divide, emptyDelta, enablePreAndPostImages, eq, eqTyped, except, exprMapVal, field, fieldF, fieldM, filter, filterDefined, first, firstSure, floor, from, func, getWhenMatched, getWhenMatchedForMerge, gt, gte, inArray, isArray, ite, joinIdOf, last, log, lt, lte, makeCol, map1, mapFromPlainDateTime, mapToPlainDateTime, mapVal, matchDelta, max, maxDate, mergeExact, mergeExact0, mergeExpr, mergeObjects, minDate, monthPart, multiply, ne, nil, noop, not, notNull, now, or, padLeft, pair, prepare, rand, range, regex, root, set, setField, single, size, slice, sortArray, staging, startOf, str, sub, subtract, to, toInt, val, weekPart, wrap, year };
|
|
741
|
-
export type { Accumulators, Arr, AsLiteral, Delta, DeltaAccumulator, DeltaAccumulators, DeltaStages, ExactKeys, ExprHKT, Exprs, ExprsExact, ExprsExactHKT, ExprsPart, ID, JoinId, Loose, Merge, MergeArgs, MergeInto, MergeMapOArgs, Model, MongoTypeNames, N,
|
|
746
|
+
export type { Accumulators, AddO, Arr, AsLiteral, Delta, DeltaAccumulator, DeltaAccumulators, DeltaStages, ExactKeys, ExprHKT, Exprs, ExprsExact, ExprsExactHKT, ExprsPart, ID, JoinId, Loose, Merge, MergeArgs, MergeInto, MergeMapOArgs, Model, MongoTypeNames, N, NullToOBJ, O, OPick, OPickD, Patch, RORec, RawStages, Rec, Replace, SnapshotStreamExecutionResult, StrKey, Strict, TS, WriteonlyCollection, doc, jsonPrim, notArr };
|
package/index.esm.js
CHANGED
|
@@ -76,7 +76,8 @@ const spread = (a, b) => ({ ...a, ...mapExact(b, id$1) });
|
|
|
76
76
|
const spread0 = (a, b) => ({ ...a, ...mapExact0(b, id$1) });
|
|
77
77
|
|
|
78
78
|
const val = (val) => asExpr({
|
|
79
|
-
raw: () => asExprRaw((val && typeof val === 'object' && !(val instanceof Date)) ||
|
|
79
|
+
raw: () => asExprRaw((val && typeof val === 'object' && !(val instanceof Date)) ||
|
|
80
|
+
(typeof val === 'string' && val[0] === '$')
|
|
80
81
|
? { $literal: val }
|
|
81
82
|
: val),
|
|
82
83
|
});
|
package/index.js
CHANGED
|
@@ -78,7 +78,8 @@ const spread = (a, b) => ({ ...a, ...mapExact(b, id$1) });
|
|
|
78
78
|
const spread0 = (a, b) => ({ ...a, ...mapExact0(b, id$1) });
|
|
79
79
|
|
|
80
80
|
const val = (val) => asExpr({
|
|
81
|
-
raw: () => asExprRaw((val && typeof val === 'object' && !(val instanceof Date)) ||
|
|
81
|
+
raw: () => asExprRaw((val && typeof val === 'object' && !(val instanceof Date)) ||
|
|
82
|
+
(typeof val === 'string' && val[0] === '$')
|
|
82
83
|
? { $literal: val }
|
|
83
84
|
: val),
|
|
84
85
|
});
|