@gesslar/toolkit 3.12.3 → 3.13.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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "gesslar",
6
6
  "url": "https://gesslar.dev"
7
7
  },
8
- "version": "3.12.3",
8
+ "version": "3.13.0",
9
9
  "license": "Unlicense",
10
10
  "homepage": "https://github.com/gesslar/toolkit#readme",
11
11
  "repository": {
@@ -197,29 +197,6 @@ export default class CappedDirectoryObject extends DirectoryObject {
197
197
  return this.#cappedParentPath
198
198
  }
199
199
 
200
- /**
201
- * Returns a JSON representation of the DirectoryObject.
202
- *
203
- * @returns {object} JSON representation of the DirectoryObject
204
- */
205
- toJSON() {
206
- return {
207
- supplied: this.supplied,
208
- path: this.path,
209
- url: this.url.toString(),
210
- name: this.name,
211
- module: this.module,
212
- extension: this.extension,
213
- isFile: this.isFile,
214
- isDirectory: this.isDirectory,
215
- parent: this.parent,
216
- parentPath: this.parentPath,
217
- capped: this.isCapped,
218
- cap: this.cap,
219
- real: this.real
220
- }
221
- }
222
-
223
200
  /**
224
201
  * Override exists to use real filesystem path.
225
202
  *
@@ -151,40 +151,8 @@ export default class DirectoryObject extends FS {
151
151
  return this.isCapped
152
152
  ?`[${this.constructor.name}: ${this.path} → ${this.real.path}]`
153
153
  :`[${this.constructor.name}: ${this.path}]`
154
-
155
- return this.isCapped
156
- ?`[${this.constructor.name}: ${this.path} → ${this.real.path}]`
157
- :`[${this.constructor.name}: ${this.path}]`
158
- }
159
-
160
- /**
161
- * Returns a JSON representation of the DirectoryObject.
162
- *
163
- * @returns {object} JSON representation of the DirectoryObject
164
- */
165
- toJSON() {
166
- return {
167
- supplied: this.supplied,
168
- path: this.path,
169
- url: this.url.toString(),
170
- name: this.name,
171
- module: this.module,
172
- extension: this.extension,
173
- isFile: this.isFile,
174
- isDirectory: this.isDirectory,
175
- parent: this.parent?.path ?? null,
176
- }
177
154
  }
178
155
 
179
- /**
180
- * Custom inspect method for Node.js console.
181
- *
182
- * @returns {object} JSON representation of this object.
183
- */
184
- // [util.inspect.custom]() {
185
- // return this.toJSON()
186
- // }
187
-
188
156
  /**
189
157
  * Checks if the directory exists (async).
190
158
  *
@@ -7,7 +7,6 @@
7
7
  import JSON5 from "json5"
8
8
  import fs from "node:fs/promises"
9
9
  import path from "node:path"
10
- import util from "node:util"
11
10
  import YAML from "yaml"
12
11
  import {URL} from "node:url"
13
12
 
@@ -135,36 +134,9 @@ export default class FileObject extends FS {
135
134
  * @returns {string} string representation of the FileObject
136
135
  */
137
136
  toString() {
138
- return `[FileObject: ${this.path}]`
139
- }
140
-
141
- /**
142
- * Returns a JSON representation of the FileObject.
143
- *
144
- * @returns {object} JSON representation of the FileObject
145
- */
146
- toJSON() {
147
- return {
148
- supplied: this.supplied,
149
- path: this.path,
150
- url: this.url.toString(),
151
- name: this.name,
152
- module: this.module,
153
- extension: this.extension,
154
- isFile: this.isFile,
155
- isDirectory: this.isDirectory,
156
- parentPath: this.parentPath,
157
- parent: this.parent ? this.parent.path : null
158
- }
159
- }
160
-
161
- /**
162
- * Custom inspect method for Node.js console.
163
- *
164
- * @returns {object} JSON representation of this object.
165
- */
166
- [util.inspect.custom]() {
167
- return this.toJSON()
137
+ return this.parent.isCapped
138
+ ?`[${this.constructor.name}: ${this.path} → ${this.real.path}]`
139
+ :`[${this.constructor.name}: ${this.path}]`
168
140
  }
169
141
 
170
142
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CappedDirectoryObject.d.ts","sourceRoot":"","sources":["../../lib/CappedDirectoryObject.js"],"names":[],"mappings":"AAiBA;;;;;;;;GAQG;AACH;IAoEE;;;;;;;;;;;OAWG;IACH,kBAPa,qBAAqB,CASjC;IA5ED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,wBAxBW,MAAM,gBAqDhB;IAkBD;;;;;;;;;;;OAWG;IACH,gBARa,OAAO,CAUnB;IAED;;;;;;;;;;;;OAYG;IACH,WARa,qBAAqB,CAUjC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,YAba,eAAe,CAe3B;IAED;;;;;;;;;;;;;OAaG;IACH,cAPa,qBAAqB,GAAC,IAAI,CAStC;IAED;;;;;;;;;;;OAWG;IACH,kBARa,MAAM,GAAC,IAAI,CAUvB;IAkCD;;;;;OAKG;IACH,qBAFa,OAAO,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAAC,WAAW,QAAO;KAAC,CAAC,CAUnE;;CA8BF;4BAvQ2B,sBAAsB;uBAC3B,iBAAiB"}
1
+ {"version":3,"file":"CappedDirectoryObject.d.ts","sourceRoot":"","sources":["../../lib/CappedDirectoryObject.js"],"names":[],"mappings":"AAiBA;;;;;;;;GAQG;AACH;IAoEE;;;;;;;;;;;OAWG;IACH,kBAPa,qBAAqB,CASjC;IA5ED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,wBAxBW,MAAM,gBAqDhB;IAkBD;;;;;;;;;;;OAWG;IACH,gBARa,OAAO,CAUnB;IAED;;;;;;;;;;;;OAYG;IACH,WARa,qBAAqB,CAUjC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,YAba,eAAe,CAe3B;IAED;;;;;;;;;;;;;OAaG;IACH,cAPa,qBAAqB,GAAC,IAAI,CAStC;IAED;;;;;;;;;;;OAWG;IACH,kBARa,MAAM,GAAC,IAAI,CAUvB;IAWD;;;;;OAKG;IACH,qBAFa,OAAO,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAAC,WAAW,QAAO;KAAC,CAAC,CAUnE;;CA8BF;4BAhP2B,sBAAsB;uBAC3B,iBAAiB"}
@@ -63,17 +63,6 @@ export default class DirectoryObject extends FS {
63
63
  * @param {string?} [directory="."] - The directory path or DirectoryObject (defaults to current directory)
64
64
  */
65
65
  constructor(directory?: string | null);
66
- /**
67
- * Returns a JSON representation of the DirectoryObject.
68
- *
69
- * @returns {object} JSON representation of the DirectoryObject
70
- */
71
- toJSON(): object;
72
- /**
73
- * Custom inspect method for Node.js console.
74
- *
75
- * @returns {object} JSON representation of this object.
76
- */
77
66
  /**
78
67
  * Checks if the directory exists (async).
79
68
  *
@@ -1 +1 @@
1
- {"version":3,"file":"DirectoryObject.d.ts","sourceRoot":"","sources":["../../lib/DirectoryObject.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH;IAmEE;;;;;;;;;OASG;IACH,kBALa,eAAe,CAO3B;IA/CD;;;;OAIG;IACH,wBAFW,MAAM,OAAC,EA8BjB;IA+BD;;;;OAIG;IACH,UAFa,MAAM,CAclB;IAED;;;;OAIG;IAKH;;;;OAIG;IACH,cAFa,OAAO,CAAC,OAAO,CAAC,CAI5B;IAED;;;;OAIG;IACH,gBAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,YAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,WAFa,GAAG,CAIf;IAED;;;;OAIG;IACH,YAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,cAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,iBAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,WAFa,MAAM,CAIlB;IAED;;;;;;;OAOG;IACH,aALa,KAAK,CAAC,MAAM,CAAC,CAOzB;IAED;;;;;;;;;;;;OAYG;IACH,cARa,eAAe,GAAC,IAAI,CAsBhC;IAED;;;;OAIG;IACH,cAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,mBAFa,OAAO,CAInB;IAqBD;;;;;;;;;;;;;;;OAeG;IACH,WAZW,MAAM,GACJ,OAAO,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAAC,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;KAAC,CAAC,CAiDpF;IAED;;;;;;;;;;;;OAYG;IACH,uBARW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAqBzB;IAyBD;;;;;;;;;;;;;;;OAeG;IACH,cAZa,eAAe,CAc3B;IAED;;;;;;;;;;;;;;OAcG;IACH,UARa,OAAO,CAAC,IAAI,CAAC,CAkBzB;IAED;;;;;OAKG;IACH,kBAHW,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CAM5B;IAED;;;;;OAKG;IACH,sBAHW,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CAO5B;IAUD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,kBAdW,MAAM,GACJ,eAAe,CAqB3B;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,cAbW,MAAM,GACJ,UAAU,CAoBtB;;CACF;eA9jBc,SAAS;uBACD,iBAAiB"}
1
+ {"version":3,"file":"DirectoryObject.d.ts","sourceRoot":"","sources":["../../lib/DirectoryObject.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH;IAmEE;;;;;;;;;OASG;IACH,kBALa,eAAe,CAO3B;IA/CD;;;;OAIG;IACH,wBAFW,MAAM,OAAC,EA8BjB;IA2BD;;;;OAIG;IACH,cAFa,OAAO,CAAC,OAAO,CAAC,CAI5B;IAED;;;;OAIG;IACH,gBAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,YAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,WAFa,GAAG,CAIf;IAED;;;;OAIG;IACH,YAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,cAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,iBAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,WAFa,MAAM,CAIlB;IAED;;;;;;;OAOG;IACH,aALa,KAAK,CAAC,MAAM,CAAC,CAOzB;IAED;;;;;;;;;;;;OAYG;IACH,cARa,eAAe,GAAC,IAAI,CAsBhC;IAED;;;;OAIG;IACH,cAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,mBAFa,OAAO,CAInB;IAqBD;;;;;;;;;;;;;;;OAeG;IACH,WAZW,MAAM,GACJ,OAAO,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAAC,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;KAAC,CAAC,CAiDpF;IAED;;;;;;;;;;;;OAYG;IACH,uBARW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAqBzB;IAyBD;;;;;;;;;;;;;;;OAeG;IACH,cAZa,eAAe,CAc3B;IAED;;;;;;;;;;;;;;OAcG;IACH,UARa,OAAO,CAAC,IAAI,CAAC,CAkBzB;IAED;;;;;OAKG;IACH,kBAHW,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CAM5B;IAED;;;;;OAKG;IACH,sBAHW,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CAO5B;IAUD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,kBAdW,MAAM,GACJ,eAAe,CAqB3B;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,cAbW,MAAM,GACJ,UAAU,CAoBtB;;CACF;eA9hBc,SAAS;uBACD,iBAAiB"}
@@ -14,7 +14,6 @@
14
14
  * @property {Promise<boolean>} exists - Whether the file exists (async)
15
15
  */
16
16
  export default class FileObject extends FS {
17
- [x: number]: () => object;
18
17
  /**
19
18
  * Configuration mapping data types to their respective parser modules for loadData method.
20
19
  * Each parser module must have a .parse() method that accepts a string and returns parsed data.
@@ -31,12 +30,6 @@ export default class FileObject extends FS {
31
30
  * @param {DirectoryObject|string|null} [parent] - The parent directory (object or string)
32
31
  */
33
32
  constructor(fileName: string, parent?: DirectoryObject | string | null);
34
- /**
35
- * Returns a JSON representation of the FileObject.
36
- *
37
- * @returns {object} JSON representation of the FileObject
38
- */
39
- toJSON(): object;
40
33
  /**
41
34
  * Checks if the file exists (async).
42
35
  *
@@ -1 +1 @@
1
- {"version":3,"file":"FileObject.d.ts","sourceRoot":"","sources":["../../lib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