@omegup/msync 0.0.60 → 0.0.61

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 CHANGED
@@ -614,6 +614,11 @@ declare const setField: <K extends string, T, V, D, C>({ field, input, value, }:
614
614
  }) => Expr<T & Record<K, V>, D, C>;
615
615
 
616
616
  declare const range: <D, C>(start: Expr<number, D, C>, end: Expr<number, D, C>, step?: Expr<number, D, C>) => Expr<Arr<number>, D, C>;
617
+ declare const $map0: <K extends string, T, R, D, C>({ as, expr, input, }: {
618
+ input: Expr<Arr<T>, D, C>;
619
+ as: K;
620
+ expr: Expr<R, D, RORec<K, T> & C>;
621
+ }) => Expr<Arr<R>, D, C>;
617
622
  declare const $map1: <T, R, D, C>(ex: Expr<Arr<T>, D, C>, map: (i: Field<unknown, T, RORec<"item", T>>) => Expr<R, D, RORec<"item", T> & C>) => Expr<Arr<R>, D, C>;
618
623
  declare const $map: <T, R, D, C = unknown>(ex: Expr<Arr<T>, D, C>, map: (i: Expr<T, D, RORec<"item", T>>) => Expr<R, D, RORec<"item", T> & C>) => Expr<Arr<R>, D, C>;
619
624
 
@@ -677,4 +682,4 @@ declare const enablePreAndPostImages: <T extends doc>(coll: Collection<T>) => Pr
677
682
  declare const prepare: (testName?: string) => Promise<MongoClient$1>;
678
683
  declare const makeCol: <T extends ID>(docs: readonly OptionalUnlessRequiredId<T>[], database: Db, name?: string) => Promise<Collection<T>>;
679
684
 
