@valkey/valkey-glide-darwin-arm64 1.3.1 → 1.3.2

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.
Files changed (29) hide show
  1. package/README.md +4 -4
  2. package/build-ts/src/BaseClient.d.ts +15 -1
  3. package/build-ts/src/BaseClient.js +1 -1
  4. package/build-ts/src/BaseClient.js.map +1 -1
  5. package/build-ts/src/Commands.js +13 -1
  6. package/build-ts/src/Commands.js.map +1 -1
  7. package/build-ts/src/ProtobufMessage.d.ts +2889 -2
  8. package/build-ts/src/Transaction.d.ts +2 -3
  9. package/build-ts/src/Transaction.js +1 -1
  10. package/build-ts/src/Transaction.js.map +1 -1
  11. package/build-ts/src/server-modules/GlideFtOptions.d.ts +1 -1
  12. package/build-ts/src/server-modules/GlideJson.d.ts +5 -5
  13. package/build-ts/src/server-modules/GlideJson.js +4 -4
  14. package/build-ts/src/server-modules/GlideJson.js.map +1 -1
  15. package/node_modules/glide-rs/glide-rs.darwin-arm64.node +0 -0
  16. package/npm/glide/index.ts +4 -0
  17. package/package.json +4 -3
  18. package/rust-client/node_modules/mingo/dist/cjs/core.js +1 -6
  19. package/rust-client/node_modules/mingo/dist/cjs/operators/_predicates.js +0 -5
  20. package/rust-client/node_modules/mingo/dist/cjs/operators/query/element/exists.js +13 -2
  21. package/rust-client/node_modules/mingo/dist/cjs/util.js +32 -31
  22. package/rust-client/node_modules/mingo/dist/esm/core.js +1 -6
  23. package/rust-client/node_modules/mingo/dist/esm/operators/_predicates.js +0 -4
  24. package/rust-client/node_modules/mingo/dist/esm/operators/query/element/exists.js +13 -2
  25. package/rust-client/node_modules/mingo/dist/esm/util.js +32 -31
  26. package/rust-client/node_modules/mingo/dist/types/operators/_predicates.d.ts +0 -8
  27. package/rust-client/node_modules/mingo/dist/types/operators/query/element/exists.d.ts +4 -2
  28. package/rust-client/node_modules/mingo/dist/types/util.d.ts +4 -4
  29. package/rust-client/node_modules/mingo/package.json +1 -1
@@ -30,7 +30,7 @@ const SORT_ORDER = {
30
30
  const compare = (a, b) => {
31
31
  if (a === MISSING) a = void 0;
32
32
  if (b === MISSING) b = void 0;
33
- const [u, v] = [a, b].map((n) => SORT_ORDER[typeOf(n)]);
33
+ const [u, v] = [a, b].map((n) => SORT_ORDER[typeOf(n)] || 0);
34
34
  if (u !== v) return u - v;
35
35
  if (isEqual(a, b)) return 0;
36
36
  if (a < b) return -1;
@@ -119,24 +119,28 @@ class ValueMap extends Map {
119
119
  function assert(condition, message) {
120
120
  if (!condition) throw new MingoError(message);
121
121
  }
122
- const typeOf = (v) => {
122
+ const STRING_REP = Object.keys(SORT_ORDER).reduce(
123
+ (memo, k) => {
124
+ memo["[object " + k[0].toUpperCase() + k.substring(1) + "]"] = k;
125
+ return memo;
126
+ },
127
+ {}
128
+ );
129
+ function typeOf(v) {
123
130
  const s = Object.prototype.toString.call(v);
124
- const t = s.substring(8, s.length - 1).toLowerCase();
125
- if (t !== "object") return t;
126
- const ctor = v.constructor;
127
- return ctor == null || ctor === Object ? t : ctor.name;
128
- };
131
+ return s === "[object Object]" ? v?.constructor?.name?.toLowerCase() || "object" : STRING_REP[s] || s.substring(8, s.length - 1).toLowerCase();
132
+ }
129
133
  const isBoolean = (v) => typeof v === "boolean";
130
134
  const isString = (v) => typeof v === "string";
131
135
  const isSymbol = (v) => typeof v === "symbol";
132
136
  const isNumber = (v) => !isNaN(v) && typeof v === "number";
133
137
  const isNotNaN = (v) => !(isNaN(v) && typeof v === "number");
134
138
  const isArray = Array.isArray;
135
- const isObject = (v) => {
139
+ function isObject(v) {
136
140
  if (!v) return false;
137
141
  const p = Object.getPrototypeOf(v);
138
142
  return (p === Object.prototype || p === null) && typeOf(v) === "object";
139
- };
143
+ }
140
144
  const isObjectLike = (v) => !isPrimitive(v);
141
145
  const isDate = (v) => v instanceof Date;
142
146
  const isRegExp = (v) => v instanceof RegExp;
@@ -220,17 +224,20 @@ function flatten(xs, depth = 1) {
220
224
  flatten2(xs, depth);
221
225
  return arr;
222
226
  }
223
- const objToString = Object.prototype.toString;
224
- function hasCustomToString(o) {
225
- if (isTypedArray(o)) return true;
226
- if (typeof o.toString === "function") {
227
- let proto = Object.getPrototypeOf(o);
228
- while (proto !== null) {
229
- if (has(proto, "toString") && proto.toString !== objToString) {
230
- return true;
231
- }
232
- proto = Object.getPrototypeOf(proto);
233
- }
227
+ function getMembersOf(o) {
228
+ const props = {};
229
+ while (o) {
230
+ for (const k of Object.getOwnPropertyNames(o))
231
+ if (!(k in props)) props[k] = o[k];
232
+ o = Object.getPrototypeOf(o);
233
+ }
234
+ return props;
235
+ }
236
+ function hasCustomString(o) {
237
+ while (o) {
238
+ if (Object.getOwnPropertyNames(o).includes("toString"))
239
+ return o["toString"] !== Object.prototype.toString;
240
+ o = Object.getPrototypeOf(o);
234
241
  }
235
242
  return false;
236
243
  }
@@ -252,7 +259,7 @@ function isEqual(a, b) {
252
259
  }
253
260
  return true;
254
261
  }
255
- return hasCustomToString(a) && a.toString() === b.toString();
262
+ return hasCustomString(a) && a.toString() === b.toString();
256
263
  }
257
264
  function unique(input, hashFunction = DEFAULT_HASH_FUNCTION) {
258
265
  const m = ValueMap.init(hashFunction);
@@ -266,23 +273,17 @@ const stringify = (v, refs) => {
266
273
  if (isDate(v)) return v.toISOString();
267
274
  if (isRegExp(v) || isSymbol(v) || isFunction(v))
268
275
  return v.toString();
269
- if (isTypedArray(v))
270
- return typeOf(v) + "[" + v.toString() + "]";
271
276
  if (!(refs instanceof Set)) refs = /* @__PURE__ */ new Set();
272
277
  if (refs.has(v)) throw CYCLE_FOUND_ERROR;
273
278
  try {
274
279
  refs.add(v);
275
- if (isArray(v)) return "[" + v.map((s) => stringify(s, refs)).join(",") + "]";
280
+ if (isArray(v)) return "[" + v.map((s2) => stringify(s2, refs)).join(",") + "]";
276
281
  if (isObject(v)) {
277
282
  const keys = Object.keys(v).sort();
278
283
  return "{" + keys.map((k) => `${k}:${stringify(v[k], refs)}`).join() + "}";
279
284
  }
280
- if (hasCustomToString(v)) {
281
- return typeOf(v) + "(" + JSON.stringify(v.toString()) + ")";
282
- }
283
- throw new Error(
284
- "mingo: cannot stringify custom type without explicit toString() method."
285
- );
285
+ const s = hasCustomString(v) ? v.toString() : stringify(getMembersOf(v), refs);
286
+ return typeOf(v) + "(" + s + ")";
286
287
  } finally {
287
288
  refs.delete(v);
288
289
  }
@@ -345,7 +346,7 @@ function into(target, ...rest) {
345
346
  }
346
347
  }
347
348
  function getValue(obj, key) {
348
- return isArray(obj) || isObject(obj) ? obj[key] : void 0;
349
+ return isObjectLike(obj) ? obj[key] : void 0;
349
350
  }
350
351
  function unwrap(arr, depth) {
351
352
  if (depth < 1) return arr;
@@ -99,14 +99,6 @@ export declare function $mod(a: Any, b: number[], _options?: PredicateOptions):
99
99
  * @returns {boolean}
100
100
  */
101
101
  export declare function $regex(a: Any, b: RegExp, options?: PredicateOptions): boolean;
102
- /**
103
- * Matches documents that have the specified field.
104
- *
105
- * @param a
106
- * @param b
107
- * @returns {boolean}
108
- */
109
- export declare function $exists(a: Any, b: Any, _options?: PredicateOptions): boolean;
110
102
  /**
111
103
  * Matches arrays that contain all elements specified in the query.
112
104
  *
@@ -1,4 +1,6 @@
1
+ import { Options } from "../../../core";
2
+ import { Any, AnyObject } from "../../../types";
1
3
  /**
2
- * Matches documents that have the specified field.
4
+ * Matches documents that contain or do not contain a specified field, including documents where the field value is null.
3
5
  */
4
- export declare const $exists: import("../../../core").QueryOperator;
6
+ export declare const $exists: (selector: string, value: Any, _options: Options) => (o: AnyObject) => boolean;
@@ -12,7 +12,7 @@ export declare class MingoError extends Error {
12
12
  * @param b The second value
13
13
  * @returns {Number}
14
14
  */
15
- export declare const compare: <T = unknown>(a: T, b: T) => number;
15
+ export declare const compare: <T = Any>(a: T, b: T) => number;
16
16
  /**
17
17
  * A map implementation that uses value comparison for keys instead of referential identity.
18
18
  *
@@ -52,17 +52,17 @@ export declare class ValueMap<K, V> extends Map<K, V> {
52
52
  }
53
53
  export declare function assert(condition: boolean, message: string): void;
54
54
  /**
55
- * Returns the name of type in lowercase.
55
+ * Returns the name of type in lowercase including custom types.
56
56
  * @param v Any value
57
57
  */
58
- export declare const typeOf: (v: Any) => string;
58
+ export declare function typeOf(v: Any): string;
59
59
  export declare const isBoolean: (v: Any) => v is boolean;
60
60
  export declare const isString: (v: Any) => v is string;
61
61
  export declare const isSymbol: (v: Any) => boolean;
62
62
  export declare const isNumber: (v: Any) => v is number;
63
63
  export declare const isNotNaN: (v: Any) => boolean;
64
64
  export declare const isArray: (arg: any) => arg is any[];
65
- export declare const isObject: (v: Any) => v is object;
65
+ export declare function isObject(v: Any): v is object;
66
66
  export declare const isObjectLike: (v: Any) => boolean;
67
67
  export declare const isDate: (v: Any) => v is Date;
68
68
  export declare const isRegExp: (v: Any) => v is RegExp;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mingo",
3
- "version": "6.5.3",
3
+ "version": "6.5.6",
4
4
  "description": "MongoDB query language for in-memory objects",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",