xpress-mongo
Advanced tools
Comparing version 0.0.36 to 0.0.37
15
index.ts
@@ -28,2 +28,14 @@ import {MongoClient, MongoClientOptions} from "mongodb"; | ||
/** | ||
* Mongodb online server url parser. | ||
* Inserts dbname and URI encoded password | ||
* @param url | ||
* @param options | ||
*/ | ||
function parseServerUrl(url: string, options: { dbname: string, password: string }) { | ||
options.password = encodeURI(options.password); | ||
return url.replace('<dbname>', options.dbname) | ||
.replace('<password>', options.password); | ||
} | ||
export { | ||
@@ -46,2 +58,5 @@ // Export is schemaBuilder | ||
omitIdAndPick, | ||
// Others | ||
parseServerUrl | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.omitIdAndPick = exports.omitIdAnd = exports.pickKeys = exports.omitKeys = exports.XMongoDataType = exports.XMongoModel = exports.Client = exports.is = void 0; | ||
exports.parseServerUrl = exports.omitIdAndPick = exports.omitIdAnd = exports.pickKeys = exports.omitKeys = exports.XMongoDataType = exports.XMongoModel = exports.Client = exports.is = void 0; | ||
const mongodb_1 = require("mongodb"); | ||
@@ -37,1 +37,13 @@ const XMongoSchemaBuilder_1 = require("./src/XMongoSchemaBuilder"); | ||
exports.Client = Client; | ||
/** | ||
* Mongodb online server url parser. | ||
* Inserts dbname and URI encoded password | ||
* @param url | ||
* @param options | ||
*/ | ||
function parseServerUrl(url, options) { | ||
options.password = encodeURI(options.password); | ||
return url.replace('<dbname>', options.dbname) | ||
.replace('<password>', options.password); | ||
} | ||
exports.parseServerUrl = parseServerUrl; |
{ | ||
"name": "xpress-mongo", | ||
"version": "0.0.36", | ||
"version": "0.0.37", | ||
"description": "Light Weight ODM for mongoDb", | ||
@@ -5,0 +5,0 @@ "main": "js/index.js", |
@@ -15,2 +15,12 @@ import { MongoClient, MongoClientOptions } from "mongodb"; | ||
declare function Client(url: string | MongoClient, options?: MongoClientOptions): XMongoClient; | ||
export { is, Client, XMongoModel, XMongoDataType, XMongoSchemaBuilder, omitKeys, pickKeys, omitIdAnd, omitIdAndPick, }; | ||
/** | ||
* Mongodb online server url parser. | ||
* Inserts dbname and URI encoded password | ||
* @param url | ||
* @param options | ||
*/ | ||
declare function parseServerUrl(url: string, options: { | ||
dbname: string; | ||
password: string; | ||
}): string; | ||
export { is, Client, XMongoModel, XMongoDataType, XMongoSchemaBuilder, omitKeys, pickKeys, omitIdAnd, omitIdAndPick, parseServerUrl }; |
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
136420
3736