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

skemata

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skemata - npm Package Compare versions

Comparing version

to
0.1.1

2

lib/index.js

@@ -30,4 +30,2 @@ 'use strict';

const formatObject = (r, startPath) => {
if (r.ok) return;
const fl = flatten(r, startPath);

@@ -34,0 +32,0 @@

2

package.json
{
"name": "skemata",
"version": "0.1.0",
"version": "0.1.1",
"description": "An object structure and type validation library",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -108,2 +108,21 @@ import test from 'ava';

test('warnings', t => {
const schema = v.object({
a: v.bool,
b: v.deprecated(v.string, 'moved to `c`'),
files: v.objects({ keys: ['javascripts', 'stylesheets'] }, v.bool)
});
const result = schema({ a: true, b: 'string', files: { javascript: true } });
const fmt = skemata.formatObject(result, 'config');
t.deepEqual(fmt, {
errors: [],
warnings: [
{ path: 'config.b', warning: 'deprecated: moved to `c`' },
{ path: 'config.files.javascript', warning: 'unrecognized key: javascript; expected either of javascripts, stylesheets; perhaps you meant javascripts' }
]
});
});
test('errors and warnings', t => {

@@ -110,0 +129,0 @@ const schema = v.object({