aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/schema/operators/geospatial.js
diff options
context:
space:
mode:
authorAvinashS <avinash.s@huawei.com>2017-08-30 18:39:12 +0530
committerAvinashS <avinash.s@huawei.com>2017-08-31 11:35:26 +0530
commit8e30fbf41dabee082aafb60fe0639b504497674d (patch)
tree5b715fa6a11f770f59af4ba6f474b558a85156a3 /common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/schema/operators/geospatial.js
parent31dfadf9c4cb7ef2cc0f1af625bc9bd0097f0d94 (diff)
vnfsdk market place seed code refactoring
cleanup the package names and a test file correction Change-Id: Icc5a3b48189824dfe5cb84f05ce2c496bcfa3eab IssueId: VNFSDK-74 Signed-off-by: AvinashS <avinash.s@huawei.com>
Diffstat (limited to 'common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/schema/operators/geospatial.js')
-rw-r--r--common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/schema/operators/geospatial.js100
1 files changed, 0 insertions, 100 deletions
diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/schema/operators/geospatial.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/schema/operators/geospatial.js
deleted file mode 100644
index b490d2db..00000000
--- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/schema/operators/geospatial.js
+++ /dev/null
@@ -1,100 +0,0 @@
-/*!
- * Module requirements.
- */
-
-var castArraysOfNumbers = require('./helpers').castArraysOfNumbers;
-var castToNumber = require('./helpers').castToNumber;
-
-/*!
- * ignore
- */
-
-exports.cast$geoIntersects = cast$geoIntersects;
-exports.cast$near = cast$near;
-exports.cast$within = cast$within;
-
-function cast$near(val) {
- var SchemaArray = require('../array');
-
- if (Array.isArray(val)) {
- castArraysOfNumbers(val, this);
- return val;
- }
-
- _castMinMaxDistance(this, val);
-
- if (val && val.$geometry) {
- return cast$geometry(val, this);
- }
-
- return SchemaArray.prototype.castForQuery.call(this, val);
-}
-
-function cast$geometry(val, self) {
- switch (val.$geometry.type) {
- case 'Polygon':
- case 'LineString':
- case 'Point':
- castArraysOfNumbers(val.$geometry.coordinates, self);
- break;
- default:
- // ignore unknowns
- break;
- }
-
- _castMinMaxDistance(this, val);
-
- return val;
-}
-
-function cast$within(val) {
- _castMinMaxDistance(this, val);
-
- if (val.$box || val.$polygon) {
- var type = val.$box ? '$box' : '$polygon';
- val[type].forEach(function(arr) {
- if (!Array.isArray(arr)) {
- var msg = 'Invalid $within $box argument. '
- + 'Expected an array, received ' + arr;
- throw new TypeError(msg);
- }
- arr.forEach(function(v, i) {
- arr[i] = castToNumber.call(this, v);
- });
- });
- } else if (val.$center || val.$centerSphere) {
- type = val.$center ? '$center' : '$centerSphere';
- val[type].forEach(function(item, i) {
- if (Array.isArray(item)) {
- item.forEach(function(v, j) {
- item[j] = castToNumber.call(this, v);
- });
- } else {
- val[type][i] = castToNumber.call(this, item);
- }
- });
- } else if (val.$geometry) {
- cast$geometry(val, this);
- }
-
- return val;
-}
-
-function cast$geoIntersects(val) {
- var geo = val.$geometry;
- if (!geo) {
- return;
- }
-
- cast$geometry(val, this);
- return val;
-}
-
-function _castMinMaxDistance(self, val) {
- if (val.$maxDistance) {
- val.$maxDistance = castToNumber.call(self, val.$maxDistance);
- }
- if (val.$minDistance) {
- val.$minDistance = castToNumber.call(self, val.$minDistance);
- }
-}