public build()

in packages/util-transform/src/facade/countPattern.ts [89:114]


	public build(df: any, from: any) {
		if (!this.fieldValue) {
			throw new Error('countPattern field() must be defined')
		}

		const spec: any = {
			field: vegaField(this.fieldValue),
			pulse: from,
		}

		if (this.caseValue) {
			spec.case = this.caseValue
		}
		if (this.patternValue) {
			spec.pattern = this.patternValue
		}
		if (this.stopWordsValue) {
			spec.stopwords = this.stopWordsValue
		}
		if (this.asValue) {
			spec.as = this.asValue
		}

		const countPatternNode = df.add(vegaCountPattern, spec)
		return countPatternNode
	}