Whether a member's value is a function: a shorthand method, `function (…) {…}`, or an arrow.
(s: string, m: RawMember)
| 167 | |
| 168 | /** Whether a member's value is a function: a shorthand method, `function (…) {…}`, or an arrow. */ |
| 169 | function isFunctionValue(s: string, m: RawMember): boolean { |
| 170 | if (m.shorthand) return true; |
| 171 | const value = s.slice(m.valueAt, m.end).trimStart(); |
| 172 | return /^(?:async\s+)?function\b/.test(value) || /^(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>/.test(value); |
| 173 | } |
| 174 | |
| 175 | /** The `{` of the options object the default export is, or -1. */ |
| 176 | function optionsObjectStart(script: string): number { |