function cdUp(directory) {
	if (directory === "/") return null;
	const i = directory.lastIndexOf("/");
	const j = directory.lastIndexOf("\\");
	const path = i < 0 ? j : j < 0 ? i : i < j ? j : i;
	if (path < 0) return null;
	return directory.slice(0, path || 1);
}
@param {string} directory directory
@returns {string|null} parent directory or null