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

express-rest-api-generator

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-rest-api-generator - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

15

lib/helpers.js

@@ -0,1 +1,3 @@

const log = require('debug')('rest:helpers:');
// sluggify method names from `camelCase` to `camel-case`

@@ -11,3 +13,3 @@ // used for generating endpoints from statics.

if (typeof obj === 'undefined' || typeof key === 'undefined') return obj;
if (typeof prop({ obj, key }) !== 'undefined') prop({ obj, key, remove: true });
prop({ obj, key, remove: true });
return obj;

@@ -26,5 +28,5 @@ }

function prop({ obj = {}, str = '', val = undefined, remove = false }) {
str = typeof str === 'string' ? str : `${str}`;
const props = str.indexOf('.') !== -1 ? str.split('.') : [str];
function prop({ obj = {}, key = '', val, remove = false }) {
key = typeof key === 'string' ? key : `${key}`;
const props = key.indexOf('.') !== -1 ? key.split('.') : [key];
const final = props.pop();

@@ -41,3 +43,6 @@ if (props.length) {

}
if (remove === true) return delete obj[final];
if (remove === true) {
delete obj[final];
return obj;
}
return typeof val !== 'undefined' ? (obj[final] = val) : obj[final];

@@ -44,0 +49,0 @@ }

{
"name": "express-rest-api-generator",
"version": "1.2.0",
"version": "1.3.0",
"description": "express mountable app for mongoose routes with generators for mongoose model embedded statics",

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

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