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

oneday-core

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oneday-core - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

test.js

41

index.js

@@ -118,9 +118,32 @@ 'use strict';

function hasProperties(obj, props) {
var missingProps = [];
var objKeys = Object.keys(obj);
const missingProps = [];
if (!isArray(props) || !isObject(obj)) {
return {
status: false,
props: props
};
}
for (const each in props) {
if (objKeys.indexOf(props[each]) < 0) {
missingProps.push(props[each]);
const property = props[each];
let splitProperty = [];
if (property.toString().indexOf('.') > 0) {
splitProperty = property.split('.');
} else {
splitProperty = property;
}
let currentObj = obj;
for (const sEach in splitProperty) {
const currentProp = splitProperty[sEach];
if (Object.keys(currentObj).indexOf(currentProp) > -1) {
currentObj = currentObj[currentProp];
} else {
missingProps.push(property);
break;
}
}
}

@@ -140,3 +163,13 @@ if (missingProps.length !== 0) {

function isArray(a) {
return (!!a) && (a.constructor === Array);
}
function isObject(a) {
return (!!a) && (a.constructor === Object);
}
module.exports.hasProperties = hasProperties;
module.exports.isArray = isArray;
module.exports.isObject = isObject;
module.exports.postToDb = postToDb;

@@ -143,0 +176,0 @@ module.exports.saveEvent = saveEvent;

8

package.json
{
"name": "oneday-core",
"version": "1.0.1",
"version": "1.0.2",
"description": "Basic AWS util functions to ease development.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha"
},

@@ -13,4 +13,8 @@ "license": "ISC",

"aws-sdk": "^2.493.0",
"chai": "^4.2.0",
"uuid": "^3.3.2"
},
"devDependencies": {
"mocha": "^6.1.4"
}
}
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