@gesslar/toolkit 3.9.0 → 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.
@@ -36,7 +36,7 @@ export default class Data {
36
36
  * @param {string} append - The string to append
37
37
  * @returns {string} The appended string
38
38
  */
39
- static appendString(string: string, append: string): string;
39
+ static append(string: string, append: string): string;
40
40
  /**
41
41
  * Prepends a string to another string if it does not already start with it.
42
42
  *
@@ -44,7 +44,51 @@ export default class Data {
44
44
  * @param {string} prepend - The string to prepend
45
45
  * @returns {string} The prepended string
46
46
  */
47
- static prependString(string: string, prepend: string): string;
47
+ static prepend(string: string, prepend: string): string;
48
+ /**
49
+ * Remove a suffix from the end of a string if present.
50
+ *
51
+ * @param {string} string - The string to process
52
+ * @param {string} toChop - The suffix to remove from the end
53
+ * @param {boolean} [caseInsensitive=false] - Whether to perform case-insensitive matching
54
+ * @returns {string} The string with suffix removed, or original if suffix not found
55
+ * @example
56
+ * Data.chopRight("hello.txt", ".txt") // "hello"
57
+ * Data.chopRight("Hello", "o") // "Hell"
58
+ * Data.chopRight("HELLO", "lo", true) // "HEL"
59
+ */
60
+ static chopRight(string: string, toChop: string, caseInsensitive?: boolean): string;
61
+ /**
62
+ * Remove a prefix from the beginning of a string if present.
63
+ *
64
+ * @param {string} string - The string to process
65
+ * @param {string} toChop - The prefix to remove from the beginning
66
+ * @param {boolean} [caseInsensitive=false] - Whether to perform case-insensitive matching
67
+ * @returns {string} The string with prefix removed, or original if prefix not found
68
+ * @example
69
+ * Data.chopLeft("hello.txt", "hello") // ".txt"
70
+ * Data.chopLeft("Hello", "H") // "ello"
71
+ * Data.chopLeft("HELLO", "he", true) // "LLO"
72
+ */
73
+ static chopLeft(string: string, toChop: string, caseInsensitive?: boolean): string;
74
+ /**
75
+ * Chop a string after the first occurence of another string.
76
+ *
77
+ * @param {string} string - The string to search
78
+ * @param {string} needle - The bit to chop after
79
+ * @param {boolean} caseInsensitive - Whether to search insensitive to case
80
+ * @returns {string} The remaining string
81
+ */
82
+ static chopAfter(string: string, needle: string, caseInsensitive?: boolean): string;
83
+ /**
84
+ * Chop a string before the first occurrence of another string.
85
+ *
86
+ * @param {string} string - The string to search
87
+ * @param {string} needle - The bit to chop before
88
+ * @param {boolean} caseInsensitive - Whether to search insensitive to case
89
+ * @returns {string} The remaining string
90
+ */
91
+ static chopBefore(string: string, needle: string, caseInsensitive?: boolean): string;
48
92
  /**
49
93
  * Creates a type spec from a string. A type spec is an array of objects
50
94
  * defining the type of a value and whether an array is expected.
@@ -1 +1 @@
1
- {"version":3,"file":"Data.d.ts","sourceRoot":"","sources":["../../../browser/lib/Data.js"],"names":[],"mappings":"AAUA;IACA;;;;;OAKG;IACD,mBAFQ,KAAK,CAAC,MAAM,CAAC,CAgBnB;IAEF;;;;;OAKG;IACH,qBAFU,KAAK,CAAC,MAAM,CAAC,CAmBrB;IAEF;;;;;;;OAOG;IACH,kBAFU,KAAK,CAAC,MAAM,CAAC,CAKrB;IAEF;;;;;OAKG;IACH,uBAFU,KAAK,CAAC,MAAM,CAAC,CAE6C;IAEpE;;;;;;OAMG;IACH,4BAJW,MAAM,UACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,6BAJW,MAAM,WACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;OAOG;IACH,2BAJW,MAAM,WACN,MAAM,GACJ,KAAK,CAAC,MAAM,CAAC,CAIzB;IAED;;;;;;;OAOG;IACH,qBALW,OAAO,QACP,MAAM,GAAC,QAAQ,YACf,MAAM,GACJ,OAAO,CAQnB;IAED;;;;;OAKG;IACH,yBAHW,MAAM,GACJ,OAAO,CASnB;IAED;;;;;;;;OAQG;IACH,yBAJW,OAAO,QACP,MAAM,GACJ,OAAO,CAwBnB;IAED;;;;;OAKG;IACH,qBAHW,OAAO,GACL,MAAM,CAclB;IAED;;;;;OAKG;IACH,wBAHW,OAAO,GACL,OAAO,CAInB;IAED;;;;;;;;OAQG;IACH,sBALW,OAAO,oBACP,OAAO,GAEL,OAAO,CA2BnB;IAED;;;;;OAKG;IACH,6BAHW,MAAM,GACJ,MAAM,CAmBlB;IAED;;;;;;;OAOG;IACH,6BAJW,MAAM,QACN,KAAK,CAAC,MAAM,CAAC,GACX,MAAM,CAiBlB;IAED;;;;;;;OAOG;IACH,2BAJW,MAAM,QACN,KAAK,CAAC,MAAM,CAAC,SACb,OAAO,QAMjB;IAED;;;;;OAKG;IACH,+BAHc,MAAM,EAAA,GACP,MAAM,CAqBlB;IAED;;;;;;;OAOG;IACH,wBAJW,KAAK,CAAC,OAAO,CAAC,aACd,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,GAClC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAMnC;IAED;;;;;;;OAOG;IACH,kBALW,MAAM,OACN,MAAM,OACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;OAOG;IACH,oBALW,MAAM,OACN,MAAM,OACN,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,4BAbW,OAAO,GACL,OAAO,CA+BnB;IAED;;;;;;;;;;;;;;;OAeG;IACH,uBAXW,OAAO,GACL,OAAO,CAgBnB;CACF;qBA5aoB,eAAe"}
1
+ {"version":3,"file":"Data.d.ts","sourceRoot":"","sources":["../../../browser/lib/Data.js"],"names":[],"mappings":"AAUA;IACA;;;;;OAKG;IACD,mBAFQ,KAAK,CAAC,MAAM,CAAC,CAgBnB;IAEF;;;;;OAKG;IACH,qBAFU,KAAK,CAAC,MAAM,CAAC,CAmBrB;IAEF;;;;;;;OAOG;IACH,kBAFU,KAAK,CAAC,MAAM,CAAC,CAKrB;IAEF;;;;;OAKG;IACH,uBAFU,KAAK,CAAC,MAAM,CAAC,CAE2D;IAElF;;;;;;OAMG;IACH,sBAJW,MAAM,UACN,MAAM,GACJ,MAAM,CAMlB;IAED;;;;;;OAMG;IACH,uBAJW,MAAM,WACN,M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AC,CAAC,CAMnC;IAED;;;;;;;OAOG;IACH,kBALW,MAAM,OACN,MAAM,OACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;OAOG;IACH,oBALW,MAAM,OACN,MAAM,OACN,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,4BAbW,OAAO,GACL,OAAO,CA+BnB;IAED;;;;;;;;;;;;;;;OAeG;IACH,uBAXW,OAAO,GACL,OAAO,CAgBnB;CACF;qBAhgBoB,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"TypeSpec.d.ts","sourceRoot":"","sources":["../../../browser/lib/TypeSpec.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH;IAGE;;;;;OAKG;IACH,oBAHW,MAAM,WACN,OAAO,EAUjB;IAJC,aAAwB;IACxB,eAAgC;IAChC,6BAA2C;IAI7C;;;;OAIG;IACH,YAFa,MAAM,CAQlB;IAED;;;;OAIG;IACH,UAFa,OAAO,CASnB;IAED;;;;OAIG;IACH,kBAFW,CAAS,IAAO,EAAP,OAAO,KAAG,IAAI,QAIjC;IAED;;;;;OAKG;IACH,gBAHW,CAAS,IAAO,EAAP,OAAO,KAAG,OAAO,GACxB,OAAO,CAInB;IAED;;;;;OAKG;IACH,eAHW,CAAS,IAAO,EAAP,OAAO,KAAG,OAAO,GACxB,OAAO,CAInB;IAED;;;;;OAKG;IACH,iBAHW,CAAS,IAAO,EAAP,OAAO,KAAG,OAAO,GACxB,KAAK,CAAC,OAAO,CAAC,CAI1B;IAED;;;;;OAKG;IACH,cAHW,CAAS,IAAO,EAAP,OAAO,KAAG,OAAO,GACxB,KAAK,CAAC,OAAO,CAAC,CAI1B;IAED;;;;;;OAMG;IACH,iBAJW,CAAS,IAAO,EAAP,OAAO,EAAE,IAAO,EAAP,OAAO,KAAG,OAAO,gBACnC,OAAO,GACL,OAAO,CAInB;IAED;;;;;OAKG;IACH,eAHW,CAAS,IAAO,EAAP,OAAO,KAAG,OAAO,GACxB,MAAM,GAAC,SAAS,CAI5B;IAED;;;;;;;;OAQG;IACH,eALW,OAAO,WACP,OAAO,GAEL,OAAO,CAInB;IAED,2CA2DC;;CAmDF"}
1
+ {"version":3,"file":"TypeSpec.d.ts","sourceRoot":"","sources":["../../../browser/lib/TypeSpec.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH;IAGE;;;;;OAKG;IACH,oBAHW,MAAM,WACN,OAAO,EAUjB;IAJC,aAAwB;IACxB,eAAgC;IAChC,6BAA2C;IAI7C;;;;OAIG;IACH,YAFa,MAAM,CAQlB;IAED;;;;OAIG;IACH,UAFa,OAAO,CASnB;IAED;;;;OAIG;IACH,kBAFW,CAAS,IAAO,EAAP,OAAO,KAAG,IAAI,QAIjC;IAED;;;;;OAKG;IACH,gBAHW,CAAS,IAAO,EAAP,OAAO,KAAG,OAAO,GACxB,OAAO,CAInB;IAED;;;;;OAKG;IACH,eAHW,CAAS,IAAO,EAAP,OAAO,KAAG,OAAO,GACxB,OAAO,CAInB;IAED;;;;;OAKG;IACH,iBAHW,CAAS,IAAO,EAAP,OAAO,KAAG,OAAO,GACxB,KAAK,CAAC,OAAO,CAAC,CAI1B;IAED;;;;;OAKG;IACH,cAHW,CAAS,IAAO,EAAP,OAAO,KAAG,OAAO,GACxB,KAAK,CAAC,OAAO,CAAC,CAI1B;IAED;;;;;;OAMG;IACH,iBAJW,CAAS,IAAO,EAAP,OAAO,EAAE,IAAO,EAAP,OAAO,KAAG,OAAO,gBACnC,OAAO,GACL,OAAO,CAInB;IAED;;;;;OAKG;IACH,eAHW,CAAS,IAAO,EAAP,OAAO,KAAG,OAAO,GACxB,MAAM,GAAC,SAAS,CAI5B;IAED;;;;;;;;OAQG;IACH,eALW,OAAO,WACP,OAAO,GAEL,OAAO,CAInB;IAED,2CA6DC;;CAmDF"}
@@ -28,9 +28,8 @@ export default class CappedDirectoryObject extends DirectoryObject {
28
28
  * (virtual root). With a parent, the path is resolved relative to the parent's
29
29
  * cap using virtual path semantics (absolute paths treated as cap-relative).
30
30
  *
31
- * @param {string} [dirPath="."] - Directory path (becomes cap if no parent, else relative to parent's cap, defaults to current directory)
31
+ * @param {string} [directory="."] - Directory path (becomes cap if no parent, else relative to parent's cap, defaults to current directory)
32
32
  * @param {CappedDirectoryObject?} [parent] - Optional parent capped directory
33
- * @param {boolean} [temporary=false] - Whether this is a temporary directory
34
33
  * @throws {Sass} If parent is provided but not a CappedDirectoryObject
35
34
  * @throws {Sass} If the resulting path would escape the cap
36
35
  * @example
@@ -53,33 +52,34 @@ export default class CappedDirectoryObject extends DirectoryObject {
53
52
  * const config = new CappedDirectoryObject("/etc/config", cache)
54
53
  * // path: /home/user/.cache/etc/config, cap: /home/user/.cache
55
54
  */
56
- constructor(dirPath?: string, parent?: CappedDirectoryObject | null, temporary?: boolean);
55
+ constructor(directory?: string, source?: any);
57
56
  /**
58
- * Re-caps this directory to itself, making it the new root of the capped tree.
59
- * This is a protected method intended for use by subclasses like TempDirectoryObject.
57
+ * Indicates whether this directory is capped (constrained to a specific tree).
58
+ * Always returns true for CappedDirectoryObject instances.
60
59
  *
61
- * @protected
62
- */
63
- protected _recapToSelf(): void;
64
- /**
65
- * Returns the cap path for this directory.
60
+ * @returns {boolean} True for all CappedDirectoryObject instances
61
+ * @example
62
+ * const capped = new TempDirectoryObject("myapp")
63
+ * console.log(capped.isCapped) // true
66
64
  *
67
- * @returns {string} The cap directory path
65
+ * const regular = new DirectoryObject("/tmp")
66
+ * console.log(regular.isCapped) // false
68
67
  */
69
- get cap(): string;
68
+ get isCapped(): boolean;
70
69
  /**
71
- * Returns whether this directory is capped.
70
+ * Returns the cap (root) of the capped directory tree.
71
+ * For root CappedDirectoryObject instances, returns itself.
72
+ * For children, returns the inherited cap from the parent chain.
72
73
  *
73
- * @returns {boolean} Always true for CappedDirectoryObject instances
74
- */
75
- get capped(): boolean;
76
- /**
77
- * Returns the real filesystem path (for internal and subclass use).
74
+ * @returns {CappedDirectoryObject} The cap directory object (root of the capped tree)
75
+ * @example
76
+ * const temp = new TempDirectoryObject("myapp")
77
+ * console.log(temp.cap === temp) // true (root is its own cap)
78
78
  *
79
- * @protected
80
- * @returns {string} The actual filesystem path
79
+ * const subdir = temp.getDirectory("data")
80
+ * console.log(subdir.cap === temp) // true (child inherits parent's cap)
81
81
  */
82
- protected get realPath(): string;
82
+ get cap(): CappedDirectoryObject;
83
83
  /**
84
84
  * Returns a plain DirectoryObject representing the actual filesystem location.
85
85
  * This provides an "escape hatch" from the capped environment to interact
@@ -115,50 +115,25 @@ export default class CappedDirectoryObject extends DirectoryObject {
115
115
  */
116
116
  get parent(): CappedDirectoryObject | null;
117
117
  /**
118
- * Returns the URL with virtual path (cap-relative).
119
- *
120
- * @returns {URL} Virtual URL
121
- */
122
- get url(): URL;
123
- /**
124
- * Returns a generator that walks up to the cap.
125
- *
126
- * @returns {Generator<DirectoryObject>} Generator yielding parent directories
127
- */
128
- get walkUp(): Generator<DirectoryObject>;
129
- /**
130
- * Creates a new CappedDirectoryObject by extending this directory's path.
131
- *
132
- * All paths are coerced to remain within the cap directory tree:
133
- * - Absolute paths (e.g., "/foo") are treated as relative to the cap
134
- * - Parent traversal ("..") is allowed but clamped at the cap boundary
135
- * - The cap acts as the virtual root directory
118
+ * Returns the path of the parent directory.
119
+ * Returns null if this directory is at the cap root (no parent).
136
120
  *
137
- * @param {string} newPath - The path to resolve (can be absolute or contain ..)
138
- * @returns {CappedDirectoryObject} A new CappedDirectoryObject with the coerced path
121
+ * @returns {string|null} The parent directory path, or null if at cap root
139
122
  * @example
140
- * const capped = new TempDirectoryObject("myapp")
141
- * const subDir = capped.getDirectory("data")
142
- * console.log(subDir.path) // "/tmp/myapp-ABC123/data"
143
- *
144
- * @example
145
- * // Absolute paths are relative to cap
146
- * const abs = capped.getDirectory("/foo/bar")
147
- * console.log(abs.path) // "/tmp/myapp-ABC123/foo/bar"
123
+ * const temp = new TempDirectoryObject("myapp")
124
+ * console.log(temp.parentPath) // null (at cap root)
148
125
  *
149
- * @example
150
- * // Excessive .. traversal clamps to cap
151
- * const up = capped.getDirectory("../../../etc/passwd")
152
- * console.log(up.path) // "/tmp/myapp-ABC123" (clamped to cap)
126
+ * const subdir = temp.getDirectory("data")
127
+ * console.log(subdir.parentPath) // "/data" or similar (parent's virtual path)
153
128
  */
154
- getDirectory(newPath: string): CappedDirectoryObject;
129
+ get parentPath(): string | null;
155
130
  /**
156
131
  * Override read to use real filesystem path and return capped objects.
157
132
  *
158
133
  * @param {string} [pat=""] - Optional glob pattern
159
134
  * @returns {Promise<{files: Array<FileObject>, directories: Array}>} Directory contents
160
135
  */
161
- read(pat?: string): Promise<{
136
+ read(...arg: any[]): Promise<{
162
137
  files: Array<FileObject>;
163
138
  directories: any[];
164
139
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"CappedDirectoryObject.d.ts","sourceRoot":"","sources":["../../lib/CappedDirectoryObject.js"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH;IA2FE;;;;;;;;;;;OAWG;IACH,kBAPa,qBAAqB,CASjC;IAtGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,sBAzBW,MAAM,WACN,qBAAqB,OAAC,cACtB,OAAO,EA6EjB;IAqCD;;;;;OAKG;IACH,+BAEC;IAED;;;;OAIG;IACH,WAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,cAFa,OAAO,CAInB;IAED;;;;;OAKG;IACH,0BAFa,MAAM,CAIlB;IAqCD;;;;;;;;;;;;;;;;;OAiBG;IACH,YAba,eAAe,CAe3B;IAED;;;;;;;;;;;;;OAaG;IACH,cAPa,qBAAqB,GAAC,IAAI,CA0BtC;IAED;;;;OAIG;IACH,WAFa,GAAG,CAIf;IAqFD;;;;OAIG;IACH,cAFa,SAAS,CAAC,eAAe,CAAC,CAItC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,sBAjBW,MAAM,GACJ,qBAAqB,CAiEjC;IAsID;;;;;OAKG;IACH,WAHW,MAAM,GACJ,OAAO,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAAC,WAAW,QAAO;KAAC,CAAC,CAgBnE;;CA8DF;4BArpB2B,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"}
@@ -8,7 +8,6 @@
8
8
  * - Pattern-based content filtering with glob support
9
9
  * - Path traversal via walkUp generator
10
10
  * - Intelligent path merging for subdirectories and files
11
- * - Support for temporary directory management
12
11
  *
13
12
  * @property {string} supplied - The original directory path as supplied to constructor
14
13
  * @property {string} path - The absolute resolved directory path
@@ -18,7 +17,6 @@
18
17
  * @property {string} extension - The directory extension (typically empty string)
19
18
  * @property {string} sep - Platform-specific path separator ('/' or '\\')
20
19
  * @property {Array<string>} trail - Path segments split by separator
21
- * @property {boolean} temporary - Whether this is marked as a temporary directory
22
20
  * @property {boolean} isFile - Always false (this is a directory)
23
21
  * @property {boolean} isDirectory - Always true
24
22
  * @property {DirectoryObject|null} parent - The parent directory (null if root)
@@ -48,7 +46,6 @@
48
46
  * const file = dir.getFile("package.json")
49
47
  */
50
48
  export default class DirectoryObject extends FS {
51
- [x: number]: () => object;
52
49
  /**
53
50
  * Creates a DirectoryObject from the current working directory.
54
51
  * Useful when working with pnpx or other tools where the project root
@@ -63,16 +60,9 @@ export default class DirectoryObject extends FS {
63
60
  /**
64
61
  * Constructs a DirectoryObject instance.
65
62
  *
66
- * @param {string? | DirectoryObject?} [directory="."] - The directory path or DirectoryObject (defaults to current directory)
67
- * @param {boolean} [temporary] - Whether this is a temporary directory.
63
+ * @param {string?} [directory="."] - The directory path or DirectoryObject (defaults to current directory)
68
64
  */
69
- constructor(directory?: string, temporary?: boolean);
70
- /**
71
- * Returns a JSON representation of the DirectoryObject.
72
- *
73
- * @returns {object} JSON representation of the DirectoryObject
74
- */
75
- toJSON(): object;
65
+ constructor(directory?: string | null);
76
66
  /**
77
67
  * Checks if the directory exists (async).
78
68
  *
@@ -130,12 +120,6 @@ export default class DirectoryObject extends FS {
130
120
  * console.log(dir.trail) // ['', 'path', 'to', 'directory']
131
121
  */
132
122
  get trail(): Array<string>;
133
- /**
134
- * Returns whether this directory is marked as temporary.
135
- *
136
- * @returns {boolean} True if this is a temporary directory, false otherwise
137
- */
138
- get temporary(): boolean;
139
123
  /**
140
124
  * Returns the parent directory of this directory.
141
125
  * Returns null if this directory is the root directory.
@@ -150,42 +134,6 @@ export default class DirectoryObject extends FS {
150
134
  * console.log(root.parent) // null
151
135
  */
152
136
  get parent(): DirectoryObject | null;
153
- /**
154
- * Returns the root directory of the filesystem.
155
- *
156
- * For DirectoryObject, this walks up to the filesystem root.
157
- * For CappedDirectoryObject, this returns the cap root.
158
- *
159
- * @returns {DirectoryObject} The root directory
160
- * @example
161
- * const dir = new DirectoryObject("/usr/local/bin")
162
- * console.log(dir.root.path) // "/"
163
- *
164
- * @example
165
- * const capped = new CappedDirectoryObject("/projects/myapp")
166
- * const sub = capped.getDirectory("src/lib")
167
- * console.log(sub.root.path) // "/" (virtual, cap root)
168
- * console.log(sub.root.real.path) // "/projects/myapp"
169
- */
170
- get root(): DirectoryObject;
171
- /**
172
- * Recursively removes a temporary directory and all its contents.
173
- *
174
- * This method will delete all files and subdirectories within this directory,
175
- * then delete the directory itself. It only works on directories explicitly
176
- * marked as temporary for safety.
177
- *
178
- * @async
179
- * @returns {Promise<void>}
180
- * @throws {Sass} If the directory is not marked as temporary
181
- * @throws {Sass} If the directory deletion fails
182
- * @example
183
- * const tempDir = new TempDirectoryObject("my-temp")
184
- * await tempDir.assureExists()
185
- * // ... use the directory ...
186
- * await tempDir.remove() // Recursively deletes everything
187
- */
188
- remove(): Promise<void>;
189
137
  /**
190
138
  * Returns false. Because this is a directory.
191
139
  *
@@ -236,7 +184,7 @@ export default class DirectoryObject extends FS {
236
184
  * Generator that walks up the directory tree, yielding each parent directory.
237
185
  * Starts from the current directory and yields each parent until reaching the root.
238
186
  *
239
- * @returns {object} Generator yielding parent DirectoryObject instances
187
+ * @returns {DirectoryObject} Generator yielding parent DirectoryObject instances
240
188
  * @example
241
189
  * const dir = new DirectoryObject('/path/to/deep/directory')
242
190
  * for(const parent of dir.walkUp) {
@@ -248,7 +196,7 @@ export default class DirectoryObject extends FS {
248
196
  * // /
249
197
  * }
250
198
  */
251
- get walkUp(): object;
199
+ get walkUp(): DirectoryObject;
252
200
  /**
253
201
  * Deletes an empty directory from the filesystem.
254
202
  *
@@ -286,7 +234,7 @@ export default class DirectoryObject extends FS {
286
234
  * duplication (e.g., "/projects/toolkit" + "toolkit/src" = "/projects/toolkit/src").
287
235
  * The temporary flag is preserved from the parent directory.
288
236
  *
289
- * @param {string} newPath - The subdirectory path to append (can be nested like "src/lib")
237
+ * @param {string} dir - The subdirectory path to append (can be nested like "src/lib")
290
238
  * @returns {DirectoryObject} A new DirectoryObject instance with the combined path
291
239
  * @throws {Sass} If newPath is not a string
292
240
  * @example
@@ -300,7 +248,7 @@ export default class DirectoryObject extends FS {
300
248
  * const subDir = dir.getDirectory("toolkit/src")
301
249
  * console.log(subDir.path) // "/projects/toolkit/src" (not /projects/toolkit/toolkit/src)
302
250
  */
303
- getDirectory(newPath: string): DirectoryObject;
251
+ getDirectory(dir: string): DirectoryObject;
304
252
  /**
305
253
  * Creates a new FileObject by extending this directory's path.
306
254
  *
@@ -308,7 +256,7 @@ export default class DirectoryObject extends FS {
308
256
  * duplication. The resulting FileObject can be used for reading, writing,
309
257
  * and other file operations.
310
258
  *
311
- * @param {string} filename - The filename to append (can include subdirectories like "src/index.js")
259
+ * @param {string} file - The filename to append (can include subdirectories like "src/index.js")
312
260
  * @returns {FileObject} A new FileObject instance with the combined path
313
261
  * @throws {Sass} If filename is not a string
314
262
  * @example
@@ -321,7 +269,7 @@ export default class DirectoryObject extends FS {
321
269
  * const file = dir.getFile("src/index.js")
322
270
  * const data = await file.read()
323
271
  */
324
- getFile(filename: string): FileObject;
272
+ getFile(file: string): FileObject;
325
273
  #private;
326
274
  }
327
275
  import FS from "./FS.js";
@@ -1 +1 @@
1
- {"version":3,"file":"DirectoryObject.d.ts","sourceRoot":"","sources":["../../lib/DirectoryObject.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH;uBAoHe,MAAM;IA9CnB;;;;;;;;;OASG;IACH,kBALa,eAAe,CAO3B;IA/CD;;;;;OAKG;IACH,4CAFW,OAAO,EA6BjB;IAyBD;;;;OAIG;IACH,UAFa,MAAM,CAelB;IAWD;;;;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;;;;OAIG;IACH,iBAFa,OAAO,CAInB;IAED;;;;;;;;;;;;OAYG;IACH,cARa,eAAe,GAAC,IAAI,CAwBhC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,YAXa,eAAe,CAoB3B;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,UATa,OAAO,CAAC,IAAI,CAAC,CA0BzB;IAED;;;;OAIG;IACH,cAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,mBAFa,OAAO,CAInB;IAiBD;;;;;;;;;;;;;;;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,CAoCpF;IAED;;;;;;;;;;;;OAYG;IACH,uBARW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAqBzB;IA8BD;;;;;;;;;;;;;;;OAeG;IACH,cAZa,MAAM,CAclB;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;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sBAdW,MAAM,GACJ,eAAe,CAoB3B;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,kBAbW,MAAM,GACJ,UAAU,CAkBtB;;CACF;eAjnBc,SAAS;uBACD,iBAAiB"}
1
+ {"version":3,"file":"DirectoryObject.d.ts","sourceRoot":"","sources":["../../lib/DirectoryObject.js"],"names":[],"mappings":"AAgBA;;;;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;;;;OAoBG;IACH,kBAdW,MAAM,GACJ,eAAe,CAqB3B;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,cAbW,MAAM,GACJ,UAAU,CAoBtB;;CACF;eA9hBc,SAAS;uBACD,iBAAiB"}
@@ -20,7 +20,7 @@ export default class FS {
20
20
  * @param {string} pathName - The path to convert
21
21
  * @returns {string} The URI
22
22
  */
23
- static pathToUri(pathName: string): string;
23
+ static pathToUrl(pathName: string): string;
24
24
  /**
25
25
  * Convert a URI to a path
26
26
  *
@@ -28,22 +28,12 @@ export default class FS {
28
28
  * @param {string} pathName - The URI to convert
29
29
  * @returns {string} The path
30
30
  */
31
- static uriToPath(pathName: string): string;
32
- /**
33
- * Retrieve all files matching a specific glob pattern.
34
- *
35
- * @static
36
- * @param {string|Array<string>} glob - The glob pattern(s) to search.
37
- * @returns {Promise<Array<FileObject>>} A promise that resolves to an array of file objects
38
- * @throws {Sass} If the input is not a string or array of strings.
39
- * @throws {Sass} If the glob pattern array is empty or for other search failures.
40
- */
41
- static getFiles(glob: string | Array<string>): Promise<Array<FileObject>>;
31
+ static urlToPath(pathName: string): string;
42
32
  /**
43
33
  * Computes the relative path from one file or directory to another.
44
34
  *
45
- * If the target is outside the source (i.e., the relative path starts with ".."),
46
- * returns the absolute path to the target instead.
35
+ * If the target is outside the source (i.e., the relative path starts with
36
+ * ".."), returns the absolute path to the target instead.
47
37
  *
48
38
  * @static
49
39
  * @param {FileObject|DirectoryObject} from - The source file or directory object
@@ -52,7 +42,8 @@ export default class FS {
52
42
  */
53
43
  static relativeOrAbsolutePath(from: FileObject | DirectoryObject, to: FileObject | DirectoryObject): string;
54
44
  /**
55
- * Merge two paths by finding overlapping segments and combining them efficiently
45
+ * Merge two paths by finding overlapping segments and combining them
46
+ * efficiently
56
47
  *
57
48
  * @static
58
49
  * @param {string} path1 - The first path
@@ -71,6 +62,115 @@ export default class FS {
71
62
  * @returns {string} The resolved path
72
63
  */
73
64
  static resolvePath(fromPath: string, toPath: string): string;
65
+ /**
66
+ * Check if a candidate path is contained within a container path.
67
+ *
68
+ * @static
69
+ * @param {string} container - The container path to check against
70
+ * @param {string} candidate - The candidate path that might be contained
71
+ * @returns {boolean} True if candidate is within container, false otherwise
72
+ * @throws {Sass} If container is not a non-empty string
73
+ * @throws {Sass} If candidate is not a non-empty string
74
+ * @example
75
+ * FS.pathContains("/home/user", "/home/user/docs") // true
76
+ * FS.pathContains("/home/user", "/home/other") // false
77
+ */
78
+ static pathContains(container: string, candidate: string): boolean;
79
+ /**
80
+ * Convert an absolute path to a relative path by finding overlapping segments.
81
+ * Returns the relative portion of the 'to' path after the last occurrence
82
+ * of the final segment from the 'from' path.
83
+ *
84
+ * @static
85
+ * @param {string} from - The base path to calculate relative from
86
+ * @param {string} to - The target path to make relative
87
+ * @param {string} [sep=path.sep] - The path separator to use (defaults to system separator)
88
+ * @returns {string|null} The relative path, empty string if paths are identical, or null if no overlap found
89
+ * @example
90
+ * FS.toRelativePath("/projects/toolkit", "/projects/toolkit/src") // "src"
91
+ * FS.toRelativePath("/home/user", "/home/user") // ""
92
+ * FS.toRelativePath("/projects/app", "/other/path") // null
93
+ */
94
+ static toRelativePath(from: string, to: string, sep?: string): string | null;
95
+ /**
96
+ * Find the common root path between two paths by identifying overlapping segments.
97
+ * Returns the portion of 'from' that matches up to the overlap point in 'to'.
98
+ *
99
+ * @static
100
+ * @param {string} from - The first path to compare
101
+ * @param {string} to - The second path to find common root with
102
+ * @param {string} [sep=path.sep] - The path separator to use (defaults to system separator)
103
+ * @returns {string|null} The common root path, the original path if identical, or null if no overlap found
104
+ * @throws {Sass} If from is not a non-empty string
105
+ * @throws {Sass} If to is not a non-empty string
106
+ * @example
107
+ * FS.getCommonRootPath("/projects/toolkit/src", "/projects/toolkit/tests") // "/projects/toolkit"
108
+ * FS.getCommonRootPath("/home/user", "/home/user") // "/home/user"
109
+ * FS.getCommonRootPath("/projects/app", "/other/path") // null
110
+ */
111
+ static getCommonRootPath(from: string, to: string, sep?: string): string | null;
112
+ /**
113
+ * @typedef {object} PathParts
114
+ * @property {string} base - The file name with extension
115
+ * @property {string} dir - The directory path
116
+ * @property {string} ext - The file extension (including dot)
117
+ */
118
+ /**
119
+ * Deconstruct a file or directory name into parts.
120
+ *
121
+ * @static
122
+ * @param {string} pathName - The file/directory name to deconstruct
123
+ * @returns {PathParts} The filename parts
124
+ * @throws {Sass} If not a string of more than 1 character
125
+ */
126
+ static pathParts(pathName: string): {
127
+ /**
128
+ * - The file name with extension
129
+ */
130
+ base: string;
131
+ /**
132
+ * - The directory path
133
+ */
134
+ dir: string;
135
+ /**
136
+ * - The file extension (including dot)
137
+ */
138
+ ext: string;
139
+ };
140
+ /**
141
+ * Convert a virtual capped path to its real filesystem path.
142
+ * For capped objects, resolves the virtual path relative to the cap's real path.
143
+ * For uncapped objects, returns the path unchanged.
144
+ *
145
+ * @static
146
+ * @param {FileObject|DirectoryObject} fileOrDirectoryObject - The file or directory object to convert
147
+ * @returns {string} The real filesystem path
148
+ * @throws {Sass} If parameter is not a FileObject or DirectoryObject
149
+ * @example
150
+ * const temp = new TempDirectoryObject("myapp")
151
+ * const file = temp.getFile("/config.json")
152
+ * FS.virtualToRealPath(file) // "/tmp/myapp-ABC123/config.json"
153
+ *
154
+ * @example
155
+ * const regular = new FileObject("/home/user/file.txt")
156
+ * FS.virtualToRealPath(regular) // "/home/user/file.txt"
157
+ */
158
+ static virtualToRealPath(fileOrDirectoryObject: FileObject | DirectoryObject): string;
159
+ /**
160
+ * Convert an absolute path to a relative format by removing the root component.
161
+ * By default, keeps a leading separator (making it "absolute-like relative").
162
+ * Use forceActuallyRelative to get a truly relative path without leading separator.
163
+ *
164
+ * @static
165
+ * @param {string} pathToCheck - The path to convert (returned unchanged if already relative)
166
+ * @param {boolean} [forceActuallyRelative=false] - If true, removes leading separator for truly relative path
167
+ * @returns {string} The relative path (with or without leading separator based on forceActuallyRelative)
168
+ * @example
169
+ * FS.absoluteToRelative("/home/user/docs") // "/home/user/docs" (with leading /)
170
+ * FS.absoluteToRelative("/home/user/docs", true) // "home/user/docs" (truly relative)
171
+ * FS.absoluteToRelative("relative/path") // "relative/path" (unchanged)
172
+ */
173
+ static absoluteToRelative(pathToCheck: string, forceActuallyRelative?: boolean): string;
74
174
  /**
75
175
  * Compute the relative path from another file or directory to this instance.
76
176
  *
@@ -1 +1 @@
1
- {"version":3,"file":"FS.d.ts","sourceRoot":"","sources":["../../lib/FS.js"],"names":[],"mappings":"AAwBA;;GAEG;AACH;IACE,kCAAwB;IACxB,uCAAkC;IAClC,mBAAsB;IAsBtB;;;;;;OAMG;IACH,4BAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,2BAHW,MAAM,GACJ,MAAM,CAUlB;IAED;;;;;;OAMG;IACH,2BAHW,MAAM,GACJ,MAAM,CAQlB;IAED;;;;;;;;OAQG;IACH,sBALW,MAAM,GAAC,KAAK,CAAC,MAAM,CAAC,GAClB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAmCtC;IAED;;;;;;;;;;OAUG;IACH,oCAJW,UAAU,GAAC,eAAe,MAC1B,UAAU,GAAC,eAAe,GACxB,MAAM,CAYlB;IAED;;;;;;;;OAQG;IACH,oCALW,MAAM,SACN,MAAM,QACN,MAAM,GACJ,MAAM,CA0BlB;IAED;;;;;;;;OAQG;IACH,6BAJW,MAAM,UACN,MAAM,GACJ,MAAM,CAgClB;IA1MD;;;;;;;;;OASG;IACH,kCAJW,UAAU,GAAC,eAAe,GACxB,MAAM,CAWlB;CAyLF;yBA5Na,OAAO,iBAAiB,EAAE,OAAO;8BACjC,OAAO,sBAAsB,EAAE,OAAO"}
1
+ {"version":3,"file":"FS.d.ts","sourceRoot":"","sources":["../../lib/FS.js"],"names":[],"mappings":"AA0BA;;GAEG;AACH;IACE,kCAAwB;IACxB,uCAAkC;IAClC,mBAAsB;IAsBtB;;;;;;OAMG;IACH,4BAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,2BAHW,MAAM,GACJ,MAAM,CAQlB;IAED;;;;;;OAMG;IACH,2BAHW,MAAM,GACJ,MAAM,CAQlB;IAED;;;;;;;;;;OAUG;IACH,oCAJW,UAAU,GAAC,eAAe,MAC1B,UAAU,GAAC,eAAe,GACxB,MAAM,CAYlB;IAED;;;;;;;;;OASG;IACH,oCALW,MAAM,SACN,MAAM,QACN,MAAM,GACJ,MAAM,CA0BlB;IAED;;;;;;;;OAQG;IACH,6BAJW,MAAM,UACN,MAAM,GACJ,MAAM,CAmClB;IAED;;;;;;;;;;;;OAYG;IACH,+BATW,MAAM,aACN,MAAM,GACJ,OAAO,CAcnB;IAED;;;;;;;;;;;;;;OAcG;IACH,4BATW,MAAM,MACN,MAAM,QACN,MAAM,GACJ,MAAM,GAAC,IAAI,CAwBvB;IAED;;;;;;;;;;;;;;;OAeG;IACH,+BAXW,MAAM,MACN,MAAM,QACN,MAAM,GACJ,MAAM,GAAC,IAAI,CA+BvB;IAED;;;;;OAKG;IAEH;;;;;;;OAOG;IACH,2BAJW,MAAM;;;;cATH,MAAM;;;;aACN,MAAM;;;;aACN,MAAM;MAenB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,gDAZW,UAAU,GAAC,eAAe,GACxB,MAAM,CAiClB;IAED;;;;;;;;;;;;;OAaG;IACH,uCARW,MAAM,0BACN,OAAO,GACL,MAAM,CAkBlB;IA/VD;;;;;;;;;OASG;IACH,kCAJW,UAAU,GAAC,eAAe,GACxB,MAAM,CAWlB;CA8UF;yBAjXa,OAAO,iBAAiB,EAAE,OAAO;8BACjC,OAAO,sBAAsB,EAAE,OAAO"}
@@ -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.
@@ -27,16 +26,10 @@ export default class FileObject extends FS {
27
26
  /**
28
27
  * Constructs a FileObject instance.
29
28
  *
30
- * @param {string | FileObject} fileName - The file path or FileObject
29
+ * @param {string} fileName - The file path
31
30
  * @param {DirectoryObject|string|null} [parent] - The parent directory (object or string)
32
31
  */
33
- constructor(fileName: string | FileObject, 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;
32
+ constructor(fileName: string, parent?: DirectoryObject | string | null);
40
33
  /**
41
34
  * Checks if the file exists (async).
42
35
  *
@@ -51,7 +44,9 @@ export default class FileObject extends FS {
51
44
  get supplied(): string;
52
45
  /**
53
46
  * Returns the file path. If the parent is a capped directory, returns the
54
- * virtual path relative to the cap. Otherwise returns the real filesystem path.
47
+ * virtual path relative to the cap. Otherwise returns the real filesystem
48
+ * path.
49
+ *
55
50
  * Use `.real.path` to always get the actual filesystem path.
56
51
  *
57
52
  * @returns {string} The file path (virtual if parent is capped, real otherwise)
@@ -110,6 +105,7 @@ export default class FileObject extends FS {
110
105
  * @returns {DirectoryObject} The parent directory object
111
106
  */
112
107
  get parent(): DirectoryObject;
108
+ get parentPath(): any;
113
109
  /**
114
110
  * Returns a plain FileObject representing the actual filesystem location.
115
111
  * This provides an "escape hatch" when working with capped directories,
@@ -1 +1 @@
1
- {"version":3,"file":"FileObject.d.ts","sourceRoot":"","sources":["../../lib/FileObject.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;GAcG;AAEH;uBAmIe,MAAM;IAlInB;;;;;OAKG;IACH,yBAFU;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,OAAO,KAAK,GAAG,OAAO,IAAI,CAAC,CAAA;KAAC,CAO1D;IA2BF;;;;;OAKG;IACH,sBAHW,MAAM,GAAG,UAAU,WACnB,eAAe,GAAC,MAAM,GAAC,IAAI,EAuDrC;IAWD;;;;OAIG;IACH,UAFa,MAAM,CAclB;IAWD;;;;OAIG;IACH,cA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