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

es-mapping-to-schema

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-mapping-to-schema - npm Package Compare versions

Comparing version 3.3.7 to 3.3.8

package-lock.json

2

index.js

@@ -67,3 +67,3 @@ const _ = require('lodash');

_.forEach(localOptions, (value, field) => {
if (options.isArray) {
if (options.isArray && field !== 'optional') {
schema.items[field] = value;

@@ -70,0 +70,0 @@ } else {

{
"name": "es-mapping-to-schema",
"version": "3.3.7",
"version": "3.3.8",
"description": "Convert Elasticsearch mappings to Schema Inspector schemas",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1477,2 +1477,55 @@ const chai = require('chai');

it('should NOT nest sanitization in array for individual optional fields', () => {
const mapping = {
properties: {
someString: {
type: 'string'
}
}
};
const expectedSchema = {
type: 'object',
properties: {
someString: {
type: 'array',
optional: true,
items: {
type: 'string'
}
}
}
};
const schemas = MappingToSchema(mapping, {
arrayPaths: [
'someString'
],
sanitization: {
all: {
types: [
'object',
'integer',
'string',
'number',
'array',
'boolean',
'date'
]
},
paths: {
optional: [
{
path: 'someString',
value: true
}
]
}
}
});
expect(schemas.sanitization).to.eql(expectedSchema);
});
it('should apply strict sanitization to arrays of objects', () => {

@@ -1479,0 +1532,0 @@ const mapping = {

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