getBySource<T>( match: string | RegExp, options?: { all?: false; raw?: false },): T | undefined Parameters
- match: string | RegExp
Optional
options: { all?: false; raw?: false }
Returns T | undefined
getBySource<T>(match: string | RegExp, options: { all: true; raw?: false }): T[] Parameters
- match: string | RegExp
- options: { all: true; raw?: false }
Returns T[]
getBySource<T>( match: string | RegExp, options: { all: false; raw: true },): RawModule<T> | undefined Parameters
- match: string | RegExp
- options: { all: false; raw: true }
Returns RawModule<T> | undefined
getBySource<T>( match: string | RegExp, options: { all: true; raw: true },): RawModule<T>[] Parameters
- match: string | RegExp
- options: { all: true; raw: true }
getBySource<T>( match: string | RegExp, options: { all?: false; raw?: boolean },): T | RawModule<T> | undefined Parameters
- match: string | RegExp
- options: { all?: false; raw?: boolean }
Returns T | RawModule<T> | undefined
getBySource<T>( match: string | RegExp, options: { all: true; raw?: boolean },): T[] | RawModule<T>[] Parameters
- match: string | RegExp
- options: { all: true; raw?: boolean }
getBySource<T>( match: string | RegExp, options: { all: boolean; raw?: false },): T | T[] | undefined Parameters
- match: string | RegExp
- options: { all: boolean; raw?: false }
Returns T | T[] | undefined
getBySource<T>( match: string | RegExp, options: { all: boolean; raw: true },): RawModule<T> | RawModule<T>[] | undefined Parameters
- match: string | RegExp
- options: { all: boolean; raw: true }
getBySource<T>( match: string | RegExp, options?: { all?: boolean; raw?: boolean },): T | T[] | RawModule<T> | RawModule<T>[] | undefined Parameters
- match: string | RegExp
Optional
options: { all?: boolean; raw?: boolean }
Retrieves a module(s) by matching its source code against a string or regular expression.
Equivalent to
getModule(filters.bySource(match), options)
.Template: T
The expected type of the module(s) to be returned.
Param: match
A string or regular expression to match against the module's source code.
Param: options
Configuration options for the module retrieval.
Returns
The matching module(s) or
undefined
if no match is found.See