fix(screenshotter) validateScreeshotOptions typo (#1509)

There is a type in the function name
This commit is contained in:
Darío Kondratiuk 2020-03-24 13:08:53 -03:00 committed by GitHub
parent 4f89e4031c
commit 8d5433c8e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,7 @@ export class Screenshotter {
} }
async screenshotPage(options: types.ScreenshotOptions = {}): Promise<platform.BufferType> { async screenshotPage(options: types.ScreenshotOptions = {}): Promise<platform.BufferType> {
const format = validateScreeshotOptions(options); const format = validateScreenshotOptions(options);
return this._queue.postTask(async () => { return this._queue.postTask(async () => {
const { viewportSize, originalViewportSize } = await this._originalViewportSize(); const { viewportSize, originalViewportSize } = await this._originalViewportSize();
@ -103,7 +103,7 @@ export class Screenshotter {
} }
async screenshotElement(handle: dom.ElementHandle, options: types.ElementScreenshotOptions = {}): Promise<platform.BufferType> { async screenshotElement(handle: dom.ElementHandle, options: types.ElementScreenshotOptions = {}): Promise<platform.BufferType> {
const format = validateScreeshotOptions(options); const format = validateScreenshotOptions(options);
return this._queue.postTask(async () => { return this._queue.postTask(async () => {
const { viewportSize, originalViewportSize } = await this._originalViewportSize(); const { viewportSize, originalViewportSize } = await this._originalViewportSize();
@ -188,7 +188,7 @@ function trimClipToSize(clip: types.Rect, size: types.Size): types.Rect {
return result; return result;
} }
function validateScreeshotOptions(options: types.ScreenshotOptions): 'png' | 'jpeg' { function validateScreenshotOptions(options: types.ScreenshotOptions): 'png' | 'jpeg' {
let format: 'png' | 'jpeg' | null = null; let format: 'png' | 'jpeg' | null = null;
// options.type takes precedence over inferring the type from options.path // options.type takes precedence over inferring the type from options.path
// because it may be a 0-length file with no extension created beforehand (i.e. as a temp file). // because it may be a 0-length file with no extension created beforehand (i.e. as a temp file).