@aws-amplify/core
Version:
Core category of aws-amplify
1 lines • 1.24 kB
Source Map (JSON)
{"version":3,"file":"contextToken.mjs","sources":["../../../src/context/contextToken.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Creates the per-context identity handle attached to every branded\n * {@link AmplifyContext} by the context producers (`createAmplifyContext`,\n * `bridgeAmplifyClass`, the singleton `configure()` path, and the testing\n * mock factory).\n *\n * Each call returns a **frozen** `{ value }` object carrying a **unique**\n * `Symbol()` — a plain (non-registry) symbol, so no two contexts ever share a\n * token. See {@link AmplifyContextToken} for why the token exists (structural\n * compatibility with `@aws-amplify/data-schema`'s `ContextSpec` duck-check);\n * runtime context identification stays on the `AMPLIFY_CONTEXT_BRAND` symbol\n * and must not involve the token.\n */\nexport function createAmplifyContextToken() {\n return Object.freeze({ value: Symbol('amplifyContextToken') });\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,yBAAyB,GAAG;AAC5C,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC;AAClE;;;;"}