UNPKG

@aws-amplify/core

Version:

Core category of aws-amplify

1 lines • 1.08 kB
{"version":3,"file":"contextBrand.mjs","sources":["../../../src/context/contextBrand.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Symbol brand used to identify {@link AmplifyContext} objects at runtime.\n * Uses `Symbol.for()` so the brand is shared across module instances\n * (e.g. when `@aws-amplify/core` is accidentally duplicated in the bundle).\n */\nexport const AMPLIFY_CONTEXT_BRAND = Symbol.for('amplify.context');\n/**\n * Returns `true` if the given value is a branded {@link AmplifyContext}.\n */\nexport function isAmplifyContext(value) {\n return (value !== null &&\n value !== undefined &&\n typeof value === 'object' &&\n AMPLIFY_CONTEXT_BRAND in value);\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,iBAAiB;AACjE;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,KAAK,EAAE;AACxC,IAAI,QAAQ,KAAK,KAAK,IAAI;AAC1B,QAAQ,KAAK,KAAK,SAAS;AAC3B,QAAQ,OAAO,KAAK,KAAK,QAAQ;AACjC,QAAQ,qBAAqB,IAAI,KAAK;AACtC;;;;"}