@omegup/msync 0.0.57 → 0.0.58

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,6 +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
191
  declare const str: <D, C>(expr: Expr<unknown, D, C>) => Expr<string, D, C>;
191
192
  declare const toInt: <D, C>(expr: Expr<unknown, D, C>) => Expr<number, D, C>;
192
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>;
@@ -597,6 +598,7 @@ declare const ite: {
597
598
  };
598
599
  declare const and: <D, C = unknown>(...expr: Expr<boolean, D, C>[]) => Expr<boolean, D, C>;
599
600
  declare const or: <D, C = unknown>(...expr: Expr<boolean, D, C>[]) => Expr<boolean, D, C>;
601
+ declare const not: <D, C = unknown>(expr: Expr<boolean, D, C>) => Expr<boolean, D, C>;
600
602
  declare const eq: <T, D, C = unknown>(a: Expr<T, D, C>) => (b: Expr<T, D, C>) => Expr<boolean, D, C>;
601
603
  declare const sub: <T, D, Ctx, P extends O>(a: Expr<T, D, Ctx>, f: Field<P, D, Ctx>) => Expr<T, P, Ctx>;
602
604
  declare const eqTyped: <T1 extends Dom, T2 extends Dom, F extends HKT<Dom>, C = unknown, Dom = unknown>(a: Expr<T1 | T2, App<F, T1 | T2>, C>, b: Expr<T1, App<F, T1 | T2>, C>) => BoolExpr<App<F, T1>, App<F, T2>, C>;
@@ -675,4 +677,4 @@ declare const enablePreAndPostImages: <T extends doc>(coll: Collection<T>) => Pr
675
677
  declare const prepare: (testName?: string) => Promise<MongoClient$1>;
676
678
  declare const makeCol: <T extends ID>(docs: readonly OptionalUnlessRequiredId<T>[], database: Db, name?: string) => Promise<Collection<T>>;
677
679
 
678
- 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, type notArr, notNull, now, or, pair, prepare, rand, range, 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, 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 };
package/index.esm.js CHANGED
@@ -133,6 +133,9 @@ const and = (...expr) => asExpr({
133
133
  const or = (...expr) => asExpr({
134
134
  raw: f => asExprRaw({ $or: expr.map(e => e.raw(f).get()) }),
135
135
  });
136
+ const not = (expr) => asExpr({
137
+ raw: f => asExprRaw({ $not: expr.raw(f).get() }),
138
+ });
136
139
  const eq = (a) => (b) => asExpr({
137
140
  raw: f => asExprRaw({ $eq: [a.raw(f).get(), b.raw(f).get()] }),
138
141
  });
@@ -294,6 +297,9 @@ const $entries = (expr) => func(function (obj) {
294
297
  const concat$1 = (...expr) => asExpr({
295
298
  raw: f => asExprRaw({ $concat: expr.map(e => e.raw(f).get()) }),
296
299
  });
300
+ const regex = (expr, regex, options) => asExpr({
301
+ raw: f => asExprRaw({ $regexMatch: { input: expr.raw(f).get(), regex, options } }),
302
+ });
297
303
  const str = (expr) => asExpr({
298
304
  raw: f => asExprRaw({ $toString: expr.raw(f).get() }),
299
305
  });
@@ -1838,4 +1844,4 @@ const makeCol = async (docs, database, name) => {
1838
1844
  }
1839
1845
  };
1840
1846
 
1841
- 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, notNull, now, or, pair, prepare, rand, range, root, set, setField, size, slice, sortArray, staging, startOf, str, sub, subtract, to, toInt, val, weekPart, wrap, year };
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 };
package/index.js CHANGED
@@ -135,6 +135,9 @@ const and = (...expr) => asExpr({
135
135
  const or = (...expr) => asExpr({
136
136
  raw: f => asExprRaw({ $or: expr.map(e => e.raw(f).get()) }),
137
137
  });
138
+ const not = (expr) => asExpr({
139
+ raw: f => asExprRaw({ $not: expr.raw(f).get() }),
140
+ });
138
141
  const eq = (a) => (b) => asExpr({
139
142
  raw: f => asExprRaw({ $eq: [a.raw(f).get(), b.raw(f).get()] }),
140
143
  });
@@ -296,6 +299,9 @@ const $entries = (expr) => func(function (obj) {
296
299
  const concat$1 = (...expr) => asExpr({
297
300
  raw: f => asExprRaw({ $concat: expr.map(e => e.raw(f).get()) }),
298
301
  });
302
+ const regex = (expr, regex, options) => asExpr({
303
+ raw: f => asExprRaw({ $regexMatch: { input: expr.raw(f).get(), regex, options } }),
304
+ });
299
305
  const str = (expr) => asExpr({
300
306
  raw: f => asExprRaw({ $toString: expr.raw(f).get() }),
301
307
  });
@@ -1942,6 +1948,7 @@ exports.multiply = multiply;
1942
1948
  exports.ne = ne;
1943
1949
  exports.nil = nil;
1944
1950
  exports.noop = noop;
1951
+ exports.not = not;
1945
1952
  exports.notNull = notNull;
1946
1953
  exports.now = now;
1947
1954
  exports.or = or;
@@ -1949,6 +1956,7 @@ exports.pair = pair;
1949
1956
  exports.prepare = prepare;
1950
1957
  exports.rand = rand;
1951
1958
  exports.range = range;
1959
+ exports.regex = regex;
1952
1960
  exports.root = root;
1953
1961
  exports.set = set;
1954
1962
  exports.setField = setField;
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.57",
6
+ "version": "0.0.58",
7
7
  "dependencies": {
8
8
  "dayjs": "^1.11.9",
9
9
  "dotenv": "^16.3.1",