108 lines
11 KiB
JSON
108 lines
11 KiB
JSON
|
{
|
||
|
"_args": [
|
||
|
[
|
||
|
{
|
||
|
"raw": "webidl-conversions@^4.0.2",
|
||
|
"scope": null,
|
||
|
"escapedName": "webidl-conversions",
|
||
|
"name": "webidl-conversions",
|
||
|
"rawSpec": "^4.0.2",
|
||
|
"spec": ">=4.0.2 <5.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/jsdom"
|
||
|
]
|
||
|
],
|
||
|
"_from": "webidl-conversions@>=4.0.2 <5.0.0",
|
||
|
"_id": "webidl-conversions@4.0.2",
|
||
|
"_inCache": true,
|
||
|
"_location": "/webidl-conversions",
|
||
|
"_nodeVersion": "8.3.0",
|
||
|
"_npmOperationalInternal": {
|
||
|
"host": "s3://npm-registry-packages",
|
||
|
"tmp": "tmp/webidl-conversions-4.0.2.tgz_1502681485162_0.9069484581705183"
|
||
|
},
|
||
|
"_npmUser": {
|
||
|
"name": "domenic",
|
||
|
"email": "d@domenic.me"
|
||
|
},
|
||
|
"_npmVersion": "5.3.0",
|
||
|
"_phantomChildren": {},
|
||
|
"_requested": {
|
||
|
"raw": "webidl-conversions@^4.0.2",
|
||
|
"scope": null,
|
||
|
"escapedName": "webidl-conversions",
|
||
|
"name": "webidl-conversions",
|
||
|
"rawSpec": "^4.0.2",
|
||
|
"spec": ">=4.0.2 <5.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"_requiredBy": [
|
||
|
"/domexception",
|
||
|
"/jsdom",
|
||
|
"/whatwg-url"
|
||
|
],
|
||
|
"_resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
|
||
|
"_shasum": "a855980b1f0b6b359ba1d5d9fb39ae941faa63ad",
|
||
|
"_shrinkwrap": null,
|
||
|
"_spec": "webidl-conversions@^4.0.2",
|
||
|
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/jsdom",
|
||
|
"author": {
|
||
|
"name": "Domenic Denicola",
|
||
|
"email": "d@domenic.me",
|
||
|
"url": "https://domenic.me/"
|
||
|
},
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/jsdom/webidl-conversions/issues"
|
||
|
},
|
||
|
"dependencies": {},
|
||
|
"description": "Implements the WebIDL algorithms for converting to and from JavaScript values",
|
||
|
"devDependencies": {
|
||
|
"eslint": "^3.15.0",
|
||
|
"mocha": "^1.21.4",
|
||
|
"nyc": "^10.1.2"
|
||
|
},
|
||
|
"directories": {},
|
||
|
"dist": {
|
||
|
"integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==",
|
||
|
"shasum": "a855980b1f0b6b359ba1d5d9fb39ae941faa63ad",
|
||
|
"tarball": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz"
|
||
|
},
|
||
|
"files": [
|
||
|
"lib/"
|
||
|
],
|
||
|
"gitHead": "074b6ec5371edb7f0275625702eda6aecf1c24af",
|
||
|
"homepage": "https://github.com/jsdom/webidl-conversions#readme",
|
||
|
"keywords": [
|
||
|
"webidl",
|
||
|
"web",
|
||
|
"types"
|
||
|
],
|
||
|
"license": "BSD-2-Clause",
|
||
|
"main": "lib/index.js",
|
||
|
"maintainers": [
|
||
|
{
|
||
|
"name": "sebmaster",
|
||
|
"email": "sebmaster16@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "domenic",
|
||
|
"email": "d@domenic.me"
|
||
|
}
|
||
|
],
|
||
|
"name": "webidl-conversions",
|
||
|
"optionalDependencies": {},
|
||
|
"readme": "# Web IDL Type Conversions on JavaScript Values\n\nThis package implements, in JavaScript, the algorithms to convert a given JavaScript value according to a given [Web IDL](http://heycam.github.io/webidl/) [type](http://heycam.github.io/webidl/#idl-types).\n\nThe goal is that you should be able to write code like\n\n```js\n\"use strict\";\nconst conversions = require(\"webidl-conversions\");\n\nfunction doStuff(x, y) {\n x = conversions[\"boolean\"](x);\n y = conversions[\"unsigned long\"](y);\n // actual algorithm code here\n}\n```\n\nand your function `doStuff` will behave the same as a Web IDL operation declared as\n\n```webidl\nvoid doStuff(boolean x, unsigned long y);\n```\n\n## API\n\nThis package's main module's default export is an object with a variety of methods, each corresponding to a different Web IDL type. Each method, when invoked on a JavaScript value, will give back the new JavaScript value that results after passing through the Web IDL conversion rules. (See below for more details on what that means.) Alternately, the method could throw an error, if the Web IDL algorithm is specified to do so: for example `conversions[\"float\"](NaN)` [will throw a `TypeError`](http://heycam.github.io/webidl/#es-float).\n\nEach method also accepts a second, optional, parameter for miscellaneous options. For conversion methods that throw errors, a string option `{ context }` may be provided to provide more information in the error message. (For example, `conversions[\"float\"](NaN, { context: \"Argument 1 of Interface's operation\" })` will throw an error with message `\"Argument 1 of Interface's operation is not a finite floating-point value.\"`) Specific conversions may also accept other options, the details of which can be found below.\n\n## Conversions implemented\n\nConversions for all of the basic types from the Web IDL specification are implemented:\n\n- [`any`](https://heycam.github.io/webidl/#es-any)\n- [`void`](https://heycam.github.io/webidl/#es-void)\n- [`boolean`](https://heycam.github.io/webidl/#es-boolean)\n- [Integer types](https://heycam.github.io/webidl/#es-integer-types), which can additionally be provided the boolean options `{ clamp, enforceRange }` as a second parameter\n- [`float`](https://heycam.github.io/webidl/#es-float), [`unrestricted float`](https://heycam.github.io/webidl/#es-unrestricted-float)\n- [`double`](https://heycam.github.io/webidl/#es-double), [`unrestricted double`](https://heycam.github.io/webidl/#es-unrestricted-double)\n- [`DOMString`](https://heycam.github.io/webidl/#es-DOMString), which can additionally be provided the boolean option `{ treatNullAsEmptyString }` as a second parameter\n- [`ByteString`](https://heycam.github.io/webidl/#es-ByteString), [`USVString`](https://heycam.github.io/webidl/#es-USVString)\n- [`object`](https://heycam.github.io/webidl/#es-object)\n- [`Error`](https://heycam.github.io/webidl/#es-Error)\n- [Buffer source types](https://heycam.github.io/webidl/#es-buffer-source-types)\n\nAdditionally, for convenience, the following derived type definitions are implemented:\n\n- [`ArrayBufferView`](https://heycam.github.io/webidl/#ArrayBufferView)\n- [`BufferSource`](https://heycam.github.io/webidl/#BufferSource)\n- [`DOMTimeStamp`](https://heycam.github.io/webidl/#DOMTimeStamp)\n- [`Function`](https://heycam.github.io/webidl/#Function)\n- [`VoidFunction`](https://heycam.github.io/webidl/#VoidFunction) (although it will not censor the return type)\n\nDerived types, such as nullable types, promise types, sequences, records, etc. are not handled by this library. You may wish to investigate the [webidl2js](https://github.com/jsdom/webidl2js) project.\n\n### A note on the `long long` types\n\nThe `long long` and `unsigned long long` Web IDL types can hold values that cannot be stored in JavaScript numbers, so the conversion is imperfect. For example, converting the JavaScript number `18446744073709552000` to a Web IDL `long long` is supposed to produce the Web IDL value `-18446744073709551232`. Since we are representing our Web IDL values in
|
||
|
"readmeFilename": "README.md",
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "git+https://github.com/jsdom/webidl-conversions.git"
|
||
|
},
|
||
|
"scripts": {
|
||
|
"coverage": "nyc mocha test/*.js",
|
||
|
"lint": "eslint .",
|
||
|
"test": "mocha test/*.js"
|
||
|
},
|
||
|
"version": "4.0.2"
|
||
|
}
|