Skip to main content

extractName

Quickly extract the script purpose header of a script source, by parsing only the minimally necessary characters. Returns null if the script header is missing or syntactically incorrect. The first string returned is the script purpose, the second value returned is the script name.

export function extractName(rawSrc: string): undefined | string

Arguments

NameTypeDescription
rawSrcstring

Return value

undefined | string