utils.ts 640 字节
Newer Older
E
Erich Gamma 已提交
1 2 3 4 5 6 7
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

'use strict';

J
Johannes Rieken 已提交
8
import { IFileStat } from 'vs/platform/files/common/files';
E
Erich Gamma 已提交
9 10 11 12 13 14 15 16 17 18

export function getByName(root: IFileStat, name: string): IFileStat {
	for (let i = 0; i < root.children.length; i++) {
		if (root.children[i].name === name) {
			return root.children[i];
		}
	}

	return null;
}