680
- export { $accumulator, $and, $countDict, $entries, $eq, $exists, $expr, $getField, $group, $groupId, $groupMerge, $gt, $gtTs, $gte, $gteTs, $ifNull, $in, $insert, $insertX, $keys, $let, $lookup, $lt, $lte, $map, $map1, $match, $matchDelta, $merge, $merge_, $ne, $nin, $nor, $or, $outerLookup, $pushDict, $rand, $replaceWith, $set, $simpleInsert, $simpleMerge, $sum, $type, $unwind, $unwindDelta, type Accumulators, type Arr, type AsLiteral, type Delta, type DeltaAccumulator, type DeltaAccumulators, Expr, type ExprHKT, type Exprs, type ExprsExact, type ExprsExactHKT, type ExprsPart, Field, type ID, type Loose, Machine, type Merge, type MergeArgs, type MergeInto, type MergeMapOArgs, type Model, type MongoTypeNames, type N, type NoRaw, type NullToOBJ, type O, type OPick, type OPickD, type RONoRaw, type RORec, type RawStages, type Rec, type Replace, type SnapshotStreamExecutionResult, type StrKey, type Strict, type TS, Type, type WriteonlyCollection, add, and, anyElementTrue, array, ceil, comp, concat, concatArray, createIndex, ctx, current, dateAdd, dateDiff, dateLt, datePart, dayAndMonthPart, divide, type doc, enablePreAndPostImages, eq, eqTyped, except, exprMapVal, field, fieldF, fieldM, filter, filterDefined, first, firstSure, floor, from, func, gt, gte, isArray, ite, last, log, lt, lte, makeCol, map1, mapVal, max, maxDate, mergeExact, mergeExact0, mergeExpr, mergeObjects, minDate, monthPart, multiply, ne, nil, noop, not, type notArr, notNull, now, or, pair, prepare, rand, range, regex, root, set, setField, size, slice, sortArray, staging, startOf, str, sub, subtract, to, toInt, val, weekPart, wrap, year };
685
+ export { $accumulator, $and, $countDict, $entries, $eq, $exists, $expr, $getField, $group, $groupId, $groupMerge, $gt, $gtTs, $gte, $gteTs, $ifNull, $in, $insert, $insertX, $keys, $let, $lookup, $lt, $lte, $map, $map0, $map1, $match, $matchDelta, $merge, $merge_, $ne, $nin, $nor, $or, $outerLookup, $pushDict, $rand, $replaceWith, $set, $simpleInsert, $simpleMerge, $sum, $type, $unwind, $unwindDelta, type Accumulators, type Arr, type AsLiteral, type Delta, type DeltaAccumulator, type DeltaAccumulators, Expr, type ExprHKT, type Exprs, type ExprsExact, type ExprsExactHKT, type ExprsPart, Field, type ID, type Loose, Machine, type Merge, type MergeArgs, type MergeInto, type MergeMapOArgs, type Model, type MongoTypeNames, type N, type NoRaw, type NullToOBJ, type O, type OPick, type OPickD, type RONoRaw, type RORec, type RawStages, type Rec, type Replace, type SnapshotStreamExecutionResult, type StrKey, type Strict, type TS, Type, type WriteonlyCollection, add, and, anyElementTrue, array, ceil, comp, concat, concatArray, createIndex, ctx, current, dateAdd, dateDiff, dateLt, datePart, dayAndMonthPart, divide, type doc, enablePreAndPostImages, eq, eqTyped, except, exprMapVal, field, fieldF, fieldM, filter, filterDefined, first, firstSure, floor, from, func, gt, gte, isArray, ite, last, log, lt, lte, makeCol, map1, mapVal, max, maxDate, mergeExact, mergeExact0, mergeExpr, mergeObjects, minDate, monthPart, multiply, ne, nil, noop, not, type notArr, notNull, now, or, pair, prepare, rand, range, regex, root, set, setField, size, slice, sortArray, staging, startOf, str, sub, subtract, to, toInt, val, weekPart, wrap, year };
package/index.esm.js CHANGED
@@ -882,15 +882,16 @@ const dateDiff = ({ end, unit, start, }) => asExpr({
882
882
  const range = (start, end, step) => asExpr({
883
883
  raw: f => asExprRaw({ $range: [start.raw(f).get(), end.raw(f).get(), step?.raw(f).get() ?? 1] }),
884
884
  });
885
- const $map1 = (ex, map) => asExpr({
885
+ const $map0 = ({ as, expr, input, }) => asExpr({
886
886
  raw: f => asExprRaw({
887
887
  $map: {
888
- input: ex.raw(f).get(),
889
- as: 'item',
890
- in: map(ctx()('item')).raw(f).get(),
888
+ input: input.raw(f).get(),
889
+ as,
890
+ in: expr.raw(f).get(),
891
891
  },
892
892
  }),
893
893
  });
894
+ const $map1 = (ex, map) => $map0({ input: ex, as: 'item', expr: map(ctx()('item')) });
894
895
  const $map = (ex, map) => $map1(ex, i => map(i.expr()));
895
896
 
896
897
  const operator = () => (op) => (operand) => {
@@ -1850,4 +1851,4 @@ const makeCol = async (docs, database, name) => {
1850
1851
  }
1851
1852
  };
1852
1853
 
1853
- export { $accumulator, $and, $countDict, $entries, $eq, $exists, $expr, $getField, $group, $groupId, $groupMerge, $gt, $gtTs, $gte, $gteTs, $ifNull, $in, $insert, $insertX, $keys, $let, $lookup, $lt, $lte, $map, $map1, $match, $matchDelta, $merge, $merge_, $ne, $nin, $nor, $or, $outerLookup, $pushDict, $rand, $replaceWith, $set, $simpleInsert, $simpleMerge, $sum, $type, $unwind, $unwindDelta, Field, Machine, add, and, anyElementTrue, array, ceil, comp, concat$1 as concat, concatArray, createIndex, ctx, current, dateAdd, dateDiff, dateLt, datePart, dayAndMonthPart, divide, enablePreAndPostImages, eq, eqTyped, except, exprMapVal, field, fieldF, fieldM, filter, filterDefined, first$1 as first, firstSure, floor, from, func, gt, gte, isArray, ite, last, log, lt, lte, makeCol, map1, mapVal, max, maxDate, mergeExact, mergeExact0, mergeExpr, mergeObjects, minDate, monthPart, multiply, ne, nil, noop, not, notNull, now, or, pair, prepare, rand, range, regex, root, set, setField, size, slice, sortArray, staging, startOf, str, sub, subtract, to, toInt, val, weekPart, wrap, year };
1854
+ export { $accumulator, $and, $countDict, $entries, $eq, $exists, $expr, $getField, $group, $groupId, $groupMerge, $gt, $gtTs, $gte, $gteTs, $ifNull, $in, $insert, $insertX, $keys, $let, $lookup, $lt, $lte, $map, $map0, $map1, $match, $matchDelta, $merge, $merge_, $ne, $nin, $nor, $or, $outerLookup, $pushDict, $rand, $replaceWith, $set, $simpleInsert, $simpleMerge, $sum, $type, $unwind, $unwindDelta, Field, Machine, add, and, anyElementTrue, array, ceil, comp, concat$1 as concat, concatArray, createIndex, ctx, current, dateAdd, dateDiff, dateLt, datePart, dayAndMonthPart, divide, enablePreAndPostImages, eq, eqTyped, except, exprMapVal, field, fieldF, fieldM, filter, filterDefined, first$1 as first, firstSure, floor, from, func, gt, gte, isArray, ite, last, log, lt, lte, makeCol, map1, mapVal, max, maxDate, mergeExact, mergeExact0, mergeExpr, mergeObjects, minDate, monthPart, multiply, ne, nil, noop, not, notNull, now, or, pair, prepare, rand, range, regex, root, set, setField, size, slice, sortArray, staging, startOf, str, sub, subtract, to, toInt, val, weekPart, wrap, year };
package/index.js CHANGED
@@ -884,15 +884,16 @@ const dateDiff = ({ end, unit, start, }) => asExpr({
884
884
  const range = (start, end, step) => asExpr({
885
885
  raw: f => asExprRaw({ $range: [start.raw(f).get(), end.raw(f).get(), step?.raw(f).get() ?? 1] }),
886
886
  });
887
- const $map1 = (ex, map) => asExpr({
887
+ const $map0 = ({ as, expr, input, }) => asExpr({
888
888
  raw: f => asExprRaw({
889
889
  $map: {
890
- input: ex.raw(f).get(),
891
- as: 'item',
892
- in: map(ctx()('item')).raw(f).get(),
890
+ input: input.raw(f).get(),
891
+ as,
892
+ in: expr.raw(f).get(),
893
893
  },
894
894
  }),
895
895
  });
896
+ const $map1 = (ex, map) => $map0({ input: ex, as: 'item', expr: map(ctx()('item')) });
896
897
  const $map = (ex, map) => $map1(ex, i => map(i.expr()));
897
898
 
898
899
  const operator = () => (op) => (operand) => {
@@ -1877,6 +1878,7 @@ exports.$lookup = $lookup;
1877
1878
  exports.$lt = $lt;
1878
1879
  exports.$lte = $lte;
1879
1880
  exports.$map = $map;
1881
+ exports.$map0 = $map0;
1880
1882
  exports.$map1 = $map1;
1881
1883
  exports.$match = $match;
1882
1884
  exports.$matchDelta = $matchDelta;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "module": "index.esm.js",
4
4
  "typings": "index.d.ts",
5
5
  "name": "@omegup/msync",
6
- "version": "0.0.60",
6
+ "version": "0.0.61",
7
7
  "dependencies": {
8
8
  "dayjs": "^1.11.9",
9
9
  "dotenv": "^16.3.1",