@omegup/msync 0.1.48 → 0.1.50
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 +76 -22
- package/index.esm.js +25 -6
- package/index.js +46 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -26,6 +26,12 @@ 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
|
+
};
|
|
32
|
+
type Par$1<K extends string, V extends Rec<K, jsonItem>> = {
|
|
33
|
+
readonly [k in K]?: V[k] | N;
|
|
34
|
+
};
|
|
29
35
|
type Rec<K extends string, T = unknown> = O<RORec<K, T>>;
|
|
30
36
|
type O2 = readonly [O, O];
|
|
31
37
|
type O3 = readonly [O, O, O];
|
|
@@ -205,21 +211,45 @@ type BoolExpr<in D1, in D2, in Ctx = unknown> = {
|
|
|
205
211
|
};
|
|
206
212
|
};
|
|
207
213
|
|
|
214
|
+
declare const map: <T, K extends string & keyof T, V extends RORec<K, unknown>>(x: Pick<T, K>, f: <P extends K>(v: T[P], k: P) => V[P]) => V;
|
|
208
215
|
type ExactPart<T, F extends HKT<T[StrKey<T>]>> = MapOPart<T, MappedHKT<T, F>>;
|
|
216
|
+
type ExactPart1<T, F extends HKT<StrKey<T>>> = {
|
|
217
|
+
readonly [K in StrKey<T>]: App<F, K>;
|
|
218
|
+
};
|
|
219
|
+
type s$3 = string;
|
|
220
|
+
type MapKDom<RK extends MapKDom<RK, F>, F extends HKT<StrKey<RK>>> = MapO<RK, F> & {
|
|
221
|
+
readonly [P in s$3]?: readonly [keyof RK, unknown];
|
|
222
|
+
};
|
|
209
223
|
type ExactKeys<K extends string> = Exact<RORec<K, 1>, IdHKT>;
|
|
210
224
|
type MapO<T, F extends HKT<K>, K extends StrKey<T> = StrKey<T>> = MapOPart<T, F, K> & {
|
|
211
225
|
readonly [P: string]: readonly [K, unknown];
|
|
212
226
|
};
|
|
227
|
+
type MapK<K extends s$3, F extends HKT<K>> = MapO<RORec<K>, F>;
|
|
213
228
|
type MapOPart<T, F extends HKT<K>, K extends keyof T = StrKey<T>> = {
|
|
214
229
|
readonly [P in K]: readonly [P, App<F, P & string>];
|
|
215
230
|
};
|
|
231
|
+
type MapKPart1<T, F extends HKT<K>, K extends StrKey<T> = StrKey<T>> = {
|
|
232
|
+
readonly [P in K]: App<F, P>;
|
|
233
|
+
};
|
|
216
234
|
type Exact<T, F extends HKT<T[StrKey<T>]>> = MapO<T, MappedHKT<T, F>>;
|
|
217
235
|
interface MappedHKT<T, F extends HKT<T[StrKey<T>]>> extends HKT<StrKey<T>> {
|
|
218
236
|
readonly out: App<F, T[I<StrKey<T>, this>]>;
|
|
219
237
|
}
|
|
238
|
+
declare const mapExactToObject0: <T, F extends HKT<K>, G extends HKT<K>, K extends StrKey<T> = StrKey<T>>(x: MapO<T, F, K>, f: <P extends K>(v: App<F, P>, k: P) => App<G, P>) => MapKPart1<T, G, K>;
|
|
239
|
+
declare const mapExactToObject1: <K extends string, F extends HKT<K>, G extends HKT<K>>(x: MapK<K, F>, f: <P extends K>(v: App<F, P>, k: P) => App<G, P>) => MapKPart1<RORec<K>, G>;
|
|
240
|
+
interface WithKey1<K extends string, G extends HKT<K>> extends HKT<K> {
|
|
241
|
+
readonly out: readonly [I<K, this>, App<G, I<K, this>>];
|
|
242
|
+
}
|
|
243
|
+
declare const mapExact0: <T, F extends HKT<StrKey<T>>, G extends HKT<StrKey<T>>>(x: MapO<T, F>, f: <P extends StrKey<T>>(v: App<F, P>, k: P) => App<G, P>) => MapO<T, G>;
|
|
244
|
+
declare const mapExact1: <K extends s$3, F extends HKT<K>, G extends HKT<K>>(x: MapK<K, F>, f: <P extends K>(v: App<F, P>, k: P) => App<G, P>) => MapK<K, G>;
|
|
245
|
+
declare const mapExactToObject: <T, F extends HKT<T[StrKey<T>]>, G extends HKT<StrKey<T>>>(x: Exact<T, F>, f: <P extends StrKey<T>>(v: App<F, T[P]>, k: P) => App<G, P>) => ExactPart1<T, G>;
|
|
246
|
+
declare const mapExact: <T, F extends HKT<T[StrKey<T>]>, G extends HKT<T[StrKey<T>]>>(x: Exact<T, F>, f: <P extends StrKey<T>>(v: App<F, T[P]>, k: P) => App<G, T[P]>) => Exact<T, G>;
|
|
247
|
+
type Dom$1<T, V> = HKT<T[StrKey<T>] | V[StrKey<V>]>;
|
|
248
|
+
declare const spread: <T, V, F extends Dom$1<T, V>, E = unknown, No extends keyof V = never>(a: Exact<Omit<T, No>, F>, b: Exact<V, F>) => Exact<V & Omit<T, keyof V> & Pick<E, symbol & keyof E>, F>;
|
|
220
249
|
interface MergeHKT<T, V, F1 extends HKT<StrKey<Omit<T, No>>>, F2 extends HKT<StrKey<V>>, No extends keyof V = never> extends HKT<StrKey<V & Omit<T, No>>> {
|
|
221
250
|
readonly out: I<StrKey<V & Omit<T, No>>, this> extends StrKey<V> ? App<F2, I<StrKey<V>, this>> : App<F1, I<StrKey<Omit<T, No>>, this>>;
|
|
222
251
|
}
|
|
252
|
+
declare const spread0: <T, V, F1 extends HKT<StrKey<Omit<T, No>>>, F2 extends HKT<StrKey<V>>, E = unknown, No extends keyof V = never>(a: MapO<Omit<T, No>, F1>, b: MapO<V, F2>) => MapO<V & Omit<T, No> & Pick<E, symbol & keyof E>, MergeHKT<T, V, F1, F2, No>>;
|
|
223
253
|
|
|
224
254
|
declare const AccumulatorRaw: unique symbol;
|
|
225
255
|
interface AccumulatorRaw<in Doc, out T, in C = unknown> extends RawObj {
|
|
@@ -288,6 +318,9 @@ type I<Dom, F extends HKT<Dom>> = F['in'] extends (x: infer X extends Dom) => vo
|
|
|
288
318
|
interface IdHKT<Dom = unknown> extends HKT<Dom> {
|
|
289
319
|
readonly out: I<Dom, this>;
|
|
290
320
|
}
|
|
321
|
+
interface ConstHKT<Im, Dom = unknown> extends HKT<Dom, Im> {
|
|
322
|
+
readonly out: Im;
|
|
323
|
+
}
|
|
291
324
|
type AppMap<F extends HKT<Dom>, X extends readonly Dom[], Dom = unknown> = readonly App<F, Dom>[] & {
|
|
292
325
|
[I in keyof X]: App<F, X[I]>;
|
|
293
326
|
};
|
|
@@ -352,27 +385,50 @@ declare const $getField: {
|
|
|
352
385
|
<T, K extends StrKey<T>, D, C = unknown>(expr: Expr<T, D, C>, field: K): Expr<T[K], D, C>;
|
|
353
386
|
<T, K extends StrKey<T>, D, C = unknown>(expr: Expr<T | N, D, C>, field: K): Expr<T[K] | null, D, C>;
|
|
354
387
|
};
|
|
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>;
|
|
388
|
+
type AddO<T> = T extends notObj ? T : T extends Array<infer U> ? Arr<AddO<U>> : O<T>;
|
|
389
|
+
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
390
|
declare const rand: () => string;
|
|
367
391
|
declare const $rand: Expr<string, unknown, unknown>;
|
|
368
392
|
|
|
393
|
+
type AddOs<A extends readonly unknown[]> = {
|
|
394
|
+
[K in keyof A]: AddO<A[K]>;
|
|
395
|
+
};
|
|
396
|
+
type PushSides<V> = {
|
|
397
|
+
0: V[];
|
|
398
|
+
1: V[];
|
|
399
|
+
};
|
|
400
|
+
type PushDict<V> = PRRec<string, PushSides<V>>;
|
|
369
401
|
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<
|
|
402
|
+
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>;
|
|
403
|
+
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>;
|
|
404
|
+
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>;
|
|
405
|
+
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>;
|
|
406
|
+
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>;
|
|
407
|
+
declare const $entries: <D extends O, V, C = unknown>(expr: Expr<AddO<PushDict<V>>, D, C>) => Expr<AddO<{
|
|
408
|
+
k: string;
|
|
409
|
+
v: V;
|
|
410
|
+
}[]>, D, C>;
|
|
411
|
+
|
|
412
|
+
type Equal<Dom, T extends Dom, V extends Dom> = {
|
|
413
|
+
forward: <F extends HKT<Dom>>(x: App<F, T>) => App<F, V>;
|
|
414
|
+
forward1: (x: T) => V;
|
|
415
|
+
backward: <F extends HKT<Dom>>(x: App<F, V>) => App<F, T>;
|
|
416
|
+
backward1: (x: V) => T;
|
|
417
|
+
};
|
|
418
|
+
declare const sym: <Dom, T extends Dom, V extends Dom>(eq: Equal<Dom, T, V>) => Equal<Dom, V, T>;
|
|
419
|
+
declare const reflex: <Dom, T extends Dom>() => Equal<Dom, T, T>;
|
|
420
|
+
declare const eqExtends: <Im, T, U, F extends HKT<T, Im>, G extends HKT<T, Im>, H extends HKT<T, Im>, M extends Im>(_1: Equal<Im, App<F, T & U>, M | App<G, T & U>>, _2: Equal<Im, App<F, Exclude<T, U>>, M | App<H, Exclude<T, U>>>) => Equal<Im, App<F, T>, T | M extends U ? App<G, T> : App<H, T>>;
|
|
421
|
+
declare const fromEq: <Dom, T extends Dom, V extends Dom>(eq: Pick<Equal<Dom, T, V>, "forward" | "backward">) => Equal<Dom, T, V>;
|
|
422
|
+
declare const literalsEqaul: <T extends keyof any | boolean | N, V extends T>(_: AsLiteral<T> & V) => Equal<T, T, V>;
|
|
423
|
+
declare const omitRORec: <K extends string, E extends string, R extends string, T extends unknown>() => Equal<unknown, RORec<Exclude<K, E | R>, T>, Omit<RORec<Exclude<K, E | R>, T>, R>>;
|
|
424
|
+
type s$2 = keyof any;
|
|
425
|
+
declare const omitPick: <K extends s$2, E extends s$2, R extends s$2, T extends RORec<Exclude<K, E | R>, unknown>>() => Equal<unknown, Pick<T, Exclude<K, E | R>>, Omit<Pick<T, Exclude<K, E | R>>, R>>;
|
|
426
|
+
declare const omitExclude: <K extends s$2, E extends s$2, R extends s$2, T extends RORec<Exclude<K, E | R>, unknown>>() => Equal<unknown, Omit<T, E & Exclude<K, keyof T>>, Omit<Pick<T, Exclude<K, E | R>>, R>>;
|
|
427
|
+
declare const renamedFields: <K extends s$2, F extends HKT<K, s$2>, G extends HKT<App<F, K>>>() => Equal<string | number | symbol, keyof { [P in K as App<F, P>]: App<G, P>; }, App<F, K>>;
|
|
428
|
+
declare const translateOmit: <T, K extends string, Q extends string, P extends string>() => Equal<unknown, Omit<Omit<T, K | Q>, P>, Omit<Omit<T, K | Q>, Q | P>>;
|
|
429
|
+
declare const excludeIdem: <K extends s$2, E extends s$2, S extends E = E>() => Equal<Exclude<K, E>, Exclude<K, E>, Exclude<Exclude<K, E>, S>>;
|
|
430
|
+
declare const eqPar: <K extends string, T extends Rec<K, jsonItem>, K2 extends K>() => Equal<unknown, Par$1<K2, T>, Par$1<K, T>>;
|
|
431
|
+
declare const notExtendExcluded: <Key extends keyof any, Others extends keyof any, Source extends keyof any, Denied extends keyof any, F extends HKT<Others | Exclude<Source, Denied | Key>, Dom>, Else extends Dom, Dom = unknown>() => Equal<Dom, Key extends Others | Exclude<Source, Key | Denied> ? App<F, Key> : Else, Key extends Others ? App<F, Key> : Else>;
|
|
376
432
|
|
|
377
433
|
type DeltaPipe<Q extends O, T extends Q, F extends HKT<O2>, G extends HKT<O3>> = {
|
|
378
434
|
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>;
|
|
@@ -543,9 +599,7 @@ declare const createIndex: (collection: {
|
|
|
543
599
|
}, indexSpec: IndexSpecification, op?: CreateIndexesOptions) => Promise<void>;
|
|
544
600
|
|
|
545
601
|
declare const noop: () => void;
|
|
546
|
-
declare const map1: <K extends string, Im>(k: AsLiteral<K>, to: Im) =>
|
|
547
|
-
readonly [_: string]: [K, Im];
|
|
548
|
-
};
|
|
602
|
+
declare const map1: <K extends string, Im>(k: AsLiteral<K>, to: Im) => MapO<RORec<K, Im>, ConstHKT<Im>, K>;
|
|
549
603
|
|
|
550
604
|
declare const $group_: <V extends O>() => <ID, T extends O, C = unknown>(id: Expr<ID, T, C>, args: Accumulators<T, V, C>) => RawStages<O, T, Rec<"_id", ID> & V, C, 1>;
|
|
551
605
|
|
|
@@ -737,5 +791,5 @@ declare const enablePreAndPostImages: <T extends doc>(coll: Collection<T>) => Pr
|
|
|
737
791
|
declare const prepare: (testName?: string) => Promise<MongoClient$1>;
|
|
738
792
|
declare const makeCol: <T extends ID>(docs: readonly OptionalUnlessRequiredId<T>[], database: Db, name?: string) => Promise<Collection<T>>;
|
|
739
793
|
|
|
740
|
-
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,
|
|
794
|
+
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, eqExtends, eqPar, eqTyped, except, excludeIdem, exprMapVal, field, fieldF, fieldM, filter, filterDefined, first, firstSure, floor, from, fromEq, func, getWhenMatched, getWhenMatchedForMerge, gt, gte, inArray, isArray, ite, joinIdOf, last, literalsEqaul, log, lt, lte, makeCol, map, map1, mapExact, mapExact0, mapExact1, mapExactToObject, mapExactToObject0, mapExactToObject1, mapFromPlainDateTime, mapToPlainDateTime, mapVal, matchDelta, max, maxDate, mergeExact, mergeExact0, mergeExpr, mergeObjects, minDate, monthPart, multiply, ne, nil, noop, not, notExtendExcluded, notNull, now, omitExclude, omitPick, omitRORec, or, padLeft, pair, prepare, rand, range, reflex, regex, renamedFields, root, set, setField, single, size, slice, sortArray, spread, spread0, staging, startOf, str, sub, subtract, sym, to, toInt, translateOmit, val, weekPart, wrap, year };
|
|
795
|
+
export type { Accumulators, AddO, Arr, AsLiteral, Delta, DeltaAccumulator, DeltaAccumulators, DeltaStages, Equal, Exact, ExactKeys, ExactPart, ExactPart1, ExprHKT, Exprs, ExprsExact, ExprsExactHKT, ExprsPart, ID, JoinId, Loose, MapK, MapKDom, MapKPart1, MapO, MapOPart, MappedHKT, Merge, MergeArgs, MergeHKT, MergeInto, MergeMapOArgs, Model, MongoTypeNames, N, NullToOBJ, O, OPick, OPickD, Patch, RORec, RawStages, Rec, Replace, SnapshotStreamExecutionResult, StrKey, Strict, TS, WithKey1, 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
|
});
|
|
@@ -408,17 +409,35 @@ const fieldF = () => (exprs) => Object.keys(exprs).length
|
|
|
408
409
|
: val({});
|
|
409
410
|
const field = fieldF();
|
|
410
411
|
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
forward:
|
|
412
|
+
const sym = (eq) => ({
|
|
413
|
+
backward: eq.forward,
|
|
414
|
+
forward: eq.backward,
|
|
415
|
+
backward1: eq.forward1,
|
|
416
|
+
forward1: eq.backward1,
|
|
417
|
+
});
|
|
418
|
+
const reflex = () => ({
|
|
414
419
|
backward: id,
|
|
415
|
-
|
|
420
|
+
forward: id,
|
|
416
421
|
backward1: id,
|
|
422
|
+
forward1: id,
|
|
423
|
+
});
|
|
424
|
+
const id = (x) => x;
|
|
425
|
+
const assertEqual = () => reflex();
|
|
426
|
+
const eqExtends = (_1, _2) => assertEqual();
|
|
427
|
+
const fromEq = (eq) => ({
|
|
428
|
+
...eq,
|
|
429
|
+
backward1: (eq.backward),
|
|
430
|
+
forward1: (eq.forward),
|
|
417
431
|
});
|
|
418
432
|
const literalsEqaul = (_) => assertEqual();
|
|
419
433
|
const omitRORec = () => assertEqual();
|
|
420
434
|
const omitPick = () => assertEqual();
|
|
435
|
+
const omitExclude = () => assertEqual();
|
|
436
|
+
const renamedFields = () => assertEqual();
|
|
421
437
|
const translateOmit = () => assertEqual();
|
|
438
|
+
const excludeIdem = () => assertEqual();
|
|
439
|
+
const eqPar = () => assertEqual();
|
|
440
|
+
const notExtendExcluded = () => assertEqual();
|
|
422
441
|
|
|
423
442
|
const size = (expr) => asExpr({
|
|
424
443
|
raw: f => asExprRaw({ $size: expr.raw(f).get() }),
|
|
@@ -2455,4 +2474,4 @@ const makeCol = async (docs, database, name) => {
|
|
|
2455
2474
|
}
|
|
2456
2475
|
};
|
|
2457
2476
|
|
|
2458
|
-
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, Field, Machine, 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$1 as 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 };
|
|
2477
|
+
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, Field, Machine, add, and, anyElementTrue, array, ceil, comp, concat, concatArray, createIndex, ctx, current, dateAdd, dateDiff, dateLt, datePart, dayAndMonthPart, divide, emptyDelta, enablePreAndPostImages, eq, eqExtends, eqPar, eqTyped, except, excludeIdem, exprMapVal, field, fieldF, fieldM, filter, filterDefined, first$1 as first, firstSure, floor, from, fromEq, func, getWhenMatched, getWhenMatchedForMerge, gt, gte, inArray, isArray, ite, joinIdOf, last, literalsEqaul, log, lt, lte, makeCol, map, map1, mapExact, mapExact0, mapExact1, mapExactToObject, mapExactToObject0, mapExactToObject1, mapFromPlainDateTime, mapToPlainDateTime, mapVal, matchDelta, max, maxDate, mergeExact, mergeExact0, mergeExpr, mergeObjects, minDate, monthPart, multiply, ne, nil, noop, not, notExtendExcluded, notNull, now, omitExclude, omitPick, omitRORec, or, padLeft, pair, prepare, rand, range, reflex, regex, renamedFields, root, set, setField, single, size, slice, sortArray, spread, spread0, staging, startOf, str, sub, subtract, sym, to, toInt, translateOmit, val, weekPart, wrap, year };
|
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
|
});
|
|
@@ -410,17 +411,35 @@ const fieldF = () => (exprs) => Object.keys(exprs).length
|
|
|
410
411
|
: val({});
|
|
411
412
|
const field = fieldF();
|
|
412
413
|
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
forward:
|
|
414
|
+
const sym = (eq) => ({
|
|
415
|
+
backward: eq.forward,
|
|
416
|
+
forward: eq.backward,
|
|
417
|
+
backward1: eq.forward1,
|
|
418
|
+
forward1: eq.backward1,
|
|
419
|
+
});
|
|
420
|
+
const reflex = () => ({
|
|
416
421
|
backward: id,
|
|
417
|
-
|
|
422
|
+
forward: id,
|
|
418
423
|
backward1: id,
|
|
424
|
+
forward1: id,
|
|
425
|
+
});
|
|
426
|
+
const id = (x) => x;
|
|
427
|
+
const assertEqual = () => reflex();
|
|
428
|
+
const eqExtends = (_1, _2) => assertEqual();
|
|
429
|
+
const fromEq = (eq) => ({
|
|
430
|
+
...eq,
|
|
431
|
+
backward1: (eq.backward),
|
|
432
|
+
forward1: (eq.forward),
|
|
419
433
|
});
|
|
420
434
|
const literalsEqaul = (_) => assertEqual();
|
|
421
435
|
const omitRORec = () => assertEqual();
|
|
422
436
|
const omitPick = () => assertEqual();
|
|
437
|
+
const omitExclude = () => assertEqual();
|
|
438
|
+
const renamedFields = () => assertEqual();
|
|
423
439
|
const translateOmit = () => assertEqual();
|
|
440
|
+
const excludeIdem = () => assertEqual();
|
|
441
|
+
const eqPar = () => assertEqual();
|
|
442
|
+
const notExtendExcluded = () => assertEqual();
|
|
424
443
|
|
|
425
444
|
const size = (expr) => asExpr({
|
|
426
445
|
raw: f => asExprRaw({ $size: expr.raw(f).get() }),
|
|
@@ -2534,8 +2553,11 @@ exports.divide = divide;
|
|
|
2534
2553
|
exports.emptyDelta = emptyDelta;
|
|
2535
2554
|
exports.enablePreAndPostImages = enablePreAndPostImages;
|
|
2536
2555
|
exports.eq = eq;
|
|
2556
|
+
exports.eqExtends = eqExtends;
|
|
2557
|
+
exports.eqPar = eqPar;
|
|
2537
2558
|
exports.eqTyped = eqTyped;
|
|
2538
2559
|
exports.except = except;
|
|
2560
|
+
exports.excludeIdem = excludeIdem;
|
|
2539
2561
|
exports.exprMapVal = exprMapVal;
|
|
2540
2562
|
exports.field = field;
|
|
2541
2563
|
exports.fieldF = fieldF;
|
|
@@ -2546,6 +2568,7 @@ exports.first = first$1;
|
|
|
2546
2568
|
exports.firstSure = firstSure;
|
|
2547
2569
|
exports.floor = floor;
|
|
2548
2570
|
exports.from = from;
|
|
2571
|
+
exports.fromEq = fromEq;
|
|
2549
2572
|
exports.func = func;
|
|
2550
2573
|
exports.getWhenMatched = getWhenMatched;
|
|
2551
2574
|
exports.getWhenMatchedForMerge = getWhenMatchedForMerge;
|
|
@@ -2556,11 +2579,19 @@ exports.isArray = isArray;
|
|
|
2556
2579
|
exports.ite = ite;
|
|
2557
2580
|
exports.joinIdOf = joinIdOf;
|
|
2558
2581
|
exports.last = last;
|
|
2582
|
+
exports.literalsEqaul = literalsEqaul;
|
|
2559
2583
|
exports.log = log;
|
|
2560
2584
|
exports.lt = lt;
|
|
2561
2585
|
exports.lte = lte;
|
|
2562
2586
|
exports.makeCol = makeCol;
|
|
2587
|
+
exports.map = map;
|
|
2563
2588
|
exports.map1 = map1;
|
|
2589
|
+
exports.mapExact = mapExact;
|
|
2590
|
+
exports.mapExact0 = mapExact0;
|
|
2591
|
+
exports.mapExact1 = mapExact1;
|
|
2592
|
+
exports.mapExactToObject = mapExactToObject;
|
|
2593
|
+
exports.mapExactToObject0 = mapExactToObject0;
|
|
2594
|
+
exports.mapExactToObject1 = mapExactToObject1;
|
|
2564
2595
|
exports.mapFromPlainDateTime = mapFromPlainDateTime;
|
|
2565
2596
|
exports.mapToPlainDateTime = mapToPlainDateTime;
|
|
2566
2597
|
exports.mapVal = mapVal;
|
|
@@ -2578,15 +2609,21 @@ exports.ne = ne;
|
|
|
2578
2609
|
exports.nil = nil;
|
|
2579
2610
|
exports.noop = noop;
|
|
2580
2611
|
exports.not = not;
|
|
2612
|
+
exports.notExtendExcluded = notExtendExcluded;
|
|
2581
2613
|
exports.notNull = notNull;
|
|
2582
2614
|
exports.now = now;
|
|
2615
|
+
exports.omitExclude = omitExclude;
|
|
2616
|
+
exports.omitPick = omitPick;
|
|
2617
|
+
exports.omitRORec = omitRORec;
|
|
2583
2618
|
exports.or = or;
|
|
2584
2619
|
exports.padLeft = padLeft;
|
|
2585
2620
|
exports.pair = pair;
|
|
2586
2621
|
exports.prepare = prepare;
|
|
2587
2622
|
exports.rand = rand;
|
|
2588
2623
|
exports.range = range;
|
|
2624
|
+
exports.reflex = reflex;
|
|
2589
2625
|
exports.regex = regex;
|
|
2626
|
+
exports.renamedFields = renamedFields;
|
|
2590
2627
|
exports.root = root;
|
|
2591
2628
|
exports.set = set;
|
|
2592
2629
|
exports.setField = setField;
|
|
@@ -2594,13 +2631,17 @@ exports.single = single;
|
|
|
2594
2631
|
exports.size = size;
|
|
2595
2632
|
exports.slice = slice;
|
|
2596
2633
|
exports.sortArray = sortArray;
|
|
2634
|
+
exports.spread = spread;
|
|
2635
|
+
exports.spread0 = spread0;
|
|
2597
2636
|
exports.staging = staging;
|
|
2598
2637
|
exports.startOf = startOf;
|
|
2599
2638
|
exports.str = str;
|
|
2600
2639
|
exports.sub = sub;
|
|
2601
2640
|
exports.subtract = subtract;
|
|
2641
|
+
exports.sym = sym;
|
|
2602
2642
|
exports.to = to;
|
|
2603
2643
|
exports.toInt = toInt;
|
|
2644
|
+
exports.translateOmit = translateOmit;
|
|
2604
2645
|
exports.val = val;
|
|
2605
2646
|
exports.weekPart = weekPart;
|
|
2606
2647
|
exports.wrap = wrap;
|