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

xpress-mongo

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xpress-mongo - npm Package Compare versions

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
};

14

js/index.js
"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;

2

package.json
{
"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 };
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