private lookup()

in server/src/files.ts [143:164]


	private lookup(uri: string, create: boolean = false): Entry | undefined {
		let parts = uri.split('/');
		let entry: Entry = this.root;
		for (const part of parts) {
			if (!part || part === '.') {
				continue;
			}
			let child: Entry | undefined;
			if (entry.type === FileType.Directory) {
				child = entry.children.get(part);
				if (child === undefined && create) {
					child = Directory.create(part);
					entry.children.set(part, child);
				}
			}
			if (!child) {
				return undefined;
			}
			entry = child;
		}
		return entry;
	}