Skip to content

Commit

Permalink
Rename "void" to "undefined"
Browse files Browse the repository at this point in the history
Follows Web IDL spec updates.
  • Loading branch information
domenic authored Sep 12, 2021
1 parent 0449cdd commit cb1bfe6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function doStuff(x, y) {
and your function `doStuff` will behave the same as a Web IDL operation declared as

```webidl
void doStuff(boolean x, unsigned long y);
undefined doStuff(boolean x, unsigned long y);
```

## API
Expand Down Expand Up @@ -48,7 +48,7 @@ Specific conversions may also accept other options, the details of which can be
Conversions for all of the basic types from the Web IDL specification are implemented:

- [`any`](https://heycam.github.io/webidl/#es-any)
- [`void`](https://heycam.github.io/webidl/#es-void)
- [`undefined`](https://heycam.github.io/webidl/#es-undefined)
- [`boolean`](https://heycam.github.io/webidl/#es-boolean)
- [Integer types](https://heycam.github.io/webidl/#es-integer-types), which can additionally be provided the boolean options `{ clamp, enforceRange }` as a second parameter
- [`float`](https://heycam.github.io/webidl/#es-float), [`unrestricted float`](https://heycam.github.io/webidl/#es-unrestricted-float)
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ exports.any = value => {
return value;
};

exports.void = () => {
exports.undefined = () => {
return undefined;
};

Expand Down
4 changes: 2 additions & 2 deletions test/void.js → test/undefined.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const assert = require("assert");

const conversions = require("..");

describe("WebIDL void type", () => {
const sut = conversions.void;
describe("WebIDL undefined type", () => {
const sut = conversions.undefined;

it("should return `undefined` for everything", () => {
assert.strictEqual(sut(undefined), undefined);
Expand Down

0 comments on commit cb1bfe6

Please sign in to comment.