@angular-devkit/core
Version:
Angular DevKit - Core Utility Library
57 lines (56 loc) • 1.67 kB
JavaScript
"use strict";
/**
* @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
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResolverHost = void 0;
/**
* A Host that runs a method before calling its delegate. This is an abstract class and its actual
* behaviour is entirely dependant of the subclass.
*/
class ResolverHost {
_delegate;
constructor(_delegate) {
this._delegate = _delegate;
}
get capabilities() {
return this._delegate.capabilities;
}
write(path, content) {
return this._delegate.write(this._resolve(path), content);
}
read(path) {
return this._delegate.read(this._resolve(path));
}
delete(path) {
return this._delegate.delete(this._resolve(path));
}
rename(from, to) {
return this._delegate.rename(this._resolve(from), this._resolve(to));
}
list(path) {
return this._delegate.list(this._resolve(path));
}
exists(path) {
return this._delegate.exists(this._resolve(path));
}
isDirectory(path) {
return this._delegate.isDirectory(this._resolve(path));
}
isFile(path) {
return this._delegate.isFile(this._resolve(path));
}
// Some hosts may not support stat.
stat(path) {
return this._delegate.stat(this._resolve(path));
}
// Some hosts may not support watching.
watch(path, options) {
return this._delegate.watch(this._resolve(path), options);
}
}
exports.ResolverHost = ResolverHost;