From 83ce9fed76ce68eaccb87a9ee72f97339f62ae5c Mon Sep 17 00:00:00 2001 From: hasezoey Date: Wed, 9 Sep 2020 13:13:08 +0200 Subject: [PATCH] fix: use "db_util.isNullOrUndefined" - remove imports of "util.isNullOrUndefined" and replaces with "db_util.isNullOrUndefined" - MongoMemoryServer: ensureInstance: remove extra ":" in logging --- packages/mongodb-memory-server-core/src/MongoMemoryServer.ts | 5 ++--- .../src/util/MongoBinaryDownloadUrl.ts | 2 +- packages/mongodb-memory-server-core/src/util/getos/index.ts | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/mongodb-memory-server-core/src/MongoMemoryServer.ts b/packages/mongodb-memory-server-core/src/MongoMemoryServer.ts index 4cb98404b..6a9b11bdc 100644 --- a/packages/mongodb-memory-server-core/src/MongoMemoryServer.ts +++ b/packages/mongodb-memory-server-core/src/MongoMemoryServer.ts @@ -1,11 +1,10 @@ import { ChildProcess } from 'child_process'; import * as tmp from 'tmp'; import getPort from 'get-port'; -import { generateDbName, getUriBase } from './util/db_util'; +import { generateDbName, getUriBase, isNullOrUndefined } from './util/db_util'; import MongoInstance from './util/MongoInstance'; import { MongoBinaryOpts } from './util/MongoBinary'; import { MongoMemoryInstancePropT, StorageEngineT, SpawnOptions } from './types'; -import { isNullOrUndefined } from 'util'; import debug from 'debug'; const log = debug('MongoMS:MongoMemoryServer'); @@ -217,7 +216,7 @@ export default class MongoMemoryServer { * -> throws if instance cannot be started */ async ensureInstance(): Promise { - log('Called MongoMemoryServer.ensureInstance() method:'); + log('Called MongoMemoryServer.ensureInstance() method'); if (this.runningInstance) { return this.runningInstance; } else { diff --git a/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts b/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts index 510f436fe..d1127fcf3 100644 --- a/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts +++ b/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts @@ -3,7 +3,7 @@ import { execSync } from 'child_process'; import resolveConfig from './resolve-config'; import debug from 'debug'; import * as semver from 'semver'; -import { isNullOrUndefined } from 'util'; +import { isNullOrUndefined } from './db_util'; const log = debug('MongoMS:MongoBinaryDownloadUrl'); diff --git a/packages/mongodb-memory-server-core/src/util/getos/index.ts b/packages/mongodb-memory-server-core/src/util/getos/index.ts index b18cbb970..3a84241c1 100644 --- a/packages/mongodb-memory-server-core/src/util/getos/index.ts +++ b/packages/mongodb-memory-server-core/src/util/getos/index.ts @@ -2,10 +2,11 @@ import { readFile, readdir } from 'fs'; import { platform } from 'os'; import { exec } from 'child_process'; -import { promisify, isNullOrUndefined } from 'util'; +import { promisify } from 'util'; import { join } from 'path'; import resolveConfig from '../resolve-config'; import debug from 'debug'; +import { isNullOrUndefined } from '../db_util'; const log = debug('MongoMS:getos');