ag-common 0.0.67 → 0.0.68

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.
@@ -2,7 +2,7 @@ import { APIGatewayProxyResult, DYNAMOKEYS } from '../types';
2
2
  export declare const returnCode: <T>(statusCode: number, body?: T | undefined, extraHeaders?: {
3
3
  [a: string]: string;
4
4
  } | undefined, fullSiteUrl?: string | undefined) => APIGatewayProxyResult;
5
- export declare const stripPKs: <T>(r: T, removePK?: boolean) => T;
5
+ export declare const stripPKs: <T>(r: T, excludePK?: boolean) => T;
6
6
  export declare const generateDynamoPKS: ({ type, L1, L2, L3, L4, L5, L6, additionalPKValues, }: {
7
7
  type: string;
8
8
  L1: string;
@@ -34,7 +34,12 @@ const returnCode = (statusCode, body, extraHeaders, fullSiteUrl) => {
34
34
  };
35
35
  exports.returnCode = returnCode;
36
36
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
- const stripPKs = (r, removePK = true) => {
37
+ const stripPKs = (r,
38
+ /**
39
+ * default true
40
+ * if true, will keep PK
41
+ */
42
+ excludePK = true) => {
38
43
  if (!r) {
39
44
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
45
  return null;
@@ -42,7 +47,7 @@ const stripPKs = (r, removePK = true) => {
42
47
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
43
48
  // @ts-ignore
44
49
  const { PK, PK1, PK2, PK3, PK4, PK5, L1, L2, L3, L4, L5, L6 } = r, rest = __rest(r, ["PK", "PK1", "PK2", "PK3", "PK4", "PK5", "L1", "L2", "L3", "L4", "L5", "L6"]);
45
- if (removePK) {
50
+ if (!excludePK) {
46
51
  //@ts-ignore
47
52
  rest.PK = PK;
48
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-common",
3
- "version": "0.0.67",
3
+ "version": "0.0.68",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Andrei Gec <@andreigec> (https://gec.dev/)",