@omegup/msync 0.1.69 → 0.1.70

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.js CHANGED
@@ -134,6 +134,13 @@ const $substr = (expr, start, length) => asExpr({ raw: (f) => asExprRaw({ $subst
134
134
  start.raw(f).get(),
135
135
  length.raw(f).get()
136
136
  ] }) });
137
+ const $indexOfCP = (expr, substring, start, end) => asExpr({ raw: (f) => asExprRaw({ $indexOfCP: [
138
+ expr.raw(f).get(),
139
+ substring.raw(f).get(),
140
+ ...start ? [start.raw(f).get()] : [],
141
+ ...end ? [end.raw(f).get()] : []
142
+ ] }) });
143
+ const $split = (expr, delimiter) => asExpr({ raw: (f) => asExprRaw({ $split: [expr.raw(f).get(), delimiter.raw(f).get()] }) });
137
144
  const padLeft = (expr, pad) => asExpr({ raw: (f) => asExprRaw({ $let: {
138
145
  vars: { x: { $concat: [{ $literal: pad }, expr.raw(f).get()] } },
139
146
  in: { $substrCP: [
@@ -181,6 +188,7 @@ const $setUnion = (...exprs) => asExpr({ raw: (f) => asExprRaw({ $setUnion: expr
181
188
  const first = (expr) => asExpr({ raw: (f) => asExprRaw({ $first: expr.raw(f).get() }) });
182
189
  const firstSure = first;
183
190
  const last = (expr) => asExpr({ raw: (f) => asExprRaw({ $last: expr.raw(f).get() }) });
191
+ const $arrayElemAt = (expr, idx) => asExpr({ raw: (f) => asExprRaw({ $arrayElemAt: [expr.raw(f).get(), idx.raw(f).get()] }) });
184
192
  const mergeObjects = (...exprs) => asExpr({ raw: (f) => asExprRaw({ $mergeObjects: exprs.map((x) => x.raw(f).get()) }) });
185
193
  const $objectToArray = (expr) => asExpr({ raw: (f) => asExprRaw({ $objectToArray: expr.raw(f).get() }) });
186
194
  const $arrayToObject = (expr) => asExpr({ raw: (f) => asExprRaw({ $arrayToObject: expr.raw(f).get() }) });
@@ -2145,6 +2153,7 @@ const single = (view, needs = {}) => pipe((input) => executes(view, input, needs
2145
2153
  //#endregion
2146
2154
  exports.$accumulator = $accumulator;
2147
2155
  exports.$and = $and;
2156
+ exports.$arrayElemAt = $arrayElemAt;
2148
2157
  exports.$arrayToObject = $arrayToObject;
2149
2158
  exports.$countDict = $countDict;
2150
2159
  exports.$countDictArray = $countDictArray;
@@ -2163,6 +2172,7 @@ exports.$gte = $gte;
2163
2172
  exports.$gteTs = $gteTs;
2164
2173
  exports.$ifNull = $ifNull;
2165
2174
  exports.$in = $in;
2175
+ exports.$indexOfCP = $indexOfCP;
2166
2176
  exports.$insert = $insert;
2167
2177
  exports.$insertPart = $insertPart;
2168
2178
  exports.$insertX = $insertX;
@@ -2196,6 +2206,7 @@ exports.$setUnion = $setUnion;
2196
2206
  exports.$simpleInsert = $simpleInsert;
2197
2207
  exports.$simpleMerge = $simpleMerge;
2198
2208
  exports.$simpleMergePart = $simpleMergePart;
2209
+ exports.$split = $split;
2199
2210
  exports.$substr = $substr;
2200
2211
  exports.$sum = $sum;
2201
2212
  exports.$type = $type;