{"version":3,"file":"Brand.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/Brand.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/**\n * Helper type to introduce new branded types.\n *\n * `Base` is the underlying data type and `Tag` must be unique symbol/string.\n *\n * Usage:\n * ```ts\n * type LineNumber = Brand;\n * type RawUrl = Brand;\n * ```\n *\n * We purposefully use the string index of `_tag` rather then creating a Symbol\n * wrapper that would hide if in IDEs and fail build. This means that at build\n * time if one uses `._tag`, it will build without error and have\n * potentially having a runtime error. This allows us to have multiple places\n * where we define the brands and they will overlap. Also a use case for reusing\n * the type in other downstream projects is simplified.\n */\nexport type Brand = Base&{_tag: Tag};\n"]}