mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
Simplify test for fs.readdirSync.
This commit is contained in:
parent
35c2826a6e
commit
e58736f216
|
@ -120,7 +120,7 @@ var g_output_modifiers = [];
|
||||||
if (typeof module !== 'undefind' && typeof exports !== 'undefined' && typeof require !== 'undefind') {
|
if (typeof module !== 'undefind' && typeof exports !== 'undefined' && typeof require !== 'undefind') {
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
if ((typeof fs !== "undefined" && fs !== null ? fs.readdirSync : void 0) != null) {
|
if (fs && fs.readdirSync) {
|
||||||
// Search extensions folder
|
// Search extensions folder
|
||||||
var extensions = fs.readdirSync((__dirname || '.')+'/extensions').filter(function(file){
|
var extensions = fs.readdirSync((__dirname || '.')+'/extensions').filter(function(file){
|
||||||
return ~file.indexOf('.js');
|
return ~file.indexOf('.js');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user