async function listLevels(sUser) {
	const vault = getUserVault(sUser);
	const aList = await vault.ls('.');
	const aOutput = [];
	for (let i = 0, l = aList.length; i < l; ++i) {
		const f = aList[i];
		const name = f.name;
		if (f.dir) {
			const filename = path.join(name, 'level.json');
			try {
				const st = await vault.stat(filename);
				aOutput.push({
					"name": name,
					"date": st.dates.modified
				});
			} catch (e) {
				if (e.code === 'ENOENT') {
					// no required file in this directory
					console.warn('vault.ls - this directory contains neither level.json not preview.json : "' + name + '"');
				} else {
					throw e;
				}
			}
		}
	}
	return aOutput;
}
/**
 * lists all project saved so far
 */
lists all project saved so far
lists all project saved so far
async function listLevels(sUser) {
	const vault = getUserVault(sUser);
	const aList = await vault.ls('.');
	const aOutput = [];
	for (let i = 0, l = aList.length; i < l; ++i) {
		const f = aList[i];
		const name = f.name;
		if (f.dir) {
			const filename = path.join(name, 'level.json');
			try {
				const st = await vault.stat(filename);
				aOutput.push({
					"name": name,
					"date": st.dates.modified
				});
			} catch (e) {
				if (e.code === 'ENOENT') {
					console.warn('vault.ls - this directory contains neither level.json not preview.json : "' + name + '"');
				} else {
					throw e;
				}
			}
		}
	}
	return aOutput;
}
async function listLevels ( sUser ) { const vault = getUserVault ( sUser ) ; const aList = await vault . ls ( '.' ) ; const aOutput = [ ] ; for ( let i = 0 , l = aList . length ; i < l ; ++ i ) { const f = aList [ i ] ; const name = f . name ; if ( f . dir ) { const filename = path . join ( name , 'level.json' ) ; try { const st = await vault . stat ( filename ) ; aOutput . push ( { "name" : name , "date" : st . dates . modified } ) ; } catch ( e ) { if ( e . code === 'ENOENT' ) { console . warn ( 'vault.ls - this directory contains neither level.json not preview.json : "' + name + '"' ) ; } else { throw e ; } } } } return aOutput ; }
lists all project saved so far
lists all project saved so far
// no required file in this directory