Huge News!Announcing our $40M Series B led by Abstract Ventures.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.1 to 3.3.2

2

index.js

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

if (schema.type === 'string' && options[schemaType].all.maxLength) {
if (options[schemaType].all.maxLength && mapping.type === 'string') {
schema.maxLength = options[schemaType].all.maxLength;

@@ -86,0 +86,0 @@ }

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

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

@@ -1262,2 +1262,34 @@ const chai = require('chai');

it('should apply maxLength sanitization to all strings', () => {
const mapping = {
properties: {
someString: {
type: 'string'
},
someInt: {
type: 'integer'
}
}
};
const expectedSchema = {
properties: {
someString: {
maxLength: 20
},
someInt: {}
}
};
const schemas = MappingToSchema(mapping, {
sanitization: {
all: {
maxLength: 20
}
}
});
expect(schemas.sanitization).to.eql(expectedSchema);
});
it('should apply rules to all string mappings', () => {

@@ -1264,0 +1296,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