@gesslar/toolkit 0.1.0 → 0.1.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gesslar/toolkit",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Get in, bitches, we're going toolkitting.",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Core file system abstractions
2
2
  export {default as FileObject} from "./lib/FileObject.js"
3
3
  export {default as DirectoryObject} from "./lib/DirectoryObject.js"
4
- export {default as FS} from "./lib/FS.js"
4
+ export {default as FS, fdType, upperFdTypes, fdTypes} from "./lib/FS.js"
5
5
 
6
6
  // Utility classes
7
7
  export {default as Cache} from "./lib/Cache.js"
@@ -9,6 +9,6 @@ export {default as Data} from "./lib/Data.js"
9
9
  export {default as Glog} from "./lib/Glog.js"
10
10
  export {default as Sass} from "./lib/Sass.js"
11
11
  export {default as Term} from "./lib/Term.js"
12
- export {default as Type} from "./lib/Type.js"
12
+ export {default as Type} from "./lib/TypeSpec.js"
13
13
  export {default as Util} from "./lib/Util.js"
14
14
  export {default as Valid} from "./lib/Valid.js"
package/src/lib/Data.js CHANGED
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import Sass from "./Sass.js"
10
- import TypeSpec from "./Type.js"
10
+ import TypeSpec from "./TypeSpec.js"
11
11
  import Valid from "./Valid.js"
12
12
 
13
13
  export default class Data {
package/src/lib/FS.js CHANGED
@@ -8,6 +8,12 @@ import FileObject from "./FileObject.js"
8
8
  import Sass from "./Sass.js"
9
9
  import Valid from "./Valid.js"
10
10
 
11
+ const fdTypes = Object.freeze(["file", "directory"])
12
+ const upperFdTypes = Object.freeze(fdTypes.map(type => type.toUpperCase()))
13
+ const fdType = Object.freeze(await Data.allocateObject(upperFdTypes, fdTypes))
14
+
15
+ export {fdType, upperFdTypes, fdTypes}
16
+
11
17
  export default class FS {
12
18
  /**
13
19
  * Fix slashes in a path
package/src/types/FS.d.ts CHANGED
@@ -29,3 +29,18 @@ export default class FS {
29
29
  /** Resolve a path relative to another path using various strategies. Handles absolute paths, relative navigation, and overlap-based merging */
30
30
  static resolvePath(fromPath: string, toPath: string): string
31
31
  }
32
+
33
+ /**
34
+ * File descriptor types as lowercase strings
35
+ */
36
+ export const fdTypes: readonly ["file", "directory"]
37
+
38
+ /**
39
+ * File descriptor types as uppercase strings
40
+ */
41
+ export const upperFdTypes: readonly ["FILE", "DIRECTORY"]
42
+
43
+ /**
44
+ * Mapping from uppercase file descriptor types to lowercase
45
+ */
46
+ export const fdType: Readonly<Record<"FILE" | "DIRECTORY", "file" | "directory">>
@@ -2,7 +2,7 @@
2
2
  // Core file system abstractions
3
3
  export { default as FileObject } from './FileObject.js'
4
4
  export { default as DirectoryObject } from './DirectoryObject.js'
5
- export { default as FS } from './FS.js'
5
+ export { default as FS, fdType, upperFdTypes, fdTypes } from './FS.js'
6
6
 
7
7
  // Utility classes
8
8
  export { default as Cache } from './Cache.js'
File without changes