fsd 0.13.0 → 0.14.0
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/LICENSE +1 -1
- package/lib/file.js +4 -6
- package/lib/fsd.js +1 -1
- package/package.json +3 -3
package/LICENSE
CHANGED
package/lib/file.js
CHANGED
|
@@ -7,13 +7,11 @@ const isStream = require("is-stream");
|
|
|
7
7
|
const stream_1 = require("stream");
|
|
8
8
|
const debug = Debugger('fsd');
|
|
9
9
|
class FSDFile {
|
|
10
|
-
constructor(
|
|
11
|
-
|
|
12
|
-
if (!path)
|
|
10
|
+
constructor(pathOrFile, adapter, metadata) {
|
|
11
|
+
if (!pathOrFile)
|
|
13
12
|
throw new Error('FSD File must initialize with path');
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
13
|
+
debug('initialize file %s', pathOrFile);
|
|
14
|
+
let path = typeof pathOrFile === 'object' ? pathOrFile.path : pathOrFile;
|
|
17
15
|
if (path[0] !== '/') {
|
|
18
16
|
path = `/${path}`;
|
|
19
17
|
}
|
package/lib/fsd.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = FSD;
|
|
3
4
|
const file_1 = require("./file");
|
|
4
5
|
function FSD(options) {
|
|
5
6
|
function fsd(path) {
|
|
@@ -8,4 +9,3 @@ function FSD(options) {
|
|
|
8
9
|
fsd.adapter = options.adapter;
|
|
9
10
|
return fsd;
|
|
10
11
|
}
|
|
11
|
-
exports.default = FSD;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fsd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "General file system driver for Node.js",
|
|
5
5
|
"main": "lib/fsd.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"author": "Liang <liang@miaomo.cc> (https://github.com/liangxingchen)",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"debug": "^4.
|
|
15
|
+
"debug": "^4.4.0",
|
|
16
16
|
"is-stream": "^2.0.1",
|
|
17
17
|
"slash": "^3.0.0"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "74e32bf47242909f040eb6012dda56e5c5a668a0"
|
|
20
20
|
}
|