Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

metaschema

Package Overview
Dependencies
Maintainers
5
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metaschema - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

8

CHANGELOG.md

@@ -5,2 +5,7 @@ # Changelog

## [1.1.2][] - 2021-05-08
- Shorthand for optional (not required) fields
- Nested schema of json type (for pg json fields)
## [1.1.1][] - 2021-05-07

@@ -46,3 +51,4 @@

[unreleased]: https://github.com/metarhia/metaschema/compare/v1.1.1...HEAD
[unreleased]: https://github.com/metarhia/metaschema/compare/v1.1.2...HEAD
[1.1.2]: https://github.com/metarhia/metaschema/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/metarhia/metaschema/compare/v1.1.0...v1.1.1

@@ -49,0 +55,0 @@ [1.1.0]: https://github.com/metarhia/metaschema/compare/v1.0.3...v1.1.0

@@ -168,11 +168,20 @@ 'use strict';

const short = shorthand(entry);
const type = short || entry.type;
let type = short || entry.type;
if (!type) {
if (this.preprocessIndex(key, entry)) continue;
this.fields[key] = Schema.from(entry);
if (entry.json) {
const json = Schema.from(entry.json);
this.fields[key] = Object.assign({}, entry, { type: 'json', json });
} else {
this.fields[key] = Schema.from(entry);
}
continue;
}
let required = true;
if (type.startsWith('?')) {
type = type.substring(1);
required = false;
}
const def = short ? toLongForm(type, { ...entry }) : entry;
if (!Reflect.has(def, 'required')) def.required = true;
if (!Reflect.has(def, 'required')) def.required = required;
if (def.length) def.length = formatLength(def.length);

@@ -214,2 +223,7 @@ this.fields[key] = def;

}
if (def.json instanceof Schema) {
const subcheck = def.json.check(value);
if (!subcheck.valid) errors.push(...subcheck.errors);
continue;
}
if (!def) {

@@ -216,0 +230,0 @@ errors.push(`Field "${name}" is not expected`);

2

package.json
{
"name": "metaschema",
"version": "1.1.1",
"version": "1.1.2",
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>",

@@ -5,0 +5,0 @@ "description": "Metadata Schema and Interface Definition Language (IDL)",

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