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

@stoplight/spectral-runtime

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stoplight/spectral-runtime - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

dist/fetch.js

@@ -7,4 +7,4 @@ "use strict";

exports.default = async (uri, opts = {}) => {
return node_fetch_1.default(uri, { ...opts, ...exports.DEFAULT_REQUEST_OPTIONS });
return (0, node_fetch_1.default)(uri, { ...opts, ...exports.DEFAULT_REQUEST_OPTIONS });
};
//# sourceMappingURL=fetch.js.map

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

const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./utils"), exports);
(0, tslib_1.__exportStar)(require("./utils"), exports);
var fetch_1 = require("./fetch");
Object.defineProperty(exports, "fetch", { enumerable: true, get: function () { return fetch_1.default; } });
Object.defineProperty(exports, "DEFAULT_REQUEST_OPTIONS", { enumerable: true, get: function () { return fetch_1.DEFAULT_REQUEST_OPTIONS; } });
tslib_1.__exportStar(require("./reader"), exports);
(0, tslib_1.__exportStar)(require("./reader"), exports);
//# sourceMappingURL=index.js.map

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

async function readFile(name, opts) {
if (path_1.isURL(name)) {
if ((0, path_1.isURL)(name)) {
let response;

@@ -25,3 +25,3 @@ let timeout = null;

}
response = await fetch_1.default(name, requestOpts);
response = await (0, fetch_1.default)(name, requestOpts);
if (!response.ok)

@@ -32,3 +32,3 @@ throw new Error(response.statusText);

catch (ex) {
if (lodash_1.isError(ex) && ex.name === 'AbortError') {
if ((0, lodash_1.isError)(ex) && ex.name === 'AbortError') {
throw new Error('Timeout');

@@ -60,3 +60,3 @@ }

catch (ex) {
throw new Error(`Could not read ${name}: ${printError_1.printError(ex)}`);
throw new Error(`Could not read ${name}: ${(0, printError_1.printError)(ex)}`);
}

@@ -71,3 +71,3 @@ }

catch (ex) {
throw new Error(`Could not parse ${name}: ${printError_1.printError(ex)}`);
throw new Error(`Could not parse ${name}: ${(0, printError_1.printError)(ex)}`);
}

@@ -74,0 +74,0 @@ }

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

function decodeSegmentFragment(segment) {
return typeof segment !== 'string' ? String(segment) : json_1.decodePointerFragment(segment);
return typeof segment !== 'string' ? String(segment) : (0, json_1.decodePointerFragment)(segment);
}
exports.decodeSegmentFragment = decodeSegmentFragment;
//# sourceMappingURL=decodeSegmentFragment.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./decodeSegmentFragment"), exports);
tslib_1.__exportStar(require("./printError"), exports);
tslib_1.__exportStar(require("./printPath"), exports);
tslib_1.__exportStar(require("./printValue"), exports);
tslib_1.__exportStar(require("./refs"), exports);
(0, tslib_1.__exportStar)(require("./decodeSegmentFragment"), exports);
(0, tslib_1.__exportStar)(require("./printError"), exports);
(0, tslib_1.__exportStar)(require("./printPath"), exports);
(0, tslib_1.__exportStar)(require("./printValue"), exports);
(0, tslib_1.__exportStar)(require("./refs"), exports);
//# sourceMappingURL=index.js.map

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

function printError(maybeError) {
if (lodash_1.isError(maybeError)) {
if ((0, lodash_1.isError)(maybeError)) {
return maybeError.message;

@@ -9,0 +9,0 @@ }

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

const hasWhitespace = (input) => /\s/.test(input);
const safeDecodePointerFragment = (segment) => typeof segment === 'number' ? segment : json_1.decodePointerFragment(segment);
const safeDecodePointerFragment = (segment) => typeof segment === 'number' ? segment : (0, json_1.decodePointerFragment)(segment);
const printDotBracketsSegment = (segment) => {

@@ -34,3 +34,3 @@ if (typeof segment === 'number') {

case PrintStyle.Dot:
return json_1.decodePointerFragment(pathToDotString(path));
return (0, json_1.decodePointerFragment)(pathToDotString(path));
case PrintStyle.Pointer:

@@ -40,5 +40,5 @@ if (path.length === 0) {

}
return `#/${json_1.decodePointerFragment(path.join('/'))}`;
return `#/${(0, json_1.decodePointerFragment)(path.join('/'))}`;
case PrintStyle.EscapedPointer:
return json_1.pathToPointer(path.map(safeDecodePointerFragment));
return (0, json_1.pathToPointer)(path.map(safeDecodePointerFragment));
default:

@@ -45,0 +45,0 @@ return String(path);

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

}
if (lodash_1.isObject(value)) {
if ((0, lodash_1.isObject)(value)) {
if (Array.isArray(value)) {

@@ -18,3 +18,3 @@ return 'Array[]';

}
if (!json_1.isPlainObject(value) && 'constructor' in value && typeof value.constructor.name === 'string') {
if (!(0, json_1.isPlainObject)(value) && 'constructor' in value && typeof value.constructor.name === 'string') {
return value.constructor.name;

@@ -21,0 +21,0 @@ }

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

exports.startsWithProtocol = startsWithProtocol;
const isAbsoluteRef = (ref) => path_1.isAbsolute(ref) || exports.startsWithProtocol(ref);
const isAbsoluteRef = (ref) => (0, path_1.isAbsolute)(ref) || (0, exports.startsWithProtocol)(ref);
exports.isAbsoluteRef = isAbsoluteRef;

@@ -16,3 +16,3 @@ const traverseObjUntilRef = (obj, path) => {

for (const segment of path.slice()) {
if (!lodash_1.isObject(piece)) {
if (!(0, lodash_1.isObject)(piece)) {
throw new TypeError('Segment is not a part of the object');

@@ -23,3 +23,3 @@ }

}
else if (json_1.hasRef(piece)) {
else if ((0, json_1.hasRef)(piece)) {
return piece.$ref;

@@ -32,3 +32,3 @@ }

}
if (json_1.isPlainObject(piece) && json_1.hasRef(piece) && Object.keys(piece).length === 1) {
if ((0, json_1.isPlainObject)(piece) && (0, json_1.hasRef)(piece) && Object.keys(piece).length === 1) {
return piece.$ref;

@@ -47,4 +47,4 @@ }

const safePointerToPath = (pointer) => {
const rawPointer = json_1.extractPointerFromRef(pointer);
return rawPointer !== null ? json_1.pointerToPath(rawPointer) : [];
const rawPointer = (0, json_1.extractPointerFromRef)(pointer);
return rawPointer !== null ? (0, json_1.pointerToPath)(rawPointer) : [];
};

@@ -54,7 +54,7 @@ exports.safePointerToPath = safePointerToPath;

const closestPath = [];
if (!lodash_1.isObject(data))
if (!(0, lodash_1.isObject)(data))
return closestPath;
let piece = data;
for (const segment of path) {
if (!lodash_1.isObject(piece) || !(segment in piece))
if (!(0, lodash_1.isObject)(piece) || !(segment in piece))
break;

@@ -61,0 +61,0 @@ closestPath.push(segment);

{
"name": "@stoplight/spectral-runtime",
"version": "1.1.0",
"version": "1.1.1",
"homepage": "https://github.com/stoplightio/spectral",

@@ -20,4 +20,7 @@ "bugs": "https://github.com/stoplightio/spectral/issues",

},
"scripts": {
"release": "semantic-release -e semantic-release-monorepo"
},
"dependencies": {
"@stoplight/json": "^3.15.0",
"@stoplight/json": "^3.17.0",
"@stoplight/path": "^1.3.2",

@@ -27,4 +30,5 @@ "@stoplight/types": "^12.3.0",

"lodash": "^4.17.21",
"node-fetch": "^2.6.1"
"node-fetch": "^2.6.1",
"tslib": "^2.3.1"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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