Files
react-native-devtools-frontend/front_end/core/platform/DevToolsPath.ts
T
Kateryna Prokopenko 228a48bf97 Introduce branded types for urls and paths in DevTools
Bug: 1253323
Change-Id: Ia3e805e2df1b4e6e46627009fc1d290bbd786557
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3205170
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2021-10-13 08:00:53 +00:00

35 lines
904 B
TypeScript

// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
class UrlStringTag {
private urlTag: (string|undefined);
}
/**
* File paths in DevTools that are represented as URLs
* @example
* “file:///Hello%20World/file/js”
*/
export type UrlString = string&UrlStringTag;
class RawPathStringTag {
private rawPathTag: (string|undefined);
}
/**
* File paths in DevTools that are represented as unencoded absolute
* or relative paths
* @example
* “/Hello World/file.js”
*/
export type RawPathString = string&RawPathStringTag;
class EncodedPathStringTag {
private encodedPathTag: (string|undefined);
}
/**
* File paths in DevTools that are represented as encoded paths
* @example
* “/Hello%20World/file.js”
*/
export type EncodedPathString = string&EncodedPathStringTag;