Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump tough-cookie and jsonld in /packages/core #477

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions packages/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const fullTdSchema = require("./td-schema-full.json");
const tmSchema = require("./tm-schema.json");
const builder = require("junit-report-builder");

const jsonValidator = require("json-dup-key-validator");

module.exports.tdValidator = tdValidator;
module.exports.tmValidator = tmValidator;
module.exports.propUniqueness = coreAssertions.checkPropUniqueness;
Expand All @@ -42,7 +44,15 @@ module.exports.detectProtocolSchemes = detectProtocolSchemes;
module.exports.convertTDJsonToYaml = convertTDJsonToYaml;
module.exports.convertTDYamlToJson = convertTDYamlToJson;

const jsonValidator = require("json-dup-key-validator");

// This is implemented to avoid a test error, where jest seems to intercept the request
const customLoader = async (url) => {
return {
contextUrl: null, // this is for a context via a link header
document: {}, // this is the actual document that was loaded
documentUrl: url // this is the actual context URL after redirects
};
};

/**
* A function that provides the core functionality of the TD Playground.
Expand Down Expand Up @@ -260,7 +270,8 @@ function tdValidator(
start = Date.now();
jsonld
.toRDF(tdJson, {
format: "application/nquads",
format: "application/n-quads",
documentLoader: customLoader,
})
.then(
(nquads) => {
Expand Down Expand Up @@ -853,7 +864,8 @@ function tmValidator(tmString, logFunc, { checkDefaults = true, checkJsonLd = tr
start = Date.now();
jsonld
.toRDF(tmJson, {
format: "application/nquads",
format: "application/n-quads",
documentLoader: customLoader,
})
.then(
(nquads) => {
Expand Down
Loading
Loading