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

@hmcts/one-per-page

Package Overview
Dependencies
Maintainers
18
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hmcts/one-per-page - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

2

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/hmcts/one-per-page#readme",
"version": "4.0.1",
"version": "4.0.2",
"main": "./src/main.js",

@@ -8,0 +8,0 @@ "repository": {

@@ -78,3 +78,11 @@ const { fieldDescriptor } = require('./fieldDescriptor');

const fieldName = `${name}[${i}]`;
return { [i]: field.parse(fieldName, { [fieldName]: value }) };
const valueBody = {};
if (typeof value === 'object') {
Object.keys(value).forEach(key => {
valueBody[`${fieldName}-${key}`] = value[key];
});
} else {
valueBody[fieldName] = value;
}
return { [i]: field.parse(fieldName, valueBody) };
})

@@ -81,0 +89,0 @@ .reduce(flattenObject, {});

@@ -202,2 +202,23 @@ const { expect } = require('../util/chai');

describe('list(object({ a: text, b: bool }))', fieldTest(
list(object({ a: text, b: bool })), it => {
it.parses({ to: [{}], from: [{}] });
it.parses({
to: [{ a: 'text', b: true }],
from: [{ a: 'text', b: 'true' }]
});
it.deserializes({
value: [{ a: 'text', b: 'true' }],
from: [{ a: 'text', b: 'true' }]
});
it.serializes({
to: [{ a: 'text', b: true }],
from: [{ a: 'text', b: true }]
});
}
));
describe('appendToList([list], [index], text)', fieldTest(

@@ -204,0 +225,0 @@ appendToList('items', 1, text), it => {

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