@siteimprove/alfa-dom
Advanced tools
Comparing version 0.93.2 to 0.93.6
# @siteimprove/alfa-dom | ||
## 0.93.6 | ||
## 0.93.5 | ||
## 0.93.4 | ||
## 0.93.3 | ||
### Patch Changes | ||
- **Changed:** `Node.from` and `Page.from` are now cached. ([#1703](https://github.com/Siteimprove/alfa/pull/1703)) | ||
This makes multiple de-serialisation inexpensive as long as the JSON object is not discarded, thus simplifying logic for callers. | ||
## 0.93.2 | ||
@@ -4,0 +18,0 @@ |
@@ -0,1 +1,2 @@ | ||
import { Cache } from "@siteimprove/alfa-cache"; | ||
import { Comparable, Comparison, } from "@siteimprove/alfa-comparable"; | ||
@@ -268,4 +269,10 @@ import { Flags } from "@siteimprove/alfa-flags"; | ||
Node.composedNested = Traversal.of(Traversal.composed, Traversal.nested); | ||
const cacheWithDevice = Cache.empty(); | ||
const cacheWithoutDevice = Cache.empty(); | ||
function from(json, device) { | ||
return fromNode(json, device).run(); | ||
return device === undefined | ||
? cacheWithoutDevice.get(json, () => fromNode(json, device).run()) | ||
: cacheWithDevice | ||
.get(json, Cache.empty) | ||
.get(device, () => fromNode(json, device).run()); | ||
} | ||
@@ -272,0 +279,0 @@ Node.from = from; |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://alfa.siteimprove.com", | ||
"version": "0.93.2", | ||
"version": "0.93.6", | ||
"license": "MIT", | ||
@@ -37,28 +37,28 @@ "description": "Implementations of the core DOM and CSSOM node types", | ||
"dependencies": { | ||
"@siteimprove/alfa-array": "^0.93.2", | ||
"@siteimprove/alfa-cache": "^0.93.2", | ||
"@siteimprove/alfa-comparable": "^0.93.2", | ||
"@siteimprove/alfa-css": "^0.93.2", | ||
"@siteimprove/alfa-css-feature": "^0.93.2", | ||
"@siteimprove/alfa-device": "^0.93.2", | ||
"@siteimprove/alfa-earl": "^0.93.2", | ||
"@siteimprove/alfa-equatable": "^0.93.2", | ||
"@siteimprove/alfa-flags": "^0.93.2", | ||
"@siteimprove/alfa-iterable": "^0.93.2", | ||
"@siteimprove/alfa-json": "^0.93.2", | ||
"@siteimprove/alfa-lazy": "^0.93.2", | ||
"@siteimprove/alfa-map": "^0.93.2", | ||
"@siteimprove/alfa-option": "^0.93.2", | ||
"@siteimprove/alfa-predicate": "^0.93.2", | ||
"@siteimprove/alfa-rectangle": "^0.93.2", | ||
"@siteimprove/alfa-refinement": "^0.93.2", | ||
"@siteimprove/alfa-sarif": "^0.93.2", | ||
"@siteimprove/alfa-selective": "^0.93.2", | ||
"@siteimprove/alfa-sequence": "^0.93.2", | ||
"@siteimprove/alfa-string": "^0.93.2", | ||
"@siteimprove/alfa-trampoline": "^0.93.2", | ||
"@siteimprove/alfa-tree": "^0.93.2" | ||
"@siteimprove/alfa-array": "^0.93.6", | ||
"@siteimprove/alfa-cache": "^0.93.6", | ||
"@siteimprove/alfa-comparable": "^0.93.6", | ||
"@siteimprove/alfa-css": "^0.93.6", | ||
"@siteimprove/alfa-css-feature": "^0.93.6", | ||
"@siteimprove/alfa-device": "^0.93.6", | ||
"@siteimprove/alfa-earl": "^0.93.6", | ||
"@siteimprove/alfa-equatable": "^0.93.6", | ||
"@siteimprove/alfa-flags": "^0.93.6", | ||
"@siteimprove/alfa-iterable": "^0.93.6", | ||
"@siteimprove/alfa-json": "^0.93.6", | ||
"@siteimprove/alfa-lazy": "^0.93.6", | ||
"@siteimprove/alfa-map": "^0.93.6", | ||
"@siteimprove/alfa-option": "^0.93.6", | ||
"@siteimprove/alfa-predicate": "^0.93.6", | ||
"@siteimprove/alfa-rectangle": "^0.93.6", | ||
"@siteimprove/alfa-refinement": "^0.93.6", | ||
"@siteimprove/alfa-sarif": "^0.93.6", | ||
"@siteimprove/alfa-selective": "^0.93.6", | ||
"@siteimprove/alfa-sequence": "^0.93.6", | ||
"@siteimprove/alfa-string": "^0.93.6", | ||
"@siteimprove/alfa-trampoline": "^0.93.6", | ||
"@siteimprove/alfa-tree": "^0.93.6" | ||
}, | ||
"devDependencies": { | ||
"@siteimprove/alfa-test": "^0.93.2", | ||
"@siteimprove/alfa-test": "^0.93.6", | ||
"@types/jsdom": "^21.1.6", | ||
@@ -65,0 +65,0 @@ "jsdom": "^25.0.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
228418
5896