Commit 54caadc458ca1ac4c3d5d42c945f09165d3f15cd
add end prop
wanderer committed on 12/5/2017, 6:22:15 PMParent: 83cb9ce730be6f7f6236af5fd664d57a6a74acc9
Files changed
index.js | changed |
tests/index.js | changed |
index.js | ||
---|---|---|
@@ -27,5 +27,13 @@ | ||
27 | 27 … | write (buf) { |
28 | 28 … | buf = Buffer.from(buf) |
29 | 29 … | this.buffer = Buffer.concat([this.buffer, buf]) |
30 | 30 … | } |
31 … | + | |
32 … | + /** | |
33 … | + * Whether or not there is more data to read from the buffer | |
34 … | + * returns {Boolean} | |
35 … | + */ | |
36 … | + get end () { | |
37 … | + return !this.buffer.length | |
38 … | + } | |
31 | 39 … | } |
Built with git-ssb-web