Comparing version 3.4.0 to 3.4.1
@@ -0,1 +1,8 @@ | ||
## [3.4.1](https://github.com/streamich/memfs/compare/v3.4.0...v3.4.1) (2021-12-30) | ||
### Bug Fixes | ||
* recursively sync children steps to fix rename ([43e8222](https://github.com/streamich/memfs/commit/43e82223046362c5e0176c112675c5636baac389)) | ||
# [3.4.0](https://github.com/streamich/memfs/compare/v3.3.0...v3.4.0) (2021-11-24) | ||
@@ -2,0 +9,0 @@ |
@@ -67,6 +67,9 @@ /// <reference types="node" /> | ||
}; | ||
steps: string[]; | ||
private _steps; | ||
node: Node; | ||
ino: number; | ||
length: number; | ||
name: string; | ||
get steps(): string[]; | ||
set steps(val: string[]); | ||
constructor(vol: Volume, parent: Link, name: string); | ||
@@ -95,2 +98,3 @@ setNode(node: Node): void; | ||
}; | ||
syncSteps(): void; | ||
} | ||
@@ -97,0 +101,0 @@ /** |
@@ -226,3 +226,3 @@ "use strict"; | ||
// Path to this node as Array: ['usr', 'bin', 'node']. | ||
_this.steps = []; | ||
_this._steps = []; | ||
// "i-node" number of the node. | ||
@@ -234,5 +234,21 @@ _this.ino = 0; | ||
_this.parent = parent; | ||
_this.steps = parent ? parent.steps.concat([name]) : [name]; | ||
_this.name = name; | ||
_this.syncSteps(); | ||
return _this; | ||
} | ||
Object.defineProperty(Link.prototype, "steps", { | ||
get: function () { | ||
return this._steps; | ||
}, | ||
// Recursively sync children steps, e.g. in case of dir rename | ||
set: function (val) { | ||
this._steps = val; | ||
for (var _i = 0, _a = Object.values(this.children); _i < _a.length; _i++) { | ||
var child = _a[_i]; | ||
child === null || child === void 0 ? void 0 : child.syncSteps(); | ||
} | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Link.prototype.setNode = function (node) { | ||
@@ -318,2 +334,5 @@ this.node = node; | ||
}; | ||
Link.prototype.syncSteps = function () { | ||
this.steps = this.parent ? this.parent.steps.concat([this.name]) : [this.name]; | ||
}; | ||
return Link; | ||
@@ -320,0 +339,0 @@ }(events_1.EventEmitter)); |
{ | ||
"name": "memfs", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"description": "In-memory file-system with Node's fs API.", | ||
@@ -33,11 +33,11 @@ "main": "lib/index.js", | ||
"husky": "7.0.4", | ||
"jest": "27.3.1", | ||
"prettier": "2.4.1", | ||
"pretty-quick": "3.1.2", | ||
"jest": "27.4.5", | ||
"prettier": "2.5.1", | ||
"pretty-quick": "3.1.3", | ||
"rimraf": "3.0.2", | ||
"ts-jest": "27.0.7", | ||
"ts-jest": "27.1.2", | ||
"ts-node": "10.4.0", | ||
"tslint": "5.20.1", | ||
"tslint-config-common": "1.6.0", | ||
"typescript": "4.5.2", | ||
"typescript": "4.5.4", | ||
"semantic-release": "18.0.1", | ||
@@ -44,0 +44,0 @@ "@semantic-release/changelog": "6.0.1", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
196426
4413