@bifravst/http-api-mock 1.2.2 → 1.2.3

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.
@@ -71,7 +71,8 @@ export const handler = async (
71
71
  console.debug(`Found response items: ${Items?.length}`)
72
72
 
73
73
  let res: APIGatewayProxyResult | undefined
74
- for (const Item of Items ?? []) {
74
+ for (const Item of (Items ?? []).reverse()) {
75
+ // use newest response first
75
76
  const objItem = unmarshall(Item)
76
77
  const hasExpectedQueryParams = 'queryParams' in objItem
77
78
  const matchedQueryParams = hasExpectedQueryParams
@@ -42,7 +42,8 @@ export const handler = async (event, context) => {
42
42
  }));
43
43
  console.debug(`Found response items: ${Items?.length}`);
44
44
  let res;
45
- for (const Item of Items ?? []) {
45
+ for (const Item of (Items ?? []).reverse()) {
46
+ // use newest response first
46
47
  const objItem = unmarshall(Item);
47
48
  const hasExpectedQueryParams = 'queryParams' in objItem;
48
49
  const matchedQueryParams = hasExpectedQueryParams
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bifravst/http-api-mock",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Helper functions for AWS lambdas written in TypeScript.",
5
5
  "exports": {
6
6
  "./*": {