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

@ministryofjustice/fb-nunjucks-helpers

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ministryofjustice/fb-nunjucks-helpers - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

17

lib/fb-nunjucks-data-helpers.js

@@ -85,2 +85,6 @@ const Markdown = require('markdown-it')()

if (data._type !== 'date') {
updatedItem.attributes = Object.assign({}, updatedItem.attributes, {
'data-block-id': item._id,
'data-block-type': item._type
})
updatedItem.label = {

@@ -139,2 +143,9 @@ attributes: {

const setMainEditableInstanceProperty = (data, property) => {
data = JSON.parse(JSON.stringify(data))
data.attributes = data.attributes || {}
data.attributes['data-block-property-instance'] = property
return data
}
const handleWidthClass = (data, prop, def) => {

@@ -170,3 +181,4 @@ if (!data[prop] && def) {

setWidthClass,
setInputWidthClass
setInputWidthClass,
setMainEditableInstanceProperty
}

@@ -188,3 +200,4 @@

setWidthClass,
setInputWidthClass
setInputWidthClass,
setMainEditableInstanceProperty
}

8

lib/fb-nunjucks-helpers.js

@@ -8,4 +8,8 @@ const nunjucksMacroHelpers = require('./nunjucks-macro-helpers')

nunjucksEnv.addFilter('addBlockInfo', (str, params) => {
const output = str.replace(/\s*(<\w+[^>]+)/, `$1 data-block-id="${params._id}" data-block-type="${params._type}"`)
.replace(/(govuk-form-group)/, `$1 fb-block-${params._type}`)
const output = str.replace(/\s*(<\w+[^>]+)/, (m, m1) => {
if (!params._id) {
return m
}
return `${m1} data-block-id="${params._id}" data-block-type="${params._type}"`
}).replace(/(govuk-form-group)/, `$1 fb-block-${params._type}`)
return output

@@ -12,0 +16,0 @@ })

{
"name": "@ministryofjustice/fb-nunjucks-helpers",
"version": "0.0.10",
"version": "0.0.11",
"description": "Form Builder Nunjucks helpers",

@@ -5,0 +5,0 @@ "main": "lib/fb-nunjucks-helpers.js",

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