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

lambda-serverless-api

Package Overview
Dependencies
Maintainers
1
Versions
396
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-serverless-api - npm Package Compare versions

Comparing version 8.1.0 to 8.2.0

lib/param/geo-poly-list.js

12

lib/param.js

@@ -43,2 +43,6 @@ "use strict";

const GeoPoly = require('./param/geo-poly');
const GeoPolyList = require('./param/geo-poly-list');
const GeoRect = require('./param/geo-rect');

@@ -48,2 +52,4 @@

const GeoShapeList = require('./param/geo-shape-list');
const NumberParam = require('./param/number-param');

@@ -91,2 +97,6 @@

module.exports.GeoPoly = (...args) => new GeoPoly(...args);
module.exports.GeoPolyList = (...args) => new GeoPolyList(...args);
module.exports.GeoRect = (...args) => new GeoRect(...args);

@@ -96,2 +106,4 @@

module.exports.GeoShapeList = (...args) => new GeoShapeList(...args);
module.exports.Number = (...args) => new NumberParam(...args);

34

lib/param/geo-shape.js
"use strict";
const assert = require('assert');
const Joi = require('joi-strict');
const Json = require('./json');
const validateGeoShape = require('../util/validate-geo-shape');
const {
genSchema
} = require('../util/geo-shape');
const genSchema = ({
maxPoints,
clockwise,
relaxed
}) => {
assert(relaxed === undefined || typeof relaxed === 'boolean');
const schema = Joi.array().items(Joi.array().ordered(Joi.number().min(-180).max(180), Joi.number().min(-90).max(90))).custom((value, _) => {
if (!validateGeoShape({
geoShape: value,
clockwise,
relaxed: relaxed === true
})) {
throw new Error('Invalid GeoShape');
}
return value;
});
return maxPoints === undefined ? schema : schema.max(maxPoints);
};
class GeoShape extends Json {
constructor(name, position, opts = {}) {
const schema = genSchema(opts);
const schema = genSchema({
maxPoints: opts.maxPoints,
clockwise: opts.clockwise,
relaxed: opts.relaxed
});
super(name, position, { ...opts,

@@ -35,0 +17,0 @@ schema

@@ -42,3 +42,3 @@ {

},
"version": "8.1.0",
"version": "8.2.0",
"scripts": {

@@ -45,0 +45,0 @@ "clean": "rm -rf lib",

@@ -103,4 +103,7 @@ # Rest Abstraction for Serverless API

- _GeoPoint_: GPS coordinate input
- _GeoPoly_: GPS coordinate of polygon input and holes
- _GeoPolyList_: List of GPS coordinate of polygon input and holes
- _GeoRect_: GPS coordinate rectangle input
- _GeoShape_: GPS coordinate polygon input
- _GeoShapeList_: GPS coordinate polygon list input
- _Int_: Integer input

@@ -107,0 +110,0 @@ - _IntShort_: Short Integer input

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