Docs
API
Classes
Interpolator

Class: Interpolator

string-interpolation/src.Interpolator

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Interpolator(options?)

Parameters

NameTypeDefault value
optionsObjectdefaultOptions
options.delimiterstring[]undefined

Properties

aliases

aliases: any[]

Defined in

packages/string-interpolation/src/interpolator.js:10

packages/string-interpolation/src/interpolator.js:178


modifiers

modifiers: any[]

Defined in

packages/string-interpolation/src/interpolator.js:9


options

options: Object

Type declaration

NameType
delimiterstring[]

Defined in

packages/string-interpolation/src/interpolator.js:8

Accessors

delimiter

get delimiter(): string[]

Returns

string[]

Methods

addAlias

addAlias(key, ref): Interpolator

Parameters

NameType
keyany
refany

Returns

Interpolator


applyData

applyData(key, data): any

Parameters

NameType
keyany
dataany

Returns

any


applyModifiers

applyModifiers(modifiers, str, rawData): any

Parameters

NameType
modifiersany
strany
rawDataany

Returns

any


applyRule

applyRule(str, rule, data?): any

Parameters

NameType
strany
ruleany
dataObject

Returns

any


delimiterEnd

delimiterEnd(): string

Returns

string


delimiterStart

delimiterStart(): string

Returns

string


extractAfter

extractAfter(str, val): any

Parameters

NameType
strany
valany

Returns

any


extractRules

extractRules(matches): any

Parameters

NameType
matchesany

Returns

any


getAlternativeText

getAlternativeText(str): any

Parameters

NameType
strany

Returns

any


getFromAlias

getFromAlias(key): any

Parameters

NameType
keyany

Returns

any


getKeyFromMatch

getKeyFromMatch(match): any

Parameters

NameType
matchany

Returns

any


getModifier

getModifier(key): any

Parameters

NameType
keyany

Returns

any


getModifiers

getModifiers(str): any

Parameters

NameType
strany

Returns

any


parse

parse(str?, data?): any

Parameters

NameTypeDefault value
strstring''
dataObject{}

Returns

any


parseFromRules

parseFromRules(str, data, rules): any

Parameters

NameType
strany
dataany
rulesany

Returns

any


parseRules

parseRules(str): any

Parameters

NameType
strany

Returns

any


registerBuiltInModifiers

registerBuiltInModifiers(): Interpolator

Returns

Interpolator


registerModifier

registerModifier(key, transform): Error | Interpolator

Parameters

NameType
keyany
transformany

Returns

Error | Interpolator


removeAfter

removeAfter(str, val): any

Parameters

NameType
strany
valany

Returns

any


removeAlias

removeAlias(key): Interpolator

Parameters

NameType
keyany

Returns

Interpolator


removeDelimiter

removeDelimiter(val): any

Parameters

NameType
valany

Returns

any