Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: primus/eventemitter3
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b73f1902ae9564b70c960e363a904118804f8392
Choose a base ref
...
head repository: primus/eventemitter3
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 00ac01a329b7f2fb29058b6a3aff6850ac304f12
Choose a head ref
  • 11 commits
  • 3 files changed
  • 4 contributors

Commits on May 23, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dad7757 View commit details

Commits on Jun 1, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    03abd28 View commit details

Commits on Jun 14, 2020

  1. Copy the full SHA
    734637a View commit details
  2. Copy the full SHA
    9a46cfd View commit details
  3. [test] Do not test on all available versions of Edge and Safari

    Use only the oldest and latest version.
    lpinca committed Jun 14, 2020
    Copy the full SHA
    aa8d192 View commit details

Commits on Aug 22, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e92b667 View commit details
  2. [dist] 4.0.5

    lpinca committed Aug 22, 2020
    Copy the full SHA
    47251a0 View commit details

Commits on Aug 25, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b17a2f1 View commit details
  2. [dist] 4.0.6

    lpinca committed Aug 25, 2020
    Copy the full SHA
    38de307 View commit details

Commits on Aug 27, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8f8a7e0 View commit details
  2. [dist] 4.0.7

    lpinca committed Aug 27, 2020
    Copy the full SHA
    00ac01a View commit details
Showing with 24 additions and 16 deletions.
  1. +13 −5 index.d.ts
  2. +9 −9 package.json
  3. +2 −2 test/browser.js
18 changes: 13 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -91,10 +91,16 @@ declare namespace EventEmitter {
>(): EventEmitter<EventTypes, Context>;
}

export type ValidEventTypes =
| string
| symbol
| { [K in string | symbol]: any[] | ((...args: any[]) => void) };
/**
* `object` should be in either of the following forms:
* ```
* interface EventTypes {
* 'event-with-parameters': any[]
* 'event-with-example-handler': (...args: any[]) => void
* }
* ```
*/
export type ValidEventTypes = string | symbol | object;

export type EventNames<T extends ValidEventTypes> = T extends string | symbol
? T
@@ -113,7 +119,9 @@ declare namespace EventEmitter {
K extends EventNames<T>
> = T extends string | symbol
? (...args: any[]) => void
: (...args: ArgumentMap<Exclude<T, string | symbol>>[K]) => void;
: (
...args: ArgumentMap<Exclude<T, string | symbol>>[Extract<K, keyof T>]
) => void;

export type EventArgs<
T extends ValidEventTypes,
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eventemitter3",
"version": "4.0.4",
"version": "4.0.7",
"description": "EventEmitter3 focuses on performance while maintaining a Node.js AND browser compatible interface.",
"main": "index.js",
"typings": "index.d.ts",
@@ -44,13 +44,13 @@
"url": "https://github.com/primus/eventemitter3/issues"
},
"devDependencies": {
"assume": "~2.2.0",
"browserify": "~16.5.0",
"mocha": "~7.1.0",
"nyc": "~15.0.0",
"pre-commit": "~1.2.0",
"sauce-browsers": "~2.0.0",
"sauce-test": "~1.3.3",
"uglify-js": "~3.9.0"
"assume": "^2.2.0",
"browserify": "^16.5.0",
"mocha": "^8.0.1",
"nyc": "^15.1.0",
"pre-commit": "^1.2.0",
"sauce-browsers": "^2.0.0",
"sauce-test": "^1.3.3",
"uglify-js": "^3.9.0"
}
}
4 changes: 2 additions & 2 deletions test/browser.js
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@ const platforms = sauceBrowsers([
{ name: 'firefox', version: ['oldest', 'latest'] },
{ name: 'internet explorer', version: 'oldest..latest' },
{ name: 'iphone', version: ['oldest', 'latest'] },
{ name: 'safari', version: 'oldest..latest' },
{ name: 'microsoftedge', version: 'oldest..latest' }
{ name: 'safari', version: ['oldest', 'latest'] },
{ name: 'microsoftedge', version: ['oldest', 'latest'] }
]).then((platforms) => {
return platforms.map((platform) => {
const ret = {