CARVIEW |
Select Language
HTTP/2 301
location: https://raw.githubusercontent.com/twolfson/computedStyle/master/dist/computedStyle.commonjs.js
accept-ranges: bytes
age: 0
date: Mon, 21 Jul 2025 11:24:26 GMT
via: 1.1 varnish
x-served-by: cache-bom4730-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753097066.739104,VS0,VE1245
vary: Accept-Encoding
x-fastly-request-id: d63b833e31d2dacc0302352bfd18cb02022e8691
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: A7DA:5B873:3E29E5:978763:687E236A
content-encoding: gzip
accept-ranges: bytes
date: Mon, 21 Jul 2025 11:24:27 GMT
via: 1.1 varnish
x-served-by: cache-bom4733-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753097067.034364,VS0,VE339
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: 3a749bdb649d7909ae8467bb0385f78ea2f0f0d7
expires: Mon, 21 Jul 2025 11:29:27 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;