function mutateFSTree
mutateFSTree(
fsTree: FSTree,
event: string,
filePath: string
): void

Mutates fsTree in place based on a file-system event.

import * as FileWatcher from './file-watcher.ts';

const fsTree = { '/proj/test/a-test.ts': null, '/proj/test/sub/b-test.ts': null };
FileWatcher.mutateFSTree(fsTree, 'unlinkDir', '/proj/test/sub');
Object.keys(fsTree); // ['/proj/test/a-test.ts'] — the subtree's entries are gone

Parameters

fsTree: FSTree
event: string
filePath: string

Return Type

void

Usage

import { mutateFSTree } from "lib/setup/file-watcher.ts";