]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/require.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / request / node_modules / har-validator / node_modules / is-my-json-valid / require.js
1 var fs = require('fs')
2 var path = require('path')
3 var compile = require('./')
4
5 delete require.cache[require.resolve(__filename)]
6
7 module.exports = function(file, opts) {
8   file = path.join(path.dirname(module.parent.filename), file)
9   if (!fs.existsSync(file) && fs.existsSync(file+'.schema')) file += '.schema'
10   if (!fs.existsSync(file) && fs.existsSync(file+'.json')) file += '.json'
11   return compile(fs.readFileSync(file, 'utf-8'), opts)
12 }