VDL Plugin SDK

arrayLiteral

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

function arrayLiteral(items): LiteralValue;

Creates an array LiteralValue from a list of literal items.

Parameters

ParameterTypeDescription
itemsLiteralValue[]Literal items to include.

Returns

LiteralValue

An array literal node.

Example

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