MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isFunctionValue

Function isFunctionValue

src/extraction/vue-options-api.ts:169–173  ·  view source on GitHub ↗

Whether a member's value is a function: a shorthand method, `function (…) {…}`, or an arrow.

(s: string, m: RawMember)

Source from the content-addressed store, hash-verified

167
168/** Whether a member's value is a function: a shorthand method, `function (…) {…}`, or an arrow. */
169function 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. */
176function optionsObjectStart(script: string): number {

Callers 1

vueOptionsMembersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected