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

@stoplight/prism-core

Package Overview
Dependencies
Maintainers
26
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stoplight/prism-core - npm Package Compare versions

Comparing version 3.3.0-alpha.0 to 3.3.0-beta.0

1

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./types"), exports);
tslib_1.__exportStar(require("./factory"), exports);
tslib_1.__exportStar(require("./logger"), exports);

@@ -56,19 +56,1 @@ import { IDiagnostic } from '@stoplight/types';

}
export declare type ProblemJson = {
type: string;
title: string;
status: number;
detail: string;
};
export declare class ProblemJsonError extends Error {
readonly name: string;
readonly message: string;
readonly status: number;
readonly detail: string;
static fromTemplate(template: Omit<ProblemJson, 'detail'>, detail?: string): ProblemJsonError;
static fromPlainError(error: Error & {
detail?: string;
status?: number;
}): ProblemJson;
constructor(name: string, message: string, status: number, detail: string);
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ProblemJsonError extends Error {
constructor(name, message, status, detail) {
super(message);
this.name = name;
this.message = message;
this.status = status;
this.detail = detail;
}
static fromTemplate(template, detail) {
const error = new ProblemJsonError(`https://stoplight.io/prism/errors#${template.type}`, template.title, template.status, detail || '');
return error;
}
static fromPlainError(error) {
return {
type: error.name && error.name !== 'Error' ? error.name : 'https://stoplight.io/prism/errors#UNKNOWN',
title: error.message,
status: error.status || 500,
detail: error.detail || '',
};
}
}
exports.ProblemJsonError = ProblemJsonError;

4

package.json
{
"name": "@stoplight/prism-core",
"version": "3.3.0-alpha.0",
"version": "3.3.0-beta.0",
"main": "dist/index.js",

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

},
"gitHead": "633905da52ce828ab54f9183b8f30211b9e30767"
"gitHead": "8567caf2d808c60e899bff02b630cfcd243ac1b1"
}
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