@gesslar/toolkit 0.1.0 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gesslar/toolkit",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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
@@ -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,7 +8,15 @@ 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
+
11
15
  export default class FS {
16
+ static fdTypes = fdTypes
17
+ static upperFdTypes = upperFdTypes
18
+ static fdType = fdType
19
+
12
20
  /**
13
21
  * Fix slashes in a path
14
22
  *
package/src/types/FS.d.ts CHANGED
@@ -8,6 +8,15 @@ import DirectoryObject from './DirectoryObject.js'
8
8
  * Base filesystem utilities class. FileObject and DirectoryObject extend this class.
9
9
  */
10
10
  export default class FS {
11
+ /** Array of lowercase file descriptor types */
12
+ static readonly fdTypes: readonly ["file", "directory"]
13
+
14
+ /** Array of uppercase file descriptor types */
15
+ static readonly upperFdTypes: readonly ["FILE", "DIRECTORY"]
16
+
17
+ /** Mapping from uppercase to lowercase file descriptor types */
18
+ static readonly fdType: Readonly<Record<"FILE" | "DIRECTORY", "file" | "directory">>
19
+
11
20
  /** Fix slashes in a path */
12
21
  static fixSlashes(pathName: string): string
13
22
 
File without changes