resora 1.3.3 → 1.3.4

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/dist/index.cjs CHANGED
@@ -436,17 +436,17 @@ const mergeMetadata = (base, incoming) => {
436
436
  //#endregion
437
437
  //#region src/utilities/arkorm.ts
438
438
  /**
439
- * Type guard to check if a value is an Arkorm-like model, which is defined as an object
440
- * that has a toObject method and optionally getRawAttributes, getAttribute, and
441
- * setAttribute methods.
439
+ * Type guard to check if a value is an Arkorm-like model.
440
+ *
441
+ * Arkorm models expose `toObject()`. Some production model variants/proxies do
442
+ * not expose `getRawAttributes()`, so the serializer should not require it.
442
443
  *
443
444
  * @param value The value to check
444
445
  * @returns True if the value is an Arkorm-like model, false otherwise
445
446
  */
446
447
  const isArkormLikeModel = (value) => {
447
448
  if (!value || typeof value !== "object") return false;
448
- const candidate = value;
449
- return typeof candidate.toObject === "function" && typeof candidate.getRawAttributes === "function";
449
+ return typeof value.toObject === "function";
450
450
  };
451
451
  /**
452
452
  * Type guard to check if a value is an Arkorm-like collection, which is defined as an object
package/dist/index.d.cts CHANGED
@@ -1240,9 +1240,10 @@ type ResoraCollectionLike = {
1240
1240
  setCollects: (...args: unknown[]) => unknown;
1241
1241
  };
1242
1242
  /**
1243
- * Type guard to check if a value is an Arkorm-like model, which is defined as an object
1244
- * that has a toObject method and optionally getRawAttributes, getAttribute, and
1245
- * setAttribute methods.
1243
+ * Type guard to check if a value is an Arkorm-like model.
1244
+ *
1245
+ * Arkorm models expose `toObject()`. Some production model variants/proxies do
1246
+ * not expose `getRawAttributes()`, so the serializer should not require it.
1246
1247
  *
1247
1248
  * @param value The value to check
1248
1249
  * @returns True if the value is an Arkorm-like model, false otherwise
package/dist/index.d.mts CHANGED
@@ -1240,9 +1240,10 @@ type ResoraCollectionLike = {
1240
1240
  setCollects: (...args: unknown[]) => unknown;
1241
1241
  };
1242
1242
  /**
1243
- * Type guard to check if a value is an Arkorm-like model, which is defined as an object
1244
- * that has a toObject method and optionally getRawAttributes, getAttribute, and
1245
- * setAttribute methods.
1243
+ * Type guard to check if a value is an Arkorm-like model.
1244
+ *
1245
+ * Arkorm models expose `toObject()`. Some production model variants/proxies do
1246
+ * not expose `getRawAttributes()`, so the serializer should not require it.
1246
1247
  *
1247
1248
  * @param value The value to check
1248
1249
  * @returns True if the value is an Arkorm-like model, false otherwise
package/dist/index.mjs CHANGED
@@ -407,17 +407,17 @@ const mergeMetadata = (base, incoming) => {
407
407
  //#endregion
408
408
  //#region src/utilities/arkorm.ts
409
409
  /**
410
- * Type guard to check if a value is an Arkorm-like model, which is defined as an object
411
- * that has a toObject method and optionally getRawAttributes, getAttribute, and
412
- * setAttribute methods.
410
+ * Type guard to check if a value is an Arkorm-like model.
411
+ *
412
+ * Arkorm models expose `toObject()`. Some production model variants/proxies do
413
+ * not expose `getRawAttributes()`, so the serializer should not require it.
413
414
  *
414
415
  * @param value The value to check
415
416
  * @returns True if the value is an Arkorm-like model, false otherwise
416
417
  */
417
418
  const isArkormLikeModel = (value) => {
418
419
  if (!value || typeof value !== "object") return false;
419
- const candidate = value;
420
- return typeof candidate.toObject === "function" && typeof candidate.getRawAttributes === "function";
420
+ return typeof value.toObject === "function";
421
421
  };
422
422
  /**
423
423
  * Type guard to check if a value is an Arkorm-like collection, which is defined as an object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resora",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "A structured API response layer for Node.js and TypeScript with automatic JSON responses, collection support, and pagination handling.",
5
5
  "keywords": [
6
6
  "api",