@andrewscwei/mongodb-odm
Advanced tools
Comparing version 0.14.0 to 0.15.0
@@ -426,2 +426,16 @@ import { CollectionAggregationOptions, CollectionInsertManyOptions, CollectionInsertOneOptions, CommonOptions, FilterQuery, FindOneAndReplaceOption, IndexOptions, ObjectID, ReplaceOneOptions, UpdateQuery } from 'mongodb'; | ||
export declare function typeIsGeoCoordinate(value: any): value is GeoCoordinate; | ||
/** | ||
* Makes a geo coordinate based on the provided params. | ||
* | ||
* @param longitude - Longitude. | ||
* @param latitude - Latitude. | ||
* | ||
* @returns The geo coordinate. | ||
* | ||
* @throws {Error} Params are invalid. | ||
*/ | ||
export declare function GeoCoordinateMake({ longitude, latitude }: { | ||
longitude: string | number; | ||
latitude: string | number; | ||
}): GeoCoordinate; | ||
export {}; |
@@ -89,2 +89,19 @@ "use strict"; | ||
exports.typeIsGeoCoordinate = typeIsGeoCoordinate; | ||
/** | ||
* Makes a geo coordinate based on the provided params. | ||
* | ||
* @param longitude - Longitude. | ||
* @param latitude - Latitude. | ||
* | ||
* @returns The geo coordinate. | ||
* | ||
* @throws {Error} Params are invalid. | ||
*/ | ||
function GeoCoordinateMake({ longitude, latitude }) { | ||
const coord = [Number(longitude), Number(latitude)]; | ||
if (!typeIsGeoCoordinate(coord)) | ||
throw new Error('Invalid parameters provided'); | ||
return coord; | ||
} | ||
exports.GeoCoordinateMake = GeoCoordinateMake; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@andrewscwei/mongodb-odm", | ||
"version": "0.14.0", | ||
"version": "0.15.0", | ||
"description": "ODM for MongoDB", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
242478
3683