Skip to content

Commit

Permalink
slightly better typings and test correction
Browse files Browse the repository at this point in the history
  • Loading branch information
swittk committed Oct 30, 2023
1 parent 4604451 commit 606061f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/escape-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
jest.autoMockOff();

const escape = require('../escape.js').default;
const escape = require('../escape').default;

describe('escape', () => {
it('escapes special HTML characters', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/promiseUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export function resolvingPromise<T = any>() {
return ret;
}

export function when(promises: Promise<any> | Promise<any>[]) {
export function when(promises: Promise<any> | (Promise<any>[]), ...others: Promise<any>[]) {
let objects: Promise<any>[];
const arrayArgument = Array.isArray(promises);
if (arrayArgument) {
objects = promises;
} else {
objects = [promises];
objects = arguments as any as Promise<any>[];
}

let total = objects.length;
Expand Down

0 comments on commit 606061f

Please sign in to comment.