diskfile_helpers.ts

Declarations
#

7 declarations

view source

disknode_to_diskfile_json
#

diskfile_helpers.ts view source

(disknode: { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">; contents: string | null; ctime: number | null; mtime: number | null; dependents: [...][]; dependencies: [...][]; }, existing_id?: string & $brand<...>): { ...; }

Helper function to convert a SerializableDisknode to the DiskfileJson format.

disknode

The source file to convert

type { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">; contents: string | null; ctime: number | null; mtime: number | null; dependents: [...][]; dependencies: [...][]; }

existing_id

Optional existing UUID to preserve id stability across updates

type string & $brand<"Uuid">
default create_uuid()

returns

{ id: string & $brand<"Uuid">; created: string & $brand<"Datetime">; updated: string & $brand<"Datetime">; path: (string & $brand<"DiskfilePath">) | null; source_dir: string & ... 1 more ... & $brand<...>; content: string | null; dependents: [...][] | null; dependencies: [...][] | null; }

has_dependencies
#

is_path_absolute
#

map_watcher_change_to_diskfile_change
#

diskfile_helpers.ts view source

(type: WatcherChangeType): "add" | "change" | "delete"

Maps watcher change types to diskfile change types

type

type WatcherChangeType

returns

"add" | "change" | "delete"

SUPPORTED_CODE_FILETYPE_MATCHER
#

to_relative_path
#

to_serializable_disknode
#

diskfile_helpers.ts view source

(disknode: Disknode, dir: string): { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">; ... 4 more ...; dependencies: [...][]; }

disknode

type Disknode

dir

type string

returns

{ id: string & $brand<"DiskfilePath">; source_dir: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">; contents: string | null; ctime: number | null; mtime: number | null; dependents: [...][]; dependencies: [...][]; }

Depends on
#

Imported by
#