New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

terriajs-schema

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terriajs-schema - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

schema/1.0.53/AbsIttCatalogGroup.json

2

package.json
{
"name": "terriajs-schema",
"version": "0.1.1",
"version": "0.2.0",
"description": "JSON schema for TerriaJS.",

@@ -5,0 +5,0 @@ "main": "validate.js",

@@ -5,5 +5,5 @@ /*jshint -W030 */

var fs = require('fs');
var path = require('path');
var defaultVersion = 'master';
var schemaBasePath = 'schema';
var argv = require('yargs')

@@ -24,3 +24,3 @@ .usage('$0 [--version <version>] <catalog.json> [<anothercatalog.json> ...]')

try {
argv.version = require( (argv.terriajsdir.match(/^[.\/]/) ? '' : './') + argv.terriajsdir + '/package.json').version;
argv.version = JSON.parse(fs.readFileSync(path.join(argv.terriajsdir, 'package.json'), 'utf8')).version;
} catch (e) {

@@ -34,3 +34,3 @@ console.warn(e.message);

var path = argv.version;
var schemaPath = path.join(schemaBasePath, argv.version);

@@ -81,11 +81,11 @@ var rootSchema;

function loadNextSchema(filename, callback) {
fs.readFile(path + '/' + filename, 'utf8', function(err, data) {
fs.readFile(path.join(schemaPath, filename), 'utf8', function(err, data) {
if (err) {
console.log();
if (filename === 'Catalog.json' && argv.version !== defaultVersion) {
path = defaultVersion;
console.warn("WARNING: We don't have a schema for version '" + argv.version + "'. Falling back to '" + path + "'.");
schemaPath = path.join(schemaBasePath, defaultVersion);
console.warn("WARNING: We don't have a schema for version '" + argv.version + "'. Falling back to '" + defaultVersion + "'.");
loadNextSchema(filename, callback);
} else {
console.error("ERROR: Missing file " + path + '/' + filename);
console.error("ERROR: Missing file " + path.join(schemaPath, filename));
process.exit(1);

@@ -112,3 +112,3 @@ }

}
argv.quiet || process.stdout.write('Loading schema: ' + path + '/Catalog.json ... ');
argv.quiet || process.stdout.write('Loading schema: ' + path.join(schemaPath, '/Catalog.json ... '));
loadNextSchema('Catalog.json', validate);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc