Options
All
  • Public
  • Public/Protected
  • All
Menu

pagespeed-quest

Index

Type aliases

ContentEncodingType

ContentEncodingType: "gzip" | "compress" | "deflate" | "br" | "identity"

FormFactorType

FormFactorType: "mobile" | "desktop"

HttpHeaders

HttpHeaders: {}

Type declaration

  • [key: string]: string

Variables

Const BasenameMaxLength

BasenameMaxLength: 196 = 196

Const ChunkSize

ChunkSize: number = 1024 * 16

Const ContentEncodingMap

ContentEncodingMap: Map<ContentEncodingType, ContentEncodingPair> = new Map<ContentEncodingType, ContentEncodingPair>()

Const DirectoryIndex

DirectoryIndex: "index.html" = "index.html"

Const HashLength

HashLength: 8 = 8

Const IgnoreParams

IgnoreParams: string = process.env.IGNORE_PARAMS || 'ts'

Const IgnoreParamsRegex

IgnoreParamsRegex: RegExp[] = IgnoreParams.split(/\s*,\s*/).map((p) => new RegExp(`(?<=[?&]${p}=)[^&]*`, 'g'))

Const IndexFile

IndexFile: "index.json" = "index.json"

Const InventoryDir

InventoryDir: "inventory" = "inventory"

Const main

main: Command = new Command()

Const singleton

singleton: Logger<never, boolean> = Pino({transport: {target: 'pino-pretty',options: {levelFirst: true,hideObject: Boolean(!process.env.LOG_OBJECTS),},},level: process.env.LOG_LEVEL || 'info',})

Functions

compress

convertEditableText

  • convertEditableText(content: Buffer, contentTypeMime: string, contentTypeCharset?: string): Promise<Buffer>
  • Parameters

    • content: Buffer
    • contentTypeMime: string
    • Optional contentTypeCharset: string

    Returns Promise<Buffer>

decompress

ensureUtf8String

  • ensureUtf8String(buffer: Buffer, charset: string): string

isCss

  • isCss(mimeType: string): boolean

isHtml

  • isHtml(mimeType: string): boolean

isJs

  • isJs(mimeType: string): boolean

isText

  • isText(mimeType: string): boolean

lighthouseCommands

  • lighthouseCommands(): void

logger

  • logger(): Logger<never, boolean>

normalizeUrl

  • normalizeUrl(url: string | URL): URL
  • Remove IgnoreParams from URL Default: ts (timestamp) assumed different for each request

    Parameters

    • url: string | URL

    Returns URL

parseContentTypeHeader

  • parseContentTypeHeader(contentType: string): { charset: string; mime: string }
  • Parameters

    • contentType: string

    Returns { charset: string; mime: string }

    • charset: string
    • mime: string

playback

  • playback(): Promise<void>

proxyCommands

  • proxyCommands(): void

recording

  • recording(): Promise<void>

requestContentFilePath

  • requestContentFilePath(method: string, url: string | URL): string
  • Convert URL to content file path For example: https://example.com/foo/bar.html?hoge=123 -> example.com/foo/bar~hoge=123.html

    • Add directory index (index.html) if URL ends with slash
    • Shorten too long basename with short hash
    • Ignore dynamic params for example: ts=123

    Parameters

    • method: string
    • url: string | URL

    Returns string

runLighthouse

  • runLighthouse(url: string, port: number): Promise<void>
  • Parameters

    • url: string
    • port: number

    Returns Promise<void>

stringifyContentTypeHeader

  • stringifyContentTypeHeader(mime?: string, charset?: string, original?: string): string
  • Parameters

    • Optional mime: string
    • Optional charset: string
    • Optional original: string

    Returns string

withPlaybackProxy

withProxy

  • withProxy<ProxyType, OptionsType>(cls: {}, fn: (proxy: ProxyType) => Promise<void>, options: OptionsType): Promise<ProxyType | void>
  • Type parameters

    Parameters

    • cls: {}
    • fn: (proxy: ProxyType) => Promise<void>
        • (proxy: ProxyType): Promise<void>
        • Parameters

          • proxy: ProxyType

          Returns Promise<void>

    • options: OptionsType

    Returns Promise<ProxyType | void>

withRecordingProxy

Object literals

Const PrettierDefaultOptions

PrettierDefaultOptions: object

printWidth

printWidth: number = 120

Generated using TypeDoc