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

minim

Package Overview
Dependencies
Maintainers
6
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minim - npm Package Compare versions

Comparing version 0.23.4 to 0.23.5

.circleci/config.yml

5

CHANGELOG.md
# Minim Changelog
## 0.23.5 (2019-07-02)
This release brings some performance improvements, namely to serialising with
the JSON serialisers.
## 0.23.4 (2019-06-11)

@@ -4,0 +9,0 @@

8

lib/primitives/ObjectElement.js

@@ -130,9 +130,3 @@ const negate = require('lodash/negate');

hasKey(value) {
for (let i = 0; i < this.content.length; i += 1) {
if (this.content[i].key.equals(value)) {
return true;
}
}
return false;
return this.content.some(member => member.key.equals(value));
}

@@ -139,0 +133,0 @@

@@ -365,34 +365,18 @@ const JSONSerialiser = require('./JSONSerialiser');

if (item.element === 'array') {
// This is a plain array, but maybe it contains elements with
// additional information? Let's see!
const values = [];
return item.map((subItem) => {
if (this.shouldRefract(subItem) || key === 'default') {
return this.serialise(subItem);
}
for (let index = 0; index < item.length; index += 1) {
const subItem = item.get(index);
if (this.shouldRefract(subItem) || key === 'default') {
values.push(this.serialise(subItem));
} else if (subItem.element === 'array' || subItem.element === 'object' || subItem.element === 'enum') {
if (subItem.element === 'array' || subItem.element === 'object' || subItem.element === 'enum') {
// items for array or enum inside array are always serialised
const value = subItem.children.map(subSubItem => this.serialise(subSubItem));
values.push(value);
} else {
values.push(subItem.toValue());
return subItem.children.map(subSubItem => this.serialise(subSubItem));
}
}
return values;
return subItem.toValue();
});
}
if (item.element === 'object') {
// This is an object, so we need to check if it's members contain
// additional information
const values = [];
const content = item.content || [];
for (let index = 0; index < content.length; index += 1) {
values.push(this.serialise(content[index]));
}
return values;
return (item.content || []).map(this.serialise, this);
}

@@ -410,7 +394,6 @@

obj.keys().forEach((key) => {
const value = obj.get(key);
obj.forEach((value, key) => {
if (value) {
result[key] = this.convertKeyToRefract(key, value);
const keyValue = key.toValue();
result[keyValue] = this.convertKeyToRefract(keyValue, value);
}

@@ -417,0 +400,0 @@ });

@@ -132,7 +132,5 @@ /**

obj.keys().forEach((key) => {
const value = obj.get(key);
obj.forEach((value, key) => {
if (value) {
result[key] = this.serialise(value);
result[key.toValue()] = this.serialise(value);
}

@@ -139,0 +137,0 @@ });

{
"name": "minim",
"version": "0.23.4",
"version": "0.23.5",
"description": "A library for interacting with JSON through Refract elements",

@@ -5,0 +5,0 @@ "main": "lib/minim.js",

Sorry, the diff of this file is too big to display

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