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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018 郑州脉冲软件科技有限公司
3
+ Copyright (c) 2023 郑州渺漠信息科技有限公司
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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(path, adapter, metadata) {
11
- debug('initialize file %s', path);
12
- if (!path)
10
+ constructor(pathOrFile, adapter, metadata) {
11
+ if (!pathOrFile)
13
12
  throw new Error('FSD File must initialize with path');
14
- if (typeof path === 'object' && path.path) {
15
- ({ path } = path);
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.13.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.3.4",
15
+ "debug": "^4.4.0",
16
16
  "is-stream": "^2.0.1",
17
17
  "slash": "^3.0.0"
18
18
  },
19
- "gitHead": "1548128573c0fd22977706a6704029ec3ca3bab6"
19
+ "gitHead": "74e32bf47242909f040eb6012dda56e5c5a668a0"
20
20
  }