Skip to content

Commit

Permalink
dependencies(typescript): upgrade to 4.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Feb 10, 2021
1 parent 79a0ec0 commit 30ea057
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"prettier": "2.1.2",
"semantic-release": "17.2.2",
"ts-jest": "26.4.3",
"typescript": "4.0.5"
"typescript": "4.1.3"
},
"workspaces": {
"packages": [
Expand Down
4 changes: 2 additions & 2 deletions packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ export class MongoMemoryReplSet extends EventEmitter {
return;
case MongoMemoryReplSetStates.init:
// wait for event "running"
await new Promise((res) => {
await new Promise<void>((res) => {
// the use of "this" here can be done because "on" either binds "this" or uses an arrow function
function waitRunning(this: MongoMemoryReplSet, state: MongoMemoryReplSetStates) {
// this is because other states can be emitted multiple times (like stopped & init for auth creation)
Expand Down Expand Up @@ -592,7 +592,7 @@ export class MongoMemoryReplSet extends EventEmitter {
await Promise.race([
...this.servers.map(
(server) =>
new Promise((res, rej) => {
new Promise<void>((res, rej) => {
const instanceInfo = server.instanceInfo;

if (!instanceInfo) {
Expand Down
8 changes: 8 additions & 0 deletions packages/mongodb-memory-server-core/src/MongoMemoryServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,16 @@ export class MongoMemoryServer extends EventEmitter {
`"ensureInstance" waited for "running" but got an different state: "${state}"`
)
);

return;
}

// this assertion is mainly for types (typescript otherwise would complain that "_instanceInfo" might be "undefined")
assertion(
!isNullOrUndefined(this._instanceInfo),
new Error('InstanceInfo is undefined!')
);

res(this._instanceInfo);
})
);
Expand Down
6 changes: 3 additions & 3 deletions packages/mongodb-memory-server-core/src/util/MongoBinary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class MongoBinary {
// wait to get a lock
// downloading of binaries may be quite long procedure
// that's why we are using so big wait/stale periods
await new Promise((resolve, reject) => {
await new Promise<void>((res, rej) => {
LockFile.lock(
lockfile,
{
Expand All @@ -68,7 +68,7 @@ export class MongoBinary {
retryWait: 100,
},
(err: any) => {
return err ? reject(err) : resolve();
return err ? rej(err) : res();
}
);
});
Expand All @@ -86,7 +86,7 @@ export class MongoBinary {
}

// remove lock
await new Promise((res) => {
await new Promise<void>((res) => {
LockFile.unlock(lockfile, (err) => {
log(
err
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-memory-server-core/src/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function killProcess(childprocess: ChildProcess, name: string): Pro
}

const timeoutTime = 1000 * 10;
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
let timeout = setTimeout(() => {
log('killProcess timeout triggered, trying SIGKILL');

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9843,10 +9843,10 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@4.0.5:
version "4.0.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.5.tgz#ae9dddfd1069f1cb5beb3ef3b2170dd7c1332389"
integrity sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==
typescript@4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7"
integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==

uglify-js@^3.1.4:
version "3.11.4"
Expand Down

0 comments on commit 30ea057

Please sign in to comment.