CARVIEW |
Select Language
HTTP/2 301
location: https://raw.githubusercontent.com/twolfson/computedStyle/master/dist/computedStyle.commonjs.js
accept-ranges: bytes
age: 0
date: Tue, 22 Jul 2025 05:51:17 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210050-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753163477.383361,VS0,VE231
vary: Accept-Encoding
x-fastly-request-id: 85efbf8baeede9a72b47f9272b43bb54c800cfc6
content-length: 0
HTTP/2 200
cache-control: max-age=300
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
content-type: text/plain; charset=utf-8
etag: W/"7ec5a1e9d6323013ab230b4579742442b014b5e1dff9092c7809adfe09ad5cc1"
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-request-id: 3B41:3C5854:18936:2A674:687F26D4
content-encoding: gzip
accept-ranges: bytes
date: Tue, 22 Jul 2025 05:51:17 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210092-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753163478.671649,VS0,VE253
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: 86c2c235d5880c7eb5e7034d95a376839c430a81
expires: Tue, 22 Jul 2025 05:56:17 GMT
source-age: 0
content-length: 470
// DEV: We don't use var but favor parameters since these play nicer with minification
function computedStyle(el, prop, getComputedStyle, style) {
getComputedStyle = window.getComputedStyle;
style =
// If we have getComputedStyle
getComputedStyle ?
// Query it
// TODO: From CSS-Query notes, we might need (node, null) for FF
getComputedStyle(el) :
// Otherwise, we are in IE and use currentStyle
el.currentStyle;
if (style) {
return style
[
// Switch to camelCase for CSSOM
// DEV: Grabbed from jQuery
// https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194
// https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597
prop.replace(/-(\w)/gi, function (word, letter) {
return letter.toUpperCase();
})
];
}
}
module.exports = computedStyle;