Skip to main content
Fragments of a concatenated string containing stringified Tokens.

Initializers

import { TokenizedStringFragments } from 'cdktn'

new TokenizedStringFragments()
NameTypeDescription

Methods

NameDescription
addEscapeNo description.
addIntrinsicAdds an intrinsic fragment.
addLiteralAdds a literal fragment.
addTokenAdds a token fragment.
concatNo description.
joinCombine the string fragments using the given joiner.
mapTokensApply a transformation function to all tokens in the string.

addEscape

public addEscape(kind: string): void

kindRequired

  • Type: string

addIntrinsic

public addIntrinsic(value: any): void
Adds an intrinsic fragment.

valueRequired

  • Type: any
the intrinsic value to add.

addLiteral

public addLiteral(lit: any): void
Adds a literal fragment.

litRequired

  • Type: any
the literal to add.

addToken

public addToken(token: IResolvable): void
Adds a token fragment.

tokenRequired

the token to add.

concat

public concat(other: TokenizedStringFragments): void

otherRequired


join

public join(concat: IFragmentConcatenator): any
Combine the string fragments using the given joiner. If there are any

concatRequired


mapTokens

public mapTokens(context: IResolveContext): TokenizedStringFragments
Apply a transformation function to all tokens in the string.

contextRequired


Properties

NameTypeDescription
escapesIResolvable[]Return all escape fragments from this string.
firstValueanyReturns the first value.
intrinsicIResolvable[]Return all intrinsic fragments from this string.
lengthnumberReturns the number of fragments.
literalsIResolvable[]Return all literals from this string.
tokensIResolvable[]Return all Tokens from this string.
firstTokenIResolvableReturns the first token.

escapesRequired

public readonly escapes: IResolvable[];
Return all escape fragments from this string.

firstValueRequired

public readonly firstValue: any;
  • Type: any
Returns the first value.

intrinsicRequired

public readonly intrinsic: IResolvable[];
Return all intrinsic fragments from this string.

lengthRequired

public readonly length: number;
  • Type: number
Returns the number of fragments.

literalsRequired

public readonly literals: IResolvable[];
Return all literals from this string.

tokensRequired

public readonly tokens: IResolvable[];
Return all Tokens from this string.

firstTokenOptional

public readonly firstToken: IResolvable;
Returns the first token.