New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

contentful-metalsmith

Package Overview
Dependencies
Maintainers
5
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contentful-metalsmith - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

2

index.js

@@ -23,2 +23,4 @@ 'use strict'

return function (files, metalsmith, done) {
options.metadata = metalsmith.metadata()
return new Promise(resolve => {

@@ -25,0 +27,0 @@ resolve(Object.keys(files))

19

lib/processor.js

@@ -93,7 +93,8 @@ 'use strict'

* @param {Array} entries entries fetched from contentful
* @param {Object} options file options
*
* @return {Object} file mapping object
*/
function processEntriesForFile (file, entries) {
const options = file.contentful
function processEntriesForFile (file, entries, options) {
const contentfulOptions = file.contentful
const files = {}

@@ -103,3 +104,3 @@

if (options.entry_id) {
if (contentfulOptions.entry_id) {
validator.validateSingleEntryForFile(entries[0], file)

@@ -121,5 +122,5 @@

if (options.entry_template) {
if (contentfulOptions.entry_template) {
return entries.reduce((fileMap, entry) => {
fileMap[ entry._fileName ] = {
fileMap[ entry._fileName ] = Object.assign({
// `contents` need to be defined because there

@@ -130,8 +131,8 @@ // might be other plugins that expect it

id: entry.sys.id,
contentType: options.content_type,
layout: options.entry_template,
contentType: contentfulOptions.content_type,
layout: contentfulOptions.entry_template,
_fileName: entry._fileName,
_parentFileName: file._fileName
}
}, options.metadata)

@@ -170,3 +171,3 @@ return fileMap

.then(entries => mapEntriesForFile(entries.items, file, options))
.then(entries => processEntriesForFile(file, entries))
.then(entries => processEntriesForFile(file, entries, options))
.then(entries => getCommonContentForSpace(entries, options))

@@ -173,0 +174,0 @@ }

@@ -46,3 +46,3 @@ {

},
"version": "0.6.0"
"version": "0.7.0"
}
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