bt-core-app 2.0.52 → 2.0.54

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.
@@ -5693,6 +5693,7 @@ function toe(e, t, a) {
5693
5693
  let n = a ?? [];
5694
5694
  for (var l in t)
5695
5695
  e.hasOwnProperty(l) && !n.some((r) => r == l) && (e[l] = t[l]);
5696
+ return e;
5696
5697
  }
5697
5698
  function aoe(e, t, a) {
5698
5699
  if (Tt(a)) {
@@ -9185,8 +9186,8 @@ function bh(e) {
9185
9186
  })), k != null ? p.onSaveAsync ?? (p.onSaveAsync = async (S) => {
9186
9187
  if (S == null)
9187
9188
  return;
9188
- const C = p.getMode(S);
9189
- return p.data = S, C == "new" ? await k().post(p) : await k().patch(p);
9189
+ let C;
9190
+ return p.getMode != null && (typeof p.getMode == "string" ? C = p.getMode : C = p.getMode(S)), p.data = S, C == "new" || C == "post" ? await k().post(p) : await k().patch(p);
9190
9191
  }) : p.onSaveAsync ?? (p.onSaveAsync = (S) => {
9191
9192
  const C = b.findIndex((M) => M.id == S.id);
9192
9193
  return C >= 0 ? b.splice(C, 1, S) : b.push(S), Promise.resolve(S);
package/dist/index.d.ts CHANGED
@@ -1470,7 +1470,7 @@ declare interface PredictOptions {
1470
1470
  }
1471
1471
 
1472
1472
  /**Pulls only props that obj2 contains and applies to obj1 */
1473
- export declare function pullPropsFrom(obj1: any, obj2: any, propsToIgnore?: string[]): void;
1473
+ export declare function pullPropsFrom(obj1: any, obj2: any, propsToIgnore?: string[]): any;
1474
1474
 
1475
1475
  export declare interface QueryParams extends Record<string, any> {
1476
1476
  filterBy?: string;
@@ -1533,7 +1533,7 @@ export declare interface SaveItemOptions {
1533
1533
  }
1534
1534
 
1535
1535
  export declare interface SaveOptions<T, TSave, TReturn> extends StoreAction, StorePathOptions, DoActionOptions {
1536
- getMode?: (item: any) => BladeMode;
1536
+ getMode?: 'post' | 'patch' | ((item: any) => BladeMode);
1537
1537
  /**called to check whether to proceed with save */
1538
1538
  onCanSaveAsync?: OnCanDoAsync<T | TSave>;
1539
1539
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-core-app",
3
- "version": "2.0.52",
3
+ "version": "2.0.54",
4
4
  "description": "Core app tools for some basic features like navigation, authentication, server apis, and cosmetics",
5
5
  "homepage": "https://github.com/BlitzItTech/bt-core",
6
6
  "bugs": {