exaroton 1.11.1 → 1.11.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/README.md CHANGED
@@ -239,6 +239,23 @@ try {
239
239
  }
240
240
  ```
241
241
 
242
+ ##### List files in a directory
243
+ ```js
244
+ try {
245
+ // get the children of the directory
246
+ let children = await file.getChildren();
247
+ console.log(children);
248
+
249
+ // iterate over the children
250
+ // each child is a file object
251
+ for (let child of children) {
252
+ console.log(child);
253
+ }
254
+ } catch (e) {
255
+ console.error(e.message);
256
+ }
257
+ ```
258
+
242
259
  ##### Get the content of a file / download a file
243
260
  ```js
244
261
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exaroton",
3
- "version": "1.11.1",
3
+ "version": "1.11.3",
4
4
  "description": "exaroton API client",
5
5
  "homepage": "https://exaroton.com",
6
6
  "main": "index.js",
@@ -79,7 +79,7 @@ class File {
79
79
  * @param {string|null} path
80
80
  */
81
81
  constructor(path = null) {
82
- if (path) {
82
+ if (path !== null) {
83
83
  this.setPath(path);
84
84
  }
85
85
  }
@@ -265,7 +265,7 @@ class File {
265
265
  * @return {Promise<[File]|null>}
266
266
  */
267
267
  async getChildren() {
268
- if (this.children === null && this.isDirectory) {
268
+ if (this.children === null && (this.isDirectory || this.isDirectory === undefined)) {
269
269
  await this.getInfo();
270
270
  }
271
271
 
@@ -9,6 +9,7 @@ const ServerStatus = {
9
9
  LOADING: 6,
10
10
  CRASHED: 7,
11
11
  PENDING: 8,
12
+ TRANSFERRING: 9,
12
13
  PREPARING: 10
13
14
  };
14
15