@omegup/msync 0.1.68 → 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,8 +188,10 @@ 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() }) });
194
+ const $arrayToObject = (expr) => asExpr({ raw: (f) => asExprRaw({ $arrayToObject: expr.raw(f).get() }) });
186
195
  const anyElementTrue = (expr) => asExpr({ raw: (f) => asExprRaw({ $anyElementTrue: expr.raw(f).get() }) });
187
196
  const $reduce = (input, initialValue, inExpr) => asExpr({ raw: (f) => asExprRaw({ $reduce: {
188
197
  input: input.raw(f).get(),
@@ -2144,6 +2153,8 @@ const single = (view, needs = {}) => pipe((input) => executes(view, input, needs
2144
2153
  //#endregion
2145
2154
  exports.$accumulator = $accumulator;
2146
2155
  exports.$and = $and;
2156
+ exports.$arrayElemAt = $arrayElemAt;
2157
+ exports.$arrayToObject = $arrayToObject;
2147
2158
  exports.$countDict = $countDict;
2148
2159
  exports.$countDictArray = $countDictArray;
2149
2160
  exports.$entries = $entries;
@@ -2161,6 +2172,7 @@ exports.$gte = $gte;
2161
2172
  exports.$gteTs = $gteTs;
2162
2173
  exports.$ifNull = $ifNull;
2163
2174
  exports.$in = $in;
2175
+ exports.$indexOfCP = $indexOfCP;
2164
2176
  exports.$insert = $insert;
2165
2177
  exports.$insertPart = $insertPart;
2166
2178
  exports.$insertX = $insertX;
@@ -2194,6 +2206,7 @@ exports.$setUnion = $setUnion;
2194
2206
  exports.$simpleInsert = $simpleInsert;
2195
2207
  exports.$simpleMerge = $simpleMerge;
2196
2208
  exports.$simpleMergePart = $simpleMergePart;
2209
+ exports.$split = $split;
2197
2210
  exports.$substr = $substr;
2198
2211
  exports.$sum = $sum;
2199
2212
  exports.$type = $type;