Socket
Socket
Sign inDemoInstall

simple-common-utils

Package Overview
Dependencies
0
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.1.0

18

js/StaticUtils.js

@@ -240,2 +240,20 @@ export default class StaticUtils {

}
static verifyPropertyPresence(object, property, type) {
StaticUtils.verify(object.hasOwnProperty(property), `Property '${property}' is undefined.`);
if (type) {
StaticUtils.verify(object[property].constructor == type || object[property] instanceof type, `Property '${property}' must be a ${type.name}, not a ${object[property].constructor.name}.`);
}
}
static verifyPropertyAbsence(object, property) {
if (Array.isArray(property)) {
for (const name of property) {
StaticUtils.verifyPropertyAbsence(object, name);
}
} else {
StaticUtils.verify(!object.hasOwnProperty(property), `Property '${property}' is already defined.`);
}
}
}

2

package.json
{
"name": "simple-common-utils",
"version": "2.0.0",
"version": "2.1.0",
"description": "A collection of utility classes.",

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

@@ -251,2 +251,3 @@ This is a collection of utility classes used for JS development.

-|-
v2.1.0|`StaticUtils.verifyPropertyPresence()` / `StaticUtils.verifyPropertyAbsence()` are added.
v2.0.0|Backwards-incompatible changes in `data-transmission-protocol` classes:<br>1. `Packet.constructor()` changed and `Packet.wrap()` added.<br>2. `Format` is filled dynamically: it's necessary to import relevant format-defining classes.

@@ -253,0 +254,0 @@ v1.7.1|Autobinding removed from the `data-transmission-protocol` classes.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc