1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-16 19:46:19 +02:00

add prettier support for js,css,markdown fixes #234

This commit is contained in:
Kushagra Gour
2018-10-14 16:30:28 +05:30
parent ee06e8c546
commit 41ae269d9b
6 changed files with 104 additions and 9 deletions

View File

@@ -1,6 +1,15 @@
import { deferred } from './deferred';
const esprima = require('esprima');
/**
* Returns the extension from the file name.
* @param {dtring} fileName File name
*/
export function getExtensionFromFileName(fileName) {
const type = fileName.match(/\.(\w+)$/);
return type ? type[1] : '';
}
/**
* Returns a linear file list from a nested file strcuture.
* It excludes the folders from the returned list.