source: frontend/node_modules/is-module/index.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 568 bytes
Line 
1
2// no idea what these regular expressions do,
3// but i extracted it from https://github.com/yahoo/js-module-formats/blob/master/index.js#L18
4var ES6ImportExportRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(import\s+['"]|(import|module)\s+[^"'\(\)\n;]+\s+from\s+['"]|export\s+(\*|\{|default|function|var|const|let|[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*))/;
5
6var ES6AliasRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(export\s*\*\s*from\s*(?:'([^']+)'|"([^"]+)"))/;
7
8module.exports = function (sauce) {
9 return ES6ImportExportRegExp.test(sauce)
10 || ES6AliasRegExp.test(sauce);
11};
Note: See TracBrowser for help on using the repository browser.