Fixes to glob-fs

master
Mark Moffat 2019-07-11 15:05:03 +09:30
parent 01dc330de4
commit df5b51413b
2 changed files with 3 additions and 4 deletions

View File

@ -3,10 +3,10 @@ const fs = require('fs');
const _ = require('lodash'); const _ = require('lodash');
const Validator = require('jsonschema').Validator; const Validator = require('jsonschema').Validator;
const v = new Validator(); const v = new Validator();
const glob = require('glob-fs')(); const glob = require('glob');
const addSchemas = () => { const addSchemas = () => {
const schemaFiles = glob.readdirSync('./lib/**/*.json'); const schemaFiles = glob.sync('./lib/**/*.json');
_.forEach(schemaFiles, (file) => { _.forEach(schemaFiles, (file) => {
const fileData = JSON.parse(fs.readFileSync(file, 'utf-8')); const fileData = JSON.parse(fs.readFileSync(file, 'utf-8'));
v.addSchema(fileData, path.basename(schemaFiles[0], '.json')); v.addSchema(fileData, path.basename(schemaFiles[0], '.json'));

View File

@ -24,8 +24,6 @@
"express": "^4.17.1", "express": "^4.17.1",
"express-handlebars": "^3.1.0", "express-handlebars": "^3.1.0",
"express-session": "^1.16.2", "express-session": "^1.16.2",
"glob": "^7.1.4",
"glob-fs": "^0.1.7",
"helmet": "^3.18.0", "helmet": "^3.18.0",
"html-entities": "^1.2.0", "html-entities": "^1.2.0",
"jsonschema": "^1.2.4", "jsonschema": "^1.2.4",
@ -58,6 +56,7 @@
"eslint-plugin-node": "^9.1.0", "eslint-plugin-node": "^9.1.0",
"eslint-plugin-promise": "^4.2.1", "eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0", "eslint-plugin-standard": "^4.0.0",
"glob": "^7.1.4",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"gulp-clean-css": "^3.10.0", "gulp-clean-css": "^3.10.0",
"gulp-minify": "^3.1.0", "gulp-minify": "^3.1.0",