aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.js
diff options
context:
space:
mode:
authorNevena Bojovic <nenabojov@gmail.com>2022-03-01 20:05:50 +0100
committerNevena Bojovic <nenabojov@gmail.com>2022-03-01 20:05:50 +0100
commit291803c31f829fe0d32bb3207bc11def95a7408c (patch)
treec7d43107d79291b19d8c9eceefbe91c9f9a52acf /sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.js
parent1fa69862057db4db53cfda5be9c24b4228ef63f7 (diff)
Urađena test aplikacija. Povezan front i back.
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.js169
1 files changed, 169 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.js
new file mode 100644
index 00000000..61cc0049
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.js
@@ -0,0 +1,169 @@
+"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.io/license
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ScopedTree = void 0;
+const core_1 = require("@angular-devkit/core");
+const delegate_1 = require("./delegate");
+const interface_1 = require("./interface");
+class ScopedFileEntry {
+ constructor(_base, scope) {
+ this._base = _base;
+ this.scope = scope;
+ }
+ get path() {
+ return (0, core_1.join)(core_1.NormalizedRoot, (0, core_1.relative)(this.scope, this._base.path));
+ }
+ get content() {
+ return this._base.content;
+ }
+}
+class ScopedDirEntry {
+ constructor(_base, scope) {
+ this._base = _base;
+ this.scope = scope;
+ }
+ get parent() {
+ if (!this._base.parent || this._base.path == this.scope) {
+ return null;
+ }
+ return new ScopedDirEntry(this._base.parent, this.scope);
+ }
+ get path() {
+ return (0, core_1.join)(core_1.NormalizedRoot, (0, core_1.relative)(this.scope, this._base.path));
+ }
+ get subdirs() {
+ return this._base.subdirs;
+ }
+ get subfiles() {
+ return this._base.subfiles;
+ }
+ dir(name) {
+ const entry = this._base.dir(name);
+ return entry && new ScopedDirEntry(entry, this.scope);
+ }
+ file(name) {
+ const entry = this._base.file(name);
+ return entry && new ScopedFileEntry(entry, this.scope);
+ }
+ visit(visitor) {
+ return this._base.visit((path, entry) => {
+ visitor((0, core_1.join)(core_1.NormalizedRoot, (0, core_1.relative)(this.scope, path)), entry && new ScopedFileEntry(entry, this.scope));
+ });
+ }
+}
+class ScopedTree {
+ constructor(_base, scope) {
+ this._base = _base;
+ const normalizedScope = (0, core_1.normalize)('/' + scope);
+ this._root = new ScopedDirEntry(this._base.getDir(normalizedScope), normalizedScope);
+ }
+ get root() {
+ return this._root;
+ }
+ branch() {
+ return new ScopedTree(this._base.branch(), this._root.scope);
+ }
+ merge(other, strategy) {
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
+ const self = this;
+ const delegate = new (class extends delegate_1.DelegateTree {
+ get actions() {
+ return other.actions.map((action) => self._fullPathAction(action));
+ }
+ })(other);
+ this._base.merge(delegate, strategy);
+ }
+ // Readonly.
+ read(path) {
+ return this._base.read(this._fullPath(path));
+ }
+ exists(path) {
+ return this._base.exists(this._fullPath(path));
+ }
+ get(path) {
+ const entry = this._base.get(this._fullPath(path));
+ return entry && new ScopedFileEntry(entry, this._root.scope);
+ }
+ getDir(path) {
+ const entry = this._base.getDir(this._fullPath(path));
+ return entry && new ScopedDirEntry(entry, this._root.scope);
+ }
+ visit(visitor) {
+ return this._root.visit(visitor);
+ }
+ // Change content of host files.
+ overwrite(path, content) {
+ return this._base.overwrite(this._fullPath(path), content);
+ }
+ beginUpdate(path) {
+ return this._base.beginUpdate(this._fullPath(path));
+ }
+ commitUpdate(record) {
+ return this._base.commitUpdate(record);
+ }
+ // Structural methods.
+ create(path, content) {
+ return this._base.create(this._fullPath(path), content);
+ }
+ delete(path) {
+ return this._base.delete(this._fullPath(path));
+ }
+ rename(from, to) {
+ return this._base.rename(this._fullPath(from), this._fullPath(to));
+ }
+ apply(action, strategy) {
+ return this._base.apply(this._fullPathAction(action), strategy);
+ }
+ get actions() {
+ const scopedActions = [];
+ for (const action of this._base.actions) {
+ if (!action.path.startsWith(this._root.scope + '/')) {
+ continue;
+ }
+ if (action.kind !== 'r') {
+ scopedActions.push({
+ ...action,
+ path: (0, core_1.join)(core_1.NormalizedRoot, (0, core_1.relative)(this._root.scope, action.path)),
+ });
+ }
+ else if (action.to.startsWith(this._root.scope + '/')) {
+ scopedActions.push({
+ ...action,
+ path: (0, core_1.join)(core_1.NormalizedRoot, (0, core_1.relative)(this._root.scope, action.path)),
+ to: (0, core_1.join)(core_1.NormalizedRoot, (0, core_1.relative)(this._root.scope, action.to)),
+ });
+ }
+ }
+ return scopedActions;
+ }
+ [interface_1.TreeSymbol]() {
+ return this;
+ }
+ _fullPath(path) {
+ return (0, core_1.join)(this._root.scope, (0, core_1.normalize)('/' + path));
+ }
+ _fullPathAction(action) {
+ let fullPathAction;
+ if (action.kind === 'r') {
+ fullPathAction = {
+ ...action,
+ path: this._fullPath(action.path),
+ to: this._fullPath(action.to),
+ };
+ }
+ else {
+ fullPathAction = {
+ ...action,
+ path: this._fullPath(action.path),
+ };
+ }
+ return fullPathAction;
+ }
+}
+exports.ScopedTree = ScopedTree;