diff --git a/README.md b/README.md index 724b3ba..16cc393 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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) diff --git a/lib/index.js b/lib/index.js index d38e8d5..0229347 100644 --- a/lib/index.js +++ b/lib/index.js @@ -167,7 +167,7 @@ exports.any = value => { return value; }; -exports.void = () => { +exports.undefined = () => { return undefined; }; diff --git a/test/void.js b/test/undefined.js similarity index 86% rename from test/void.js rename to test/undefined.js index 07a1f55..61ec398 100644 --- a/test/void.js +++ b/test/undefined.js @@ -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);