@dnax/core 0.34.0 → 0.36.0

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 (2) hide show
  1. package/app/hono.ts +15 -3
  2. package/package.json +1 -1
package/app/hono.ts CHANGED
@@ -566,16 +566,28 @@ function HonoInstance(): typeof app {
566
566
 
567
567
  if (
568
568
  col?.api?.fields?.select?.length &&
569
- Array.isArray(col?.api?.fields?.select?.length)
569
+ Array.isArray(col?.api?.fields?.select)
570
570
  ) {
571
- response = pick(response, col?.api?.fields?.select || []);
571
+ if (body?.withMeta) {
572
+ try {
573
+ response.data = pick(response.data, col?.api?.fields?.select || []);
574
+ } catch (err) {}
575
+ } else {
576
+ response = pick(response, col?.api?.fields?.select || []);
577
+ }
572
578
  }
573
579
  if (
574
580
  col?.api?.fields?.hidden?.length &&
575
- Array.isArray(col?.api?.fields?.hidden?.length)
581
+ Array.isArray(col?.api?.fields?.hidden)
576
582
  ) {
577
583
  let privateFields = col?.api?.fields?.hidden || [];
578
584
  privateFields.push("password");
585
+ if (body?.withMeta) {
586
+ // If use Meta are included
587
+ try {
588
+ response.data = omit(response.data, privateFields);
589
+ } catch (e) {}
590
+ }
579
591
  response = omit(response, privateFields);
580
592
  } else {
581
593
  response = omit(response, ["password"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.34.0",
3
+ "version": "0.36.0",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {