@atscript/db 0.1.121 → 0.1.122

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.
@@ -821,6 +821,8 @@ var FieldMappingStrategy = class {
821
821
  if (!fmt) return value;
822
822
  if (value === null || value === void 0) return value;
823
823
  if (typeof value !== "object" || Array.isArray(value)) return fmt(value);
824
+ const proto = Object.getPrototypeOf(value);
825
+ if (proto !== Object.prototype && proto !== null) return fmt(value);
824
826
  const ops = value;
825
827
  const formatted = {};
826
828
  for (const [op, opVal] of Object.entries(ops)) if ((op === "$in" || op === "$nin") && Array.isArray(opVal)) formatted[op] = opVal.map((v) => v === null || v === void 0 ? v : fmt(v));
@@ -821,6 +821,8 @@ var FieldMappingStrategy = class {
821
821
  if (!fmt) return value;
822
822
  if (value === null || value === void 0) return value;
823
823
  if (typeof value !== "object" || Array.isArray(value)) return fmt(value);
824
+ const proto = Object.getPrototypeOf(value);
825
+ if (proto !== Object.prototype && proto !== null) return fmt(value);
824
826
  const ops = value;
825
827
  const formatted = {};
826
828
  for (const [op, opVal] of Object.entries(ops)) if ((op === "$in" || op === "$nin") && Array.isArray(opVal)) formatted[op] = opVal.map((v) => v === null || v === void 0 ? v : fmt(v));
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_db_error = require("./db-error-DXwEzmYJ.cjs");
3
- const require_db_view = require("./db-view-DnWm-ddS.cjs");
3
+ const require_db_view = require("./db-view-BEZuIbsz.cjs");
4
4
  const require_consts = require("./consts-BzRfCcH2.cjs");
5
5
  const require_ops = require("./ops.cjs");
6
6
  const require_validator = require("./validator-BSk8lPH1.cjs");
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as DbError, t as CasExhaustedError } from "./db-error-BHPXOKzc.mjs";
2
- import { C as NoopLogger, S as isGeoPointType, _ as DocumentFieldMapper, a as ApplicationIntegrity, b as TableMetadata, c as IntegrityStrategy, d as resolveDesignType, f as assertGeoPoint, g as RelationalFieldMapper, h as guardQuery, i as decomposePatch, l as NativeIntegrity, m as guardFilter, n as AtscriptDbTable, o as BaseDbAdapter, p as guardAggregate, r as assertNoVersionWrites, s as createFailureCollector, t as AtscriptDbView, u as AtscriptDbReadable, v as FieldMappingStrategy, x as isGeoIndexableType, y as UniquSelect } from "./db-view-BllUecjK.mjs";
2
+ import { C as NoopLogger, S as isGeoPointType, _ as DocumentFieldMapper, a as ApplicationIntegrity, b as TableMetadata, c as IntegrityStrategy, d as resolveDesignType, f as assertGeoPoint, g as RelationalFieldMapper, h as guardQuery, i as decomposePatch, l as NativeIntegrity, m as guardFilter, n as AtscriptDbTable, o as BaseDbAdapter, p as guardAggregate, r as assertNoVersionWrites, s as createFailureCollector, t as AtscriptDbView, u as AtscriptDbReadable, v as FieldMappingStrategy, x as isGeoIndexableType, y as UniquSelect } from "./db-view-DuJYYz77.mjs";
3
3
  import { t as DEFAULT_DB_SPACE } from "./consts-C_-5_pFq.mjs";
4
4
  import { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, getDbFieldOp, isDbFieldOp, separateCas, separateFieldOps } from "./ops.mjs";
5
5
  import { a as isNavRelation, i as forceNavNonOptional, n as buildValidationContext, o as createDbValidatorPlugin, s as getKeyProps, t as buildDbValidator } from "./validator-C7plt6Kf.mjs";
package/dist/sync.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_db_view = require("./db-view-DnWm-ddS.cjs");
2
+ const require_db_view = require("./db-view-BEZuIbsz.cjs");
3
3
  //#region src/schema/schema-hash.ts
4
4
  /** Extracts sorted field snapshots from a readable's field descriptors. */
5
5
  function extractFieldSnapshots(fields, typeMapper) {
package/dist/sync.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as NoopLogger } from "./db-view-BllUecjK.mjs";
1
+ import { C as NoopLogger } from "./db-view-DuJYYz77.mjs";
2
2
  //#region src/schema/schema-hash.ts
3
3
  /** Extracts sorted field snapshots from a readable's field descriptors. */
4
4
  function extractFieldSnapshots(fields, typeMapper) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/db",
3
- "version": "0.1.121",
3
+ "version": "0.1.122",
4
4
  "description": "Database adapter utilities for atscript.",
5
5
  "keywords": [
6
6
  "atscript",