Comparing version 0.17.1 to 0.17.2
@@ -0,4 +1,8 @@ | ||
# v0.17.2 | ||
- Fix `file.filename` on top-level files | ||
# v0.17.1 | ||
- Fix incorrect dependence relationships being made in certain cases. | ||
- Fix incorrect dependence relationships being made in certain cases | ||
@@ -5,0 +9,0 @@ # v0.17.0 |
@@ -71,3 +71,3 @@ 'use strict'; | ||
const p = this[_path].lastIndexOf('/'); | ||
this[_filename] = p > -1 ? this[_path].slice(p + 1) : ''; | ||
this[_filename] = p > -1 ? this[_path].slice(p + 1) : this[_path]; | ||
} | ||
@@ -143,5 +143,5 @@ return this[_filename]; | ||
let readdir = util.promisify(fs.readdir); | ||
let readFile = util.promisify(fs.readFile); | ||
let stat = util.promisify(fs.stat); | ||
const readdir = util.promisify(fs.readdir); | ||
const readFile = util.promisify(fs.readFile); | ||
const stat = util.promisify(fs.stat); | ||
@@ -466,10 +466,10 @@ const _watchers = Symbol(); | ||
} | ||
if (!this[_whenFound].has(path$$1)) { | ||
if (this[_whenFound].has(path$$1)) { | ||
await this[_whenFound].get(path$$1).promise; | ||
} else { | ||
let resolve; | ||
this[_whenFound].set(path$$1, { | ||
promise: new Promise(res => (resolve = res)), | ||
resolve, | ||
}); | ||
let promise = new Promise(res => (resolve = res)); | ||
this[_whenFound].set(path$$1, { promise, resolve }); | ||
await promise; | ||
} | ||
await this[_whenFound].get(path$$1).promise; | ||
if (current$$1) { | ||
@@ -565,6 +565,3 @@ waitingFor.set(current$$1, waitingFor.get(current$$1) - 1); | ||
this.files.set(path$$1, file); | ||
this[_markFound](path$$1); | ||
if (this[_status] === _after) { | ||
this[_processDependents](path$$1); | ||
} | ||
this[this[_status] === _during ? _markFound : _processDependents](path$$1); | ||
this[_active].delete(path$$1); | ||
@@ -607,4 +604,4 @@ this[_checkWave](); | ||
const dependents = new Set(); | ||
for (const [dependent, dep] of this[_deps]) { | ||
if (dep === path$$1) { | ||
for (const [dependent, dependency] of this[_deps]) { | ||
if (dependency === path$$1) { | ||
dependents.add(dependent); | ||
@@ -616,5 +613,2 @@ } | ||
); | ||
if (!dependents.size && !this[_active].size) { | ||
this[_endWave](); | ||
} | ||
for (const dependent of dependents) { | ||
@@ -627,2 +621,3 @@ if (this[_origData].has(dependent)) { | ||
} | ||
this[_checkWave](); | ||
} | ||
@@ -650,3 +645,3 @@ | ||
[_markFound](path$$1) { | ||
if (this[_status] === _during && this[_whenFound].has(path$$1)) { | ||
if (this[_whenFound].has(path$$1)) { | ||
this[_whenFound].get(path$$1).resolve(); | ||
@@ -653,0 +648,0 @@ this[_whenFound].delete(path$$1); |
@@ -67,3 +67,3 @@ import { readdir, readFile, stat, watch } from 'fs'; | ||
const p = this[_path].lastIndexOf('/'); | ||
this[_filename] = p > -1 ? this[_path].slice(p + 1) : ''; | ||
this[_filename] = p > -1 ? this[_path].slice(p + 1) : this[_path]; | ||
} | ||
@@ -139,5 +139,5 @@ return this[_filename]; | ||
let readdir$1 = promisify(readdir); | ||
let readFile$1 = promisify(readFile); | ||
let stat$1 = promisify(stat); | ||
const readdir$1 = promisify(readdir); | ||
const readFile$1 = promisify(readFile); | ||
const stat$1 = promisify(stat); | ||
@@ -462,10 +462,10 @@ const _watchers = Symbol(); | ||
} | ||
if (!this[_whenFound].has(path)) { | ||
if (this[_whenFound].has(path)) { | ||
await this[_whenFound].get(path).promise; | ||
} else { | ||
let resolve$$1; | ||
this[_whenFound].set(path, { | ||
promise: new Promise(res => (resolve$$1 = res)), | ||
resolve: resolve$$1, | ||
}); | ||
let promise = new Promise(res => (resolve$$1 = res)); | ||
this[_whenFound].set(path, { promise, resolve: resolve$$1 }); | ||
await promise; | ||
} | ||
await this[_whenFound].get(path).promise; | ||
if (current$$1) { | ||
@@ -561,6 +561,3 @@ waitingFor.set(current$$1, waitingFor.get(current$$1) - 1); | ||
this.files.set(path, file); | ||
this[_markFound](path); | ||
if (this[_status] === _after) { | ||
this[_processDependents](path); | ||
} | ||
this[this[_status] === _during ? _markFound : _processDependents](path); | ||
this[_active].delete(path); | ||
@@ -603,4 +600,4 @@ this[_checkWave](); | ||
const dependents = new Set(); | ||
for (const [dependent, dep] of this[_deps]) { | ||
if (dep === path) { | ||
for (const [dependent, dependency] of this[_deps]) { | ||
if (dependency === path) { | ||
dependents.add(dependent); | ||
@@ -612,5 +609,2 @@ } | ||
); | ||
if (!dependents.size && !this[_active].size) { | ||
this[_endWave](); | ||
} | ||
for (const dependent of dependents) { | ||
@@ -623,2 +617,3 @@ if (this[_origData].has(dependent)) { | ||
} | ||
this[_checkWave](); | ||
} | ||
@@ -646,3 +641,3 @@ | ||
[_markFound](path) { | ||
if (this[_status] === _during && this[_whenFound].has(path)) { | ||
if (this[_whenFound].has(path)) { | ||
this[_whenFound].get(path).resolve(); | ||
@@ -649,0 +644,0 @@ this[_whenFound].delete(path); |
{ | ||
"name": "defiler", | ||
"version": "0.17.1", | ||
"version": "0.17.2", | ||
"description": "A small, strange building block", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
}, | ||
"homepage": "https://cndtr.io/defiler/", | ||
"homepage": "https://cndtr.io/defiler", | ||
"devDependencies": { | ||
@@ -31,0 +31,0 @@ "rollup": "*" |
@@ -23,3 +23,3 @@ # Defiler: A small, strange building block. | ||
- [changelog](CHANGELOG.md#readme) | ||
- [homepage](https://cndtr.io/defiler/) | ||
- [homepage](https://cndtr.io/defiler) | ||
@@ -26,0 +26,0 @@ ## License |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
127041
1199