Skip to content

arrayLiteral

Import from @varavel/vdl-plugin-sdk/testing.

function arrayLiteral(items): LiteralValue;

Creates an array LiteralValue from a list of literal items.

Parameters

Parameter Type Description
items LiteralValue[] Literal items to include.

Returns

LiteralValue

An array literal node.

Example

arrayLiteral([stringLiteral("a"), stringLiteral("b")]);
// returns a LiteralValue with kind "array"