summaryrefslogtreecommitdiffstats
path: root/vnfmarket/src/main/webapp/vnfmarket/node_modules/is-my-json-valid/require.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/is-my-json-valid/require.js')
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/is-my-json-valid/require.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/is-my-json-valid/require.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/is-my-json-valid/require.js
new file mode 100644
index 00000000..0bfb8a29
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/is-my-json-valid/require.js
@@ -0,0 +1,12 @@
+var fs = require('fs')
+var path = require('path')
+var compile = require('./')
+
+delete require.cache[require.resolve(__filename)]
+
+module.exports = function(file, opts) {
+ file = path.join(path.dirname(module.parent.filename), file)
+ if (!fs.existsSync(file) && fs.existsSync(file+'.schema')) file += '.schema'
+ if (!fs.existsSync(file) && fs.existsSync(file+'.json')) file += '.json'
+ return compile(fs.readFileSync(file, 'utf-8'), opts)
+}