/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/src/app/shared/normalize-path.ts
23 строки
637 B
Kristiyan Kostadinov
build: switch docs site to application builder
30 апр 2025, 19:55
30 апр 2025, 19:55
f4b7afe
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import normalize from 'path-normalize'; /** * Normalizes the given path by: * - Collapsing unnecessary segments (e.g. `a/./b`) * - Normalizing from backslashes to Posix forward slashes. * - Removing a leading `./` if present. */ export function normalizePath(input: string): string { input = normalize(input.replace(/\\/g, '/')); if (input.startsWith('./')) { input = input.substring(2); } return input; }