@omegup/msync 0.0.58 → 0.0.60

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
@@ -187,7 +187,7 @@ type DeltaAccumulator<in out Doc, in out T, in out Ctx = unknown> = {
187
187
  };
188
188
 
189
189
  declare const concat: <D, C>(...expr: Expr<string, D, C>[]) => Expr<string, D, C>;
190
- declare const regex: <D, C>(expr: Expr<string, D, C>, regex: string, options?: string) => Expr<boolean, D, C>;
190
+ declare const regex: <D, C>(expr: Expr<string, D, C>, regex: Expr<string, D, C>, options?: Expr<string, D, C>) => Expr<boolean, D, C>;
191
191
  declare const str: <D, C>(expr: Expr<unknown, D, C>) => Expr<string, D, C>;
192
192
  declare const toInt: <D, C>(expr: Expr<unknown, D, C>) => Expr<number, D, C>;
193
193
  declare const fieldM: <M extends RORec<Dom, Ref>, T extends RORec<Ref, unknown>, D, Dom extends string = StrKey<M>, Ref extends string = StrKey<T>, C = unknown>(expr: { readonly [K in Ref]: Expr<T[K], D, C>; }, m: Pick<M, Dom>) => Expr<O<{ readonly [K in Dom]: T[M[K]]; }>, D, C>;
@@ -572,7 +572,7 @@ declare const firstSure: <T, D, C>(expr: Expr<Arr<T>, D, C>) => Expr<T, D, C>;
572
572
  declare const last: <T, D, C>(expr: Expr<Arr<T>, D, C>) => Expr<T | null, D, C>;
573
573
  type NullToOBJ<N extends null> = N extends null ? O : N;
574
574
  declare const mergeObjects: <T1, T2, D, C = unknown, N extends null = never>(exprs_0: Expr<T1 | N, D, C>, exprs_1: Expr<T2, D, C>) => Expr<(T1 | NullToOBJ<N>) & T2, D, C>;
575
- declare const inArray: <T, D, C = unknown>(exprs_0: Expr<T, D, C>, exprs_1: Expr<Arr<T>, D, C>) => Expr<boolean, D, C>;
575
+ declare const anyElementTrue: <T, D, C = unknown>(expr: Expr<Arr<boolean>, D, C>) => Expr<boolean, D, C>;
576
576
  declare const slice: <T, D, C>(array: Expr<Arr<T>, D, C>, start: Expr<number, D, C>, end: Expr<number, D, C>) => Expr<Arr<T>, D, C>;
577
577
  declare const except: <T, D, C>(a: Expr<Arr<T>, D, C>, b: Expr<Arr<T>, D, C>) => Expr<Arr<T>, D, C>;
578
578
 
@@ -677,4 +677,4 @@ declare const enablePreAndPostImages: <T extends doc>(coll: Collection<T>) => Pr
677
677
  declare const prepare: (testName?: string) => Promise<MongoClient$1>;
678
678
  declare const makeCol: <T extends ID>(docs: readonly OptionalUnlessRequiredId<T>[], database: Db, name?: string) => Promise<Collection<T>>;
679
679
 
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, 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, inArray, 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 };
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 };
package/index.esm.js CHANGED
@@ -298,7 +298,13 @@ const concat$1 = (...expr) => asExpr({
298
298
  raw: f => asExprRaw({ $concat: expr.map(e => e.raw(f).get()) }),
299
299
  });
300
300
  const regex = (expr, regex, options) => asExpr({
301
- raw: f => asExprRaw({ $regexMatch: { input: expr.raw(f).get(), regex, options } }),
301
+ raw: f => asExprRaw({
302
+ $regexMatch: {
303
+ input: expr.raw(f).get(),
304
+ regex: regex.raw(f).get(),
305
+ options: options?.raw(f).get(),
306
+ },
307
+ }),
302
308
  });
303
309
  const str = (expr) => asExpr({
304
310
  raw: f => asExprRaw({ $toString: expr.raw(f).get() }),
@@ -402,8 +408,8 @@ const last = (expr) => asExpr({
402
408
  const mergeObjects = (...exprs) => asExpr({
403
409
  raw: f => asExprRaw({ $mergeObjects: exprs.map(x => x.raw(f).get()) }),
404
410
  });
405
- const inArray = (...exprs) => asExpr({
406
- raw: f => asExprRaw({ $in: exprs.map(x => x.raw(f).get()) }),
411
+ const anyElementTrue = (expr) => asExpr({
412
+ raw: f => asExprRaw({ $anyElementTrue: expr.raw(f).get() }),
407
413
  });
408
414
  const reduce = (input, initialValue, inExpr) => asExpr({
409
415
  raw: f => asExprRaw({
@@ -1844,4 +1850,4 @@ const makeCol = async (docs, database, name) => {
1844
1850
  }
1845
1851
  };
1846
1852
 
1847
- 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, 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, inArray, 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 };
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 };
package/index.js CHANGED
@@ -300,7 +300,13 @@ const concat$1 = (...expr) => asExpr({
300
300
  raw: f => asExprRaw({ $concat: expr.map(e => e.raw(f).get()) }),
301
301
  });
302
302
  const regex = (expr, regex, options) => asExpr({
303
- raw: f => asExprRaw({ $regexMatch: { input: expr.raw(f).get(), regex, options } }),
303
+ raw: f => asExprRaw({
304
+ $regexMatch: {
305
+ input: expr.raw(f).get(),
306
+ regex: regex.raw(f).get(),
307
+ options: options?.raw(f).get(),
308
+ },
309
+ }),
304
310
  });
305
311
  const str = (expr) => asExpr({
306
312
  raw: f => asExprRaw({ $toString: expr.raw(f).get() }),
@@ -404,8 +410,8 @@ const last = (expr) => asExpr({
404
410
  const mergeObjects = (...exprs) => asExpr({
405
411
  raw: f => asExprRaw({ $mergeObjects: exprs.map(x => x.raw(f).get()) }),
406
412
  });
407
- const inArray = (...exprs) => asExpr({
408
- raw: f => asExprRaw({ $in: exprs.map(x => x.raw(f).get()) }),
413
+ const anyElementTrue = (expr) => asExpr({
414
+ raw: f => asExprRaw({ $anyElementTrue: expr.raw(f).get() }),
409
415
  });
410
416
  const reduce = (input, initialValue, inExpr) => asExpr({
411
417
  raw: f => asExprRaw({
@@ -1895,6 +1901,7 @@ exports.Field = Field;
1895
1901
  exports.Machine = Machine;
1896
1902
  exports.add = add;
1897
1903
  exports.and = and;
1904
+ exports.anyElementTrue = anyElementTrue;
1898
1905
  exports.array = array;
1899
1906
  exports.ceil = ceil;
1900
1907
  exports.comp = comp;
@@ -1926,7 +1933,6 @@ exports.from = from;
1926
1933
  exports.func = func;
1927
1934
  exports.gt = gt;
1928
1935
  exports.gte = gte;
1929
- exports.inArray = inArray;
1930
1936
  exports.isArray = isArray;
1931
1937
  exports.ite = ite;
1932
1938
  exports.last = last;
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.58",
6
+ "version": "0.0.60",
7
7
  "dependencies": {
8
8
  "dayjs": "^1.11.9",
9
9
  "dotenv": "^16.3.1",