Skip to main content

extractName

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

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.

Arguments

1. rawSrc

rawSrc: string

Returns

undefined | string