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

airtight

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

airtight - npm Package Compare versions

Comparing version 0.7.5 to 0.7.6

1

out/main/decoder.d.ts

@@ -9,2 +9,3 @@ import { Exception } from 'typesafe-exception';

constructor(schema: Schema<unknown>, errors: DecodeError[]);
protected formatMessage(errors: DecodeError[]): string;
}

@@ -11,0 +12,0 @@ export interface DecodeError {

@@ -7,8 +7,18 @@ "use strict";

const store_1 = require("./store");
const util_1 = require("./util");
class ValidationError extends typesafe_exception_1.Exception {
constructor(schema, errors) {
var _a;
super(`Validation failed (${(_a = schema.id) !== null && _a !== void 0 ? _a : schema.type}}`, { errors });
super('ValidationError', { errors });
this.status = 400;
const type = util_1.capitalize((_a = schema.id) !== null && _a !== void 0 ? _a : schema.type);
const msg = this.formatMessage(errors);
this.message = `${type} validation failed:\n${msg}`;
}
formatMessage(errors) {
return errors.map(e => {
const pointer = e.path.join('.');
return ` - ${pointer} ${e.path}`;
}).join('\n');
}
}

@@ -15,0 +25,0 @@ exports.ValidationError = ValidationError;

export declare type DataType = 'string' | 'boolean' | 'number' | 'object' | 'array' | 'any' | 'null';
export declare function getType(value: unknown): DataType;
export declare function capitalize(str: string): string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getType = void 0;
exports.capitalize = exports.getType = void 0;
function getType(value) {

@@ -18,1 +18,5 @@ if (value == null) {

exports.getType = getType;
function capitalize(str) {
return str.substring(0, 1).toUpperCase() + str.substring(1);
}
exports.capitalize = capitalize;

2

package.json
{
"name": "airtight",
"version": "0.7.5",
"version": "0.7.6",
"description": "Tight subset of JSON schema",

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

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