@ostro/filesystem 0.0.0-alpha.4 → 1.0.2

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/filesystem.js CHANGED
@@ -44,8 +44,6 @@ class Filesystem extends FilesystemContract {
44
44
  return fs.chmod($path, $mode);
45
45
  }
46
46
  return fs.stat($path).then(stat => {
47
- console.log(stat)
48
- console.log(stat.mode)
49
47
  return stats.mode
50
48
  });
51
49
 
@@ -38,8 +38,9 @@ class FilesystemAdapter {
38
38
  }
39
39
 
40
40
  delete($path, ...rest) {
41
- let callback = Array.from(rest).find(arg => typeof arg == 'function')
42
- let options = Array.from(rest).find(arg => typeof arg == 'object') || {}
41
+ rest = Array.from(rest)
42
+ let callback = rest.find(arg => typeof arg == 'function')
43
+ let options = rest.find(arg => typeof arg == 'object') || {}
43
44
  if (callback)
44
45
  return this[kAdapter].delete($path, options, callback)
45
46
  else {
@@ -68,7 +69,7 @@ class FilesystemAdapter {
68
69
  }
69
70
 
70
71
  put($path, content, options = {}) {
71
-
72
+
72
73
  return new Promise((resolve, reject) => {
73
74
  this[kAdapter].write($path, content, options, (err, data, basePath) => {
74
75
  if (err) {
@@ -81,12 +82,11 @@ class FilesystemAdapter {
81
82
  }
82
83
 
83
84
  putFile($path, $file, $options = {}) {
84
- $options.filename = $file.getHashname()
85
- return this.putFileAs($path, $file, $options);
85
+ return this.putFileAs($path, $file, $file.getHashname(), $options);
86
86
  }
87
87
 
88
88
  putFileAs($path, $file, $name, $options = {}) {
89
- $path = path.join($path,$name)
89
+ $path = path.join($path, $name)
90
90
  return this.put($path, $file.getBufferData(), $options);
91
91
  }
92
92
 
@@ -8,7 +8,7 @@ class FileSystemManager extends Manager {
8
8
 
9
9
  $type = 'filesystem';
10
10
 
11
- constructor($app){
11
+ constructor($app) {
12
12
  super($app)
13
13
  this[kHandler] = this.getConfig('handler')
14
14
  if (typeof this[kHandler] != 'function' || typeof this[kHandler] != 'object') {
@@ -43,7 +43,7 @@ class FileSystemManager extends Manager {
43
43
  return super.resolve($name, $config)
44
44
  }
45
45
 
46
-
46
+
47
47
  createLocalDriver($config) {
48
48
  return this.adapt(new(require('./adapter/local'))($config['root'], $config), $config);
49
49
  }
@@ -57,7 +57,7 @@ class FileSystemManager extends Manager {
57
57
  }
58
58
 
59
59
  adapt(adapter, config) {
60
- return new FilesystemAdapter(adapter,this[kHandler]);
60
+ return new FilesystemAdapter(adapter, this[kHandler]);
61
61
  }
62
62
 
63
63
  getConfig(name) {
@@ -65,7 +65,7 @@ class FileSystemManager extends Manager {
65
65
  }
66
66
 
67
67
  getDefaultCloudDriver() {
68
- return this.getConfig('cloud');
68
+ return super.getConfig('cloud');
69
69
  }
70
70
 
71
71
  registerToRequest(FileRequest) {
@@ -82,7 +82,7 @@ class FileSystemManager extends Manager {
82
82
  }
83
83
 
84
84
  }
85
-
85
+
86
86
  }
87
87
 
88
88
  module.exports = FileSystemManager
@@ -40,6 +40,7 @@ class filesystemServiceProvider extends ServiceProvider {
40
40
  getCloudDriver() {
41
41
  return this.$app['config']['filesystems.cloud'];
42
42
  }
43
+
43
44
  boot() {
44
45
 
45
46
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@ostro/filesystem",
3
- "version": "0.0.0-alpha.4",
3
+ "version": "1.0.2",
4
4
  "description": "filesystem module for OstroJS",
5
5
  "main": "filesystemManager.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "dependencies": {
10
- "@ostro/contracts": "^0.0.0-alpha",
11
- "@ostro/support": "^0.0.0-alpha",
10
+ "@ostro/support": "^1.0.2",
11
+ "@ostro/contracts": "^1.0.0",
12
12
  "fs-extra": "^10.0.0",
13
13
  "lodash.get": "^4.4.2",
14
14
  "filehound": "^1.17.4",
@@ -19,7 +19,10 @@
19
19
  },
20
20
  "engineStrict": true,
21
21
  "keywords": [
22
- "filesystem"
22
+ "filesystem",
23
+ "storage",
24
+ "NodeJS Filesystem",
25
+ "OstroJS Filesystem"
23
26
  ],
24
27
  "author": "amar",
25
28
  "license": "MIT",