@smithy/core 1.3.1 → 1.3.2

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-cjs/index.js CHANGED
@@ -446,37 +446,48 @@ function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenNam
446
446
  }
447
447
  yield page;
448
448
  const prevToken = token;
449
- token = page[outputTokenName];
449
+ token = get(page, outputTokenName);
450
450
  hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
451
451
  }
452
452
  return void 0;
453
453
  }, "paginateOperation");
454
454
  }
455
455
  __name(createPaginator, "createPaginator");
456
+ var get = /* @__PURE__ */ __name((fromObject, path) => {
457
+ let cursor = fromObject;
458
+ const pathComponents = path.split(".");
459
+ for (const step of pathComponents) {
460
+ if (!cursor || typeof cursor !== "object") {
461
+ return void 0;
462
+ }
463
+ cursor = cursor[step];
464
+ }
465
+ return cursor;
466
+ }, "get");
456
467
  // Annotate the CommonJS export names for ESM import in node:
457
468
 
458
469
  0 && (module.exports = {
459
- DefaultIdentityProviderConfig,
460
- EXPIRATION_MS,
461
- HttpApiKeyAuthSigner,
462
- HttpBearerAuthSigner,
463
- NoAuthSigner,
464
- RequestBuilder,
465
- createIsIdentityExpiredFunction,
466
470
  createPaginator,
467
- doesIdentityRequireRefresh,
468
- getHttpAuthSchemeEndpointRuleSetPlugin,
469
- getHttpAuthSchemePlugin,
470
- getHttpSigningPlugin,
471
- getSmithyContext,
472
- httpAuthSchemeEndpointRuleSetMiddlewareOptions,
473
471
  httpAuthSchemeMiddleware,
472
+ httpAuthSchemeEndpointRuleSetMiddlewareOptions,
473
+ getHttpAuthSchemeEndpointRuleSetPlugin,
474
474
  httpAuthSchemeMiddlewareOptions,
475
+ getHttpAuthSchemePlugin,
475
476
  httpSigningMiddleware,
476
477
  httpSigningMiddlewareOptions,
478
+ getHttpSigningPlugin,
479
+ DefaultIdentityProviderConfig,
480
+ HttpApiKeyAuthSigner,
481
+ HttpBearerAuthSigner,
482
+ NoAuthSigner,
483
+ createIsIdentityExpiredFunction,
484
+ EXPIRATION_MS,
477
485
  isIdentityExpired,
486
+ doesIdentityRequireRefresh,
478
487
  memoizeIdentityProvider,
488
+ getSmithyContext,
479
489
  normalizeProvider,
480
- requestBuilder
490
+ requestBuilder,
491
+ RequestBuilder
481
492
  });
482
493
 
@@ -19,9 +19,20 @@ export function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputT
19
19
  }
20
20
  yield page;
21
21
  const prevToken = token;
22
- token = page[outputTokenName];
22
+ token = get(page, outputTokenName);
23
23
  hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
24
24
  }
25
25
  return undefined;
26
26
  };
27
27
  }
28
+ const get = (fromObject, path) => {
29
+ let cursor = fromObject;
30
+ const pathComponents = path.split(".");
31
+ for (const step of pathComponents) {
32
+ if (!cursor || typeof cursor !== "object") {
33
+ return undefined;
34
+ }
35
+ cursor = cursor[step];
36
+ }
37
+ return cursor;
38
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline core",