@vsaas/loopback-connector-mongodb 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,15 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/lib/test-utils.ts
3
+ function getDistanceBetweenPoints(point1, point2) {
4
+ const radiusInKm = 6371;
5
+ const deltaLat = deg2rad(point2.lat - point1.lat);
6
+ const deltaLon = deg2rad(point2.lng - point1.lng);
7
+ const a = Math.sin(deltaLat / 2) * Math.sin(deltaLat / 2) + Math.cos(deg2rad(point1.lat)) * Math.cos(deg2rad(point2.lat)) * Math.sin(deltaLon / 2) * Math.sin(deltaLon / 2);
8
+ return radiusInKm * (2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)));
9
+ }
10
+ function deg2rad(deg) {
11
+ return deg * (Math.PI / 180);
12
+ }
13
+ //#endregion
14
+ exports.deg2rad = deg2rad;
15
+ exports.getDistanceBetweenPoints = getDistanceBetweenPoints;
@@ -0,0 +1,11 @@
1
+ //#region src/lib/test-utils.d.ts
2
+ declare function getDistanceBetweenPoints(point1: {
3
+ lat: number;
4
+ lng: number;
5
+ }, point2: {
6
+ lat: number;
7
+ lng: number;
8
+ }): number;
9
+ declare function deg2rad(deg: number): number;
10
+ //#endregion
11
+ export { deg2rad, getDistanceBetweenPoints };
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = require('./dist/mongodb.cjs');
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@vsaas/loopback-connector-mongodb",
3
+ "version": "10.0.0",
4
+ "description": "MongoDB connector for LoopBack 3, maintained fork",
5
+ "keywords": [
6
+ "connector",
7
+ "datasource",
8
+ "loopback",
9
+ "loopback3",
10
+ "mongodb"
11
+ ],
12
+ "license": "MIT",
13
+ "author": "Xompass",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/xompass/loopback-connector-mongodb"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "index.js",
21
+ "README.md",
22
+ "LICENSE"
23
+ ],
24
+ "main": "index.js",
25
+ "types": "dist/mongodb.d.cts",
26
+ "exports": {
27
+ ".": "./index.js"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public",
31
+ "registry": "https://registry.npmjs.org/"
32
+ },
33
+ "dependencies": {
34
+ "debug": "^4.4.3",
35
+ "mongodb": "^5.9.2",
36
+ "@vsaas/loopback-connector": "^10.0.0"
37
+ },
38
+ "devDependencies": {
39
+ "@types/debug": "^4.1.13",
40
+ "@types/node": "25.5.0",
41
+ "oxfmt": "0.42.0",
42
+ "oxlint": "1.57.0",
43
+ "semver": "^6.3.0",
44
+ "should": "13.2.1",
45
+ "sinon": "^7.5.0",
46
+ "tsdown": "0.21.5",
47
+ "typescript": "6.0.2",
48
+ "vitest": "4.1.1",
49
+ "@vsaas/loopback-datasource-juggler": "^10.0.0"
50
+ },
51
+ "engines": {
52
+ "node": ">=20"
53
+ },
54
+ "scripts": {
55
+ "build": "tsdown",
56
+ "fmt": "oxfmt -c ../.oxfmtrc.json .",
57
+ "lint": "oxlint -c ../.oxlintrc.json .",
58
+ "lint:fix": "oxlint -c ../.oxlintrc.json . --fix",
59
+ "test:run": "vitest run",
60
+ "test": "pnpm run build && vitest run",
61
+ "typecheck": "tsc --noEmit -p tsconfig.json"
62
+ }
63
+ }