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

express-prismic

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-prismic - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

38

index.js

@@ -79,22 +79,24 @@ var Prismic = require('prismic.io').Prismic,

var ctxPromise = new Promise(function (fulfill) {
exports.getApiHome(accessToken, function(err, Api) {
if (!configuration.linkResolver) {
throw new Error("Missing linkResolver in configuration: make sure to call init() at the beginning of your script");
}
if (err) {
exports.onPrismicError(err, req, res);
try {
exports.getApiHome(accessToken, function(err, Api) {
if (!configuration.linkResolver) {
throw new Error("Missing linkResolver in configuration: make sure to call init() at the beginning of your script");
}
if (err) {
configuration.onPrismicError && configuration.onPrismicError(err, req, res);
return;
}
var ctx = {
endpoint: configuration.apiEndpoint,
api: Api,
ref: req.cookies[Prismic.experimentCookie] || req.cookies[Prismic.previewCookie] || Api.master(),
linkResolver: function(doc) {
return configuration.linkResolver(doc);
}
};
fulfill(ctx);
});
var ctx = {
endpoint: configuration.apiEndpoint,
api: Api,
ref: req.cookies[Prismic.experimentCookie] || req.cookies[Prismic.previewCookie] || Api.master(),
linkResolver: function(doc) {
return configuration.linkResolver(doc);
}
};
fulfill(ctx);
});
} catch (ex) {
return fulfill(ex);
}
});

@@ -101,0 +103,0 @@ if(callback){

{
"name": "express-prismic",
"description": "Prismic.io support for Prismic.io",
"version": "0.0.3",
"version": "0.0.4",
"license": "Apache-2.0",

@@ -6,0 +6,0 @@ "homepage": "http://github.com/prismicio/express-prismic",

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