/
githubmirror
/
angular-cli
Обзор
Документация
Войти
/
githubmirror
/
angular-cli
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/angular_devkit/schematics/src/tree/entry.ts
40 строк
863 B
Charles Lyding
refactor(@angular-devkit/schematics): add explicit return types to functions
01 май 2025, 02:50
01 май 2025, 02:50
2027d1b
Код
Авторство
О чём код?
/** * @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 { Path } from '@angular-devkit/core'; import { FileEntry } from './interface'; export class SimpleFileEntry implements FileEntry { constructor( private _path: Path, private _content: Buffer, ) {} get path(): Path { return this._path; } get content(): Buffer { return this._content; } } export class LazyFileEntry implements FileEntry { private _content: Buffer | null = null; constructor( private _path: Path, private _load: (path?: Path) => Buffer, ) {} get path(): Path { return this._path; } get content(): Buffer { return this._content || (this._content = this._load(this._path)); } }