Getting started Community Training Tutorials Documentation APIs, AI & Tools
%dw 2.0
import * from dw::core::Types
type AType = {name: String} & {age: Number}
output application/json
---
{
a: intersectionItems(AType)
}
intersectionItems
intersectionItems
You're viewing an older version of the documentation. You can switch to the latest version or use the version selector in the left navigation.
Returns an array of all the types that define a given Intersection type. This function fails if the input is not an Intersection type.
Introduced in DataWeave version 2.3.0.
This example shows how intersectionItems behaves with different inputs.
Note that the AType variable defines an Intersection type
{name: String} & {age: Number} by using an & between
the two objects.