Socket
Socket
Sign inDemoInstall

jsdom

Package Overview
Dependencies
Maintainers
6
Versions
263
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdom - npm Package Compare versions

Comparing version 22.1.0 to 23.0.1

lib/jsdom/living/generated/DOMException.js

10

lib/jsdom/browser/js-globals.json

@@ -142,2 +142,7 @@ {

},
"Atomics": {
"writable": true,
"enumerable": false,
"configurable": true
},
"Uint8Array": {

@@ -298,7 +303,2 @@ "writable": true,

},
"Atomics": {
"writable": true,
"enumerable": false,
"configurable": true
},
"WebAssembly": {

@@ -305,0 +305,0 @@ "writable": true,

"use strict";
const { SaxesParser } = require("saxes");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../../living/generated/DOMException");

@@ -6,0 +6,0 @@ const { createElement } = require("../../living/helpers/create-element");

@@ -17,4 +17,3 @@ "use strict";

const postMessage = require("../living/post-message");
const DOMException = require("domexception/webidl2js-wrapper");
const { btoa, atob } = require("abab");
const DOMException = require("../living/generated/DOMException");
const idlUtils = require("../living/generated/utils");

@@ -761,4 +760,6 @@ const WebSocketImpl = require("../living/websockets/WebSocket-impl").implementation;

this.atob = function (str) {
const result = atob(str);
if (result === null) {
try {
return atob(str);
} catch (e) {
// Convert Node.js DOMException to one from our global.
throw DOMException.create(window, [

@@ -769,8 +770,9 @@ "The string to be decoded contains invalid characters.",

}
return result;
};
this.btoa = function (str) {
const result = btoa(str);
if (result === null) {
try {
return btoa(str);
} catch (e) {
// Convert Node.js DOMException to one from our global.
throw DOMException.create(window, [

@@ -781,3 +783,2 @@ "The string to be encoded contains invalid characters.",

}
return result;
};

@@ -784,0 +785,0 @@

@@ -7,3 +7,3 @@ "use strict";

const AbortSignal = require("../generated/AbortSignal");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -10,0 +10,0 @@ class AbortSignalImpl extends EventTargetImpl {

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("./generated/DOMException");

@@ -4,0 +4,0 @@ const { HTML_NS } = require("./helpers/namespaces");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const idlUtils = require("../generated/utils.js");

@@ -5,0 +5,0 @@ const attributes = require("../attributes.js");

"use strict";
const nodeCrypto = require("crypto");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -6,0 +6,0 @@ // https://w3c.github.io/webcrypto/#crypto-interface

"use strict";
const webIDLConversions = require("webidl-conversions");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -6,0 +6,0 @@ const NODE_TYPE = require("../node-type");

@@ -5,3 +5,3 @@ "use strict";

const parse5 = require("parse5");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -8,0 +8,0 @@ const utils = require("../generated/utils");

"use strict";
const serialize = require("w3c-xmlserializer");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const utils = require("../generated/utils");

@@ -5,0 +5,0 @@

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -4,0 +4,0 @@ const reportException = require("../helpers/runtime-script-errors");

@@ -5,3 +5,3 @@ "use strict";

const MIMEType = require("whatwg-mimetype");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const EventTargetImpl = require("../events/EventTarget-impl").implementation;

@@ -8,0 +8,0 @@ const ProgressEvent = require("../generated/ProgressEvent");

"use strict";
const http = require("http");
const https = require("https");
const { parse: parseURLToNodeOptions } = require("url");
const HttpProxyAgent = require("http-proxy-agent");
const HttpsProxyAgent = require("https-proxy-agent");
const { HttpProxyAgent } = require("http-proxy-agent");
const { HttpsProxyAgent } = require("https-proxy-agent");

@@ -11,6 +10,5 @@ module.exports = function agentFactory(proxy, rejectUnauthorized) {

if (proxy) {
const proxyOpts = { ...parseURLToNodeOptions(proxy), ...agentOpts };
return { https: new HttpsProxyAgent(proxyOpts), http: new HttpProxyAgent(proxyOpts) };
return { https: new HttpsProxyAgent(proxy, agentOpts), http: new HttpProxyAgent(proxy, agentOpts) };
}
return { http: new http.Agent(agentOpts), https: new https.Agent(agentOpts) };
};
"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -5,0 +5,0 @@ const interfaces = require("../interfaces");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const isPotentialCustomElementName = require("is-potential-custom-element-name");

@@ -5,0 +5,0 @@

"use strict";
const xnv = require("xml-name-validator");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const { XML_NS, XMLNS_NS } = require("../helpers/namespaces");

@@ -5,0 +5,0 @@

@@ -12,3 +12,3 @@ /* eslint-disable global-require */

const generatedInterfaces = {
DOMException: require("domexception/webidl2js-wrapper"),
DOMException: require("./generated/DOMException.js"),

@@ -218,2 +218,5 @@ URL: require("whatwg-url/webidl2js-wrapper").URL,

// https://webidl.spec.whatwg.org/#es-DOMException-specialness
Object.setPrototypeOf(window.DOMException.prototype, window.Error.prototype);
// These need to be cleaned up...

@@ -220,0 +223,0 @@ style.addToCore(window);

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -5,0 +5,0 @@ const { mixin } = require("../../utils");

@@ -18,3 +18,3 @@ "use strict";

const { HTML_NS, SVG_NS } = require("../helpers/namespaces");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const { parseIntoDocument } = require("../../browser/parser");

@@ -21,0 +21,0 @@ const History = require("../generated/History");

@@ -6,3 +6,3 @@ "use strict";

const validateName = require("../helpers/validate-names").name;
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -9,0 +9,0 @@ const dataAttrRe = /^data-([^A-Z]*)$/;

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const OrderedSet = require("../helpers/ordered-set.js");

@@ -5,0 +5,0 @@ const { asciiLowercase } = require("../helpers/strings.js");

@@ -16,3 +16,3 @@ "use strict";

const { domSymbolTree } = require("../helpers/internal-constants");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const DOMTokenList = require("../generated/DOMTokenList");

@@ -19,0 +19,0 @@ const NamedNodeMap = require("../generated/NamedNodeMap");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const { serializeURL } = require("whatwg-url");

@@ -5,0 +5,0 @@ const HTMLElementImpl = require("./HTMLElement-impl").implementation;

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const FileList = require("../generated/FileList");

@@ -4,0 +4,0 @@ const Decimal = require("decimal.js");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const HTMLElementImpl = require("./HTMLElement-impl").implementation;

@@ -4,0 +4,0 @@ const notImplemented = require("../../browser/not-implemented");

"use strict";
const idlUtils = require("../generated/utils.js");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const { DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_CONTAINED_BY } = require("../node-document-position");

@@ -6,0 +6,0 @@ const Element = require("../generated/Element");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const HTMLElementImpl = require("./HTMLElement-impl").implementation;

@@ -4,0 +4,0 @@ const { HTML_NS } = require("../helpers/namespaces");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const HTMLElementImpl = require("./HTMLElement-impl").implementation;

@@ -5,0 +5,0 @@ const HTMLCollection = require("../generated/HTMLCollection");

@@ -6,3 +6,3 @@ "use strict";

const HTMLCollection = require("../generated/HTMLCollection");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -9,0 +9,0 @@ class HTMLTableSectionElementImpl extends HTMLElementImpl {

@@ -10,3 +10,3 @@ "use strict";

const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const { cloningSteps } = require("../helpers/internal-constants");

@@ -13,0 +13,0 @@ const { isDisabled, getLabelsForLabelable, formOwner } = require("../helpers/form-controls");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -5,0 +5,0 @@ const EventTargetImpl = require("../events/EventTarget-impl").implementation;

@@ -6,3 +6,3 @@ "use strict";

const { domSymbolTree } = require("../helpers/internal-constants");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const NODE_TYPE = require("../node-type");

@@ -9,0 +9,0 @@ const { mixin } = require("../../utils");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("./generated/DOMException");
const MessageEvent = require("./generated/MessageEvent");

@@ -4,0 +4,0 @@ const idlUtils = require("./generated/utils");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -5,0 +5,0 @@ const { clone } = require("../node");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -5,0 +5,0 @@ const NODE_TYPE = require("../node-type");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -5,0 +5,0 @@ const NODE_TYPE = require("../node-type");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const idlUtils = require("../generated/utils");

@@ -5,0 +5,0 @@ const { attach, detach } = require("../helpers/svg/basic-types");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -5,0 +5,0 @@ class SVGNumberImpl {

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const conversions = require("webidl-conversions");

@@ -4,0 +4,0 @@

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const { filter, FILTER_ACCEPT, FILTER_REJECT, FILTER_SKIP } = require("./helpers");

@@ -5,0 +5,0 @@

@@ -5,3 +5,3 @@ "use strict";

const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const { parseURL, serializeURL, serializeURLOrigin } = require("whatwg-url");

@@ -8,0 +8,0 @@ const WebSocket = require("ws");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const StorageEvent = require("../generated/StorageEvent");

@@ -5,0 +5,0 @@ const idlUtils = require("../generated/utils");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const { documentBaseURLSerialized, parseURLToResultingURLRecord } = require("../helpers/document-base-url.js");

@@ -4,0 +4,0 @@

"use strict";
const whatwgURL = require("whatwg-url");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const { documentBaseURL, parseURLToResultingURLRecord } = require("../helpers/document-base-url");

@@ -5,0 +5,0 @@ const { navigate } = require("./navigation");

"use strict";
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const idlUtils = require("../generated/utils");

@@ -4,0 +4,0 @@ const { closest } = require("../helpers/traversal");

@@ -6,3 +6,3 @@ "use strict";

const parseDataURL = require("data-urls");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");

@@ -9,0 +9,0 @@ const ProgressEvent = require("../generated/ProgressEvent");

@@ -11,3 +11,3 @@ "use strict";

const xhrUtils = require("./xhr-utils");
const DOMException = require("domexception/webidl2js-wrapper");
const DOMException = require("../generated/DOMException");
const { documentBaseURLSerialized } = require("../helpers/document-base-url");

@@ -14,0 +14,0 @@ const { asciiCaseInsensitiveMatch } = require("../helpers/strings");

"use strict";
const path = require("path");
const whatwgURL = require("whatwg-url");

@@ -7,15 +6,2 @@ const { domSymbolTree } = require("./living/helpers/internal-constants");

exports.toFileUrl = function (fileName) {
// Beyond just the `path.resolve`, this is mostly for the benefit of Windows,
// where we need to convert "\" to "/" and add an extra "/" prefix before the
// drive letter.
let pathname = path.resolve(process.cwd(), fileName).replace(/\\/g, "/");
if (pathname[0] !== "/") {
pathname = "/" + pathname;
}
// path might contain spaces, so convert those to %20
return "file://" + encodeURI(pathname);
};
/**

@@ -35,25 +21,2 @@ * Define a set of properties on an object, by copying the property descriptors

/**
* Define a list of constants on a constructor and its .prototype
*
* - `Constructor` {Function} the constructor to define the constants on
* - `propertyMap` {Object} key/value map of properties to define
*/
exports.addConstants = function addConstants(Constructor, propertyMap) {
for (const property in propertyMap) {
const value = propertyMap[property];
addConstant(Constructor, property, value);
addConstant(Constructor.prototype, property, value);
}
};
function addConstant(object, property, value) {
Object.defineProperty(object, property, {
configurable: false,
enumerable: true,
writable: false,
value
});
}
exports.mixin = (target, source) => {

@@ -60,0 +23,0 @@ const keys = Reflect.ownKeys(source);

{
"name": "jsdom",
"version": "22.1.0",
"version": "23.0.1",
"description": "A JavaScript implementation of many web standards",

@@ -23,13 +23,11 @@ "keywords": [

"dependencies": {
"abab": "^2.0.6",
"cssstyle": "^3.0.0",
"data-urls": "^4.0.0",
"data-urls": "^5.0.0",
"decimal.js": "^10.4.3",
"domexception": "^4.0.0",
"form-data": "^4.0.0",
"html-encoding-sniffer": "^3.0.0",
"http-proxy-agent": "^5.0.0",
"https-proxy-agent": "^5.0.1",
"html-encoding-sniffer": "^4.0.0",
"http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.2",
"is-potential-custom-element-name": "^1.0.1",
"nwsapi": "^2.2.4",
"nwsapi": "^2.2.7",
"parse5": "^7.1.2",

@@ -39,13 +37,13 @@ "rrweb-cssom": "^0.6.0",

"symbol-tree": "^3.2.4",
"tough-cookie": "^4.1.2",
"w3c-xmlserializer": "^4.0.0",
"tough-cookie": "^4.1.3",
"w3c-xmlserializer": "^5.0.0",
"webidl-conversions": "^7.0.0",
"whatwg-encoding": "^2.0.0",
"whatwg-mimetype": "^3.0.0",
"whatwg-url": "^12.0.1",
"ws": "^8.13.0",
"xml-name-validator": "^4.0.0"
"whatwg-encoding": "^3.1.1",
"whatwg-mimetype": "^4.0.0",
"whatwg-url": "^14.0.0",
"ws": "^8.14.2",
"xml-name-validator": "^5.0.0"
},
"peerDependencies": {
"canvas": "^2.5.0"
"canvas": "^2.11.2"
},

@@ -60,8 +58,8 @@ "peerDependenciesMeta": {

"benchmark": "^2.1.4",
"chai": "^4.3.7",
"eslint": "^8.39.0",
"chai": "^4.3.10",
"eslint": "^8.54.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-jsdom-internal": "link:./scripts/eslint-plugin",
"eslint-plugin-jsdom-internal": "file:./scripts/eslint-plugin",
"js-yaml": "^4.1.0",
"minimatch": "^9.0.0",
"minimatch": "^9.0.3",
"mocha": "^10.2.0",

@@ -75,4 +73,4 @@ "mocha-sugar-free": "^1.4.0",

"scripts": {
"prepare": "yarn convert-idl && yarn generate-js-globals",
"pretest": "yarn prepare && yarn init-wpt",
"prepare": "npm run convert-idl && npm run generate-js-globals",
"pretest": "npm run prepare && npm run init-wpt",
"test-wpt": "mocha test/web-platform-tests/run-wpts.js",

@@ -85,3 +83,3 @@ "test-tuwpt": "mocha test/web-platform-tests/run-tuwpts.js",

"init-wpt": "git submodule update --init --recursive",
"reset-wpt": "rm -rf ./test/web-platform-tests/tests && yarn init-wpt",
"reset-wpt": "rm -rf ./test/web-platform-tests/tests && npm run init-wpt",
"update-wpt": "git submodule update --recursive --remote && cd test/web-platform-tests/tests && python3 wpt.py manifest --path ../wpt-manifest.json",

@@ -95,4 +93,4 @@ "update-authors": "git log --format=\"%aN <%aE>\" | sort -f | uniq > AUTHORS.txt",

"engines": {
"node": ">=16"
"node": ">=18"
}
}

@@ -8,3 +8,3 @@ <h1 align="center">

The latest versions of jsdom require Node.js v16 or newer. (Versions of jsdom below v22 still work with previous Node.js versions, but are unsupported.)
The latest versions of jsdom require Node.js v18 or newer. (Versions of jsdom below v23 still work with previous Node.js versions, but are unsupported.)

@@ -505,3 +505,3 @@ ## Basic usage

- [Getting professional support for jsdom](https://tidelift.com/subscription/pkg/npm-jsdom?utm_source=npm-jsdom&utm_medium=referral&utm_campaign=readme) as part of a Tidelift subscription. Tidelift helps making open source sustainable for us while giving teams assurances for maintenance, licensing, and security.
- [Contributing](https://github.com/jsdom/jsdom/blob/master/Contributing.md) directly to the project.
- [Contributing](https://github.com/jsdom/jsdom/blob/main/Contributing.md) directly to the project.

@@ -508,0 +508,0 @@ ## Getting help

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc