@lighthouse/common
Advanced tools
Comparing version 4.24.3-canary.112.1422 to 4.24.3-canary.113.1429
@@ -0,1 +1,13 @@ | ||
# 4.24.2 (Mon Jan 23 2023) | ||
#### 🐛 Bug Fix | ||
- Phrasing fix [#112](https://github.com/Lighthouse-io/common/pull/112) ([@ChrisHurt](https://github.com/ChrisHurt)) | ||
#### Authors: 1 | ||
- Chris Hurt ([@ChrisHurt](https://github.com/ChrisHurt)) | ||
--- | ||
# 4.23.1 (Mon Jan 23 2023) | ||
@@ -2,0 +14,0 @@ |
@@ -10,2 +10,20 @@ "use strict"; | ||
const generateColumnsWithImage = ({ | ||
datetime, | ||
image | ||
}) => ({ | ||
columns: [{ | ||
fit: [130, 30], | ||
image, | ||
margin: [60, 60, 60, 0] | ||
}, { | ||
alignment: 'right', | ||
color: '#999', | ||
font: 'Gotham', | ||
fontSize: 11, | ||
text: datetime, | ||
margin: [60, 70, 60, 0] | ||
}] | ||
}); | ||
function defaultHeader({ | ||
@@ -22,16 +40,12 @@ logoUrl, | ||
}); | ||
return (0, _helpers.fetchImage)(logoUrl).then(image => ({ | ||
columns: [{ | ||
fit: [130, 30], | ||
image, | ||
margin: [60, 60, 60, 0] | ||
}, { | ||
alignment: 'right', | ||
color: '#999', | ||
font: 'Gotham', | ||
fontSize: 11, | ||
text: datetime, | ||
margin: [60, 70, 60, 0] | ||
}] | ||
})); | ||
return (0, _helpers.fetchImage)(logoUrl).then(image => generateColumnsWithImage({ | ||
datetime, | ||
image | ||
})).catch(error => { | ||
console.error(`GenerateDefinitionError: Invalid Image URL: ${logoUrl}`, error); | ||
return (0, _helpers.fetchImage)().then(image => generateColumnsWithImage({ | ||
datetime, | ||
image | ||
})); | ||
}); | ||
} |
import { fetchImage, getTimezoneDatetime } from '../../../helpers'; | ||
export function defaultHeader(_ref) { | ||
var logoUrl = _ref.logoUrl, | ||
timestamp = _ref.timestamp, | ||
timezone = _ref.timezone; | ||
var generateColumnsWithImage = function generateColumnsWithImage(_ref) { | ||
var datetime = _ref.datetime, | ||
image = _ref.image; | ||
return { | ||
columns: [{ | ||
fit: [130, 30], | ||
image: image, | ||
margin: [60, 60, 60, 0] | ||
}, { | ||
alignment: 'right', | ||
color: '#999', | ||
font: 'Gotham', | ||
fontSize: 11, | ||
text: datetime, | ||
margin: [60, 70, 60, 0] | ||
}] | ||
}; | ||
}; | ||
export function defaultHeader(_ref2) { | ||
var logoUrl = _ref2.logoUrl, | ||
timestamp = _ref2.timestamp, | ||
timezone = _ref2.timezone; | ||
var datetime = getTimezoneDatetime({ | ||
@@ -13,18 +33,16 @@ format: 'ddd, Do MMM YYYY', | ||
return fetchImage(logoUrl).then(function (image) { | ||
return { | ||
columns: [{ | ||
fit: [130, 30], | ||
image: image, | ||
margin: [60, 60, 60, 0] | ||
}, { | ||
alignment: 'right', | ||
color: '#999', | ||
font: 'Gotham', | ||
fontSize: 11, | ||
text: datetime, | ||
margin: [60, 70, 60, 0] | ||
}] | ||
}; | ||
return generateColumnsWithImage({ | ||
datetime: datetime, | ||
image: image | ||
}); | ||
}).catch(function (error) { | ||
console.error("GenerateDefinitionError: Invalid Image URL: ".concat(logoUrl), error); | ||
return fetchImage().then(function (image) { | ||
return generateColumnsWithImage({ | ||
datetime: datetime, | ||
image: image | ||
}); | ||
}); | ||
}); | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@lighthouse/common", | ||
"version": "4.24.3-canary.112.1422", | ||
"version": "4.24.3-canary.113.1429", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
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
1238809
11929