MCPcopy
hub / github.com/harttle/liquidjs / variableSegments

Method variableSegments

src/liquid.ts:167–170  ·  view source on GitHub ↗

Return an array of all variables, each as an array of properties/segments.

(template: string | Template[], options: StaticAnalysisOptions = {})

Source from the content-addressed store, hash-verified

165
166 /** Return an array of all variables, each as an array of properties/segments. */
167 public async variableSegments (template: string | Template[], options: StaticAnalysisOptions = {}): Promise<Array<SegmentArray>> {
168 const analysis = await analyze(isString(template) ? this.parse(template) : template, options)
169 return Array.from(strictUniq(Object.values(analysis.variables).flatMap((a) => a.map((v) => v.toArray()))))
170 }
171
172 /** Return an array of all variables, each as an array of properties/segments. */
173 public variableSegmentsSync (template: string | Template[], options: StaticAnalysisOptions = {}): Array<SegmentArray> {

Callers 1

liquid.spec.tsFile · 0.80

Calls 5

parseMethod · 0.95
analyzeFunction · 0.90
isStringFunction · 0.90
strictUniqFunction · 0.90
toArrayMethod · 0.80

Tested by

no test coverage detected