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

@stoplight/spectral-core

Package Overview
Dependencies
Maintainers
24
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stoplight/spectral-core - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

2

dist/consts.js

@@ -5,3 +5,3 @@ "use strict";

const types_1 = require("@stoplight/types");
exports.SPECTRAL_PKG_VERSION = '1.2.1';
exports.SPECTRAL_PKG_VERSION = '1.3.0';
exports.DEFAULT_PARSER_OPTIONS = Object.freeze({

@@ -8,0 +8,0 @@ incompatibleValues: types_1.DiagnosticSeverity.Error,

@@ -48,4 +48,5 @@ "use strict";

exports.RulesetFunctionValidationError = RulesetFunctionValidationError;
const DEFAULT_OPTIONS_VALIDATOR = (o) => o === null;
function createRulesetFunction({ input, errorOnInvalidInput = false, options, }, fn) {
const validateOptions = options === null ? (o) => o === null : ajv.compile(options);
const validateOptions = options === null ? DEFAULT_OPTIONS_VALIDATOR : ajv.compile(options);
const validateInput = input !== null ? ajv.compile(input) : input;

@@ -88,2 +89,9 @@ const wrappedFn = function (input, options, ...args) {

};
Reflect.defineProperty(wrappedFn, 'schemas', {
enumerable: false,
value: {
input,
options,
},
});
return wrappedFn;

@@ -90,0 +98,0 @@ }

@@ -1,5 +0,6 @@

import { JsonPath } from '@stoplight/types';
import type { JsonPath } from '@stoplight/types';
import type { IDocumentInventory } from '../documentInventory';
import type { IRule } from '../ruleset/rule/rule';
import type { IDocument } from '../document';
import type { JSONSchema7 } from 'json-schema';
export declare type RulesetFunction<I extends unknown = unknown, O extends unknown = unknown> = (input: I, options: O, context: RulesetFunctionContext) => void | IFunctionResult[] | Promise<void | IFunctionResult[]>;

@@ -15,2 +16,6 @@ export declare type RulesetFunctionContext = {

validator<O = unknown>(options: unknown): asserts options is O;
readonly schemas: Readonly<{
input: Readonly<JSONSchema7> | null;
options: Readonly<JSONSchema7> | null;
}>;
};

@@ -17,0 +22,0 @@ export interface IFunctionResult {

{
"name": "@stoplight/spectral-core",
"version": "1.3.0",
"version": "1.4.0",
"main": "dist/index.js",

@@ -30,3 +30,3 @@ "types": "dist/index.d.ts",

"@stoplight/spectral-parsers": "^1.0.0",
"@stoplight/spectral-ref-resolver": "*",
"@stoplight/spectral-ref-resolver": "^1.0.0",
"@stoplight/spectral-runtime": "^1.0.0",

@@ -33,0 +33,0 @@ "@stoplight/types": "12.3.0",

Sorry, the diff of this file is not supported yet

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