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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user