koa-files 3.1.2 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/Service.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
@@ -44,18 +44,6 @@ class Service {
44
44
  * @param options The file service options.
45
45
  */
46
46
  constructor(root, options) {
47
- Object.defineProperty(this, 'root', {
48
- enumerable: true,
49
- configurable: true,
50
- writable: true,
51
- value: void 0
52
- });
53
- Object.defineProperty(this, 'options', {
54
- enumerable: true,
55
- configurable: true,
56
- writable: true,
57
- value: void 0
58
- });
59
47
  this.options = options;
60
48
  this.root = path.unixify(path$1.resolve(root));
61
49
  }
package/cjs/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
package/cjs/utils/fs.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
@@ -25,54 +25,10 @@ class FileReadStream extends stream.Readable {
25
25
  constructor(path, ranges, options) {
26
26
  const { fs, encoding, highWaterMark } = options;
27
27
  super({ encoding, highWaterMark });
28
- Object.defineProperty(this, 'fd', {
29
- enumerable: true,
30
- configurable: true,
31
- writable: true,
32
- value: void 0
33
- });
34
- Object.defineProperty(this, 'fs', {
35
- enumerable: true,
36
- configurable: true,
37
- writable: true,
38
- value: void 0
39
- });
40
- Object.defineProperty(this, 'path', {
41
- enumerable: true,
42
- configurable: true,
43
- writable: true,
44
- value: void 0
45
- });
46
- Object.defineProperty(this, 'ranges', {
47
- enumerable: true,
48
- configurable: true,
49
- writable: true,
50
- value: void 0
51
- });
52
- Object.defineProperty(this, 'bytesRead', {
53
- enumerable: true,
54
- configurable: true,
55
- writable: true,
56
- value: 0
57
- });
58
- Object.defineProperty(this, 'reading', {
59
- enumerable: true,
60
- configurable: true,
61
- writable: true,
62
- value: false
63
- });
64
- Object.defineProperty(this, 'currentRangeIndex', {
65
- enumerable: true,
66
- configurable: true,
67
- writable: true,
68
- value: 0
69
- });
70
- Object.defineProperty(this, 'readState', {
71
- enumerable: true,
72
- configurable: true,
73
- writable: true,
74
- value: 0 /* ReadState.PREFIX */
75
- });
28
+ this.bytesRead = 0;
29
+ this.reading = false;
30
+ this.currentRangeIndex = 0;
31
+ this.readState = 0 /* ReadState.PREFIX */;
76
32
  this.fs = fs;
77
33
  this.path = path;
78
34
  this.ranges = ranges;
package/esm/Service.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
@@ -36,18 +36,6 @@ class Service {
36
36
  * @param options The file service options.
37
37
  */
38
38
  constructor(root, options) {
39
- Object.defineProperty(this, 'root', {
40
- enumerable: true,
41
- configurable: true,
42
- writable: true,
43
- value: void 0
44
- });
45
- Object.defineProperty(this, 'options', {
46
- enumerable: true,
47
- configurable: true,
48
- writable: true,
49
- value: void 0
50
- });
51
39
  this.options = options;
52
40
  this.root = unixify(resolve(root));
53
41
  }
package/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
package/esm/utils/fs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
package/esm/utils/hash.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
package/esm/utils/http.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
package/esm/utils/path.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package koa-files
3
3
  * @license MIT
4
- * @version 3.1.2
4
+ * @version 3.1.3
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A static files serving middleware for koa.
7
7
  * @see https://github.com/nuintun/koa-files#readme
@@ -23,54 +23,10 @@ class FileReadStream extends Readable {
23
23
  constructor(path, ranges, options) {
24
24
  const { fs, encoding, highWaterMark } = options;
25
25
  super({ encoding, highWaterMark });
26
- Object.defineProperty(this, 'fd', {
27
- enumerable: true,
28
- configurable: true,
29
- writable: true,
30
- value: void 0
31
- });
32
- Object.defineProperty(this, 'fs', {
33
- enumerable: true,
34
- configurable: true,
35
- writable: true,
36
- value: void 0
37
- });
38
- Object.defineProperty(this, 'path', {
39
- enumerable: true,
40
- configurable: true,
41
- writable: true,
42
- value: void 0
43
- });
44
- Object.defineProperty(this, 'ranges', {
45
- enumerable: true,
46
- configurable: true,
47
- writable: true,
48
- value: void 0
49
- });
50
- Object.defineProperty(this, 'bytesRead', {
51
- enumerable: true,
52
- configurable: true,
53
- writable: true,
54
- value: 0
55
- });
56
- Object.defineProperty(this, 'reading', {
57
- enumerable: true,
58
- configurable: true,
59
- writable: true,
60
- value: false
61
- });
62
- Object.defineProperty(this, 'currentRangeIndex', {
63
- enumerable: true,
64
- configurable: true,
65
- writable: true,
66
- value: 0
67
- });
68
- Object.defineProperty(this, 'readState', {
69
- enumerable: true,
70
- configurable: true,
71
- writable: true,
72
- value: 0 /* ReadState.PREFIX */
73
- });
26
+ this.bytesRead = 0;
27
+ this.reading = false;
28
+ this.currentRangeIndex = 0;
29
+ this.readState = 0 /* ReadState.PREFIX */;
74
30
  this.fs = fs;
75
31
  this.path = path;
76
32
  this.ranges = ranges;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koa-files",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "A static files serving middleware for koa.",
5
5
  "type": "module",
6
6
  "main": "cjs/index.cjs",
@@ -59,7 +59,7 @@
59
59
  "tslib": "^2.8.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@rollup/plugin-typescript": "^12.1.0",
62
+ "@rollup/plugin-typescript": "^12.1.1",
63
63
  "@types/etag": "^1.8.3",
64
64
  "@types/koa": "^2.15.0",
65
65
  "@types/range-parser": "^1.2.7",