restriction

Returns the set restriction as type str or nil when the set is not value restricted.

This function does not generate a change.

Function

set.restriction()

Arguments

None

Return value

Returns restriction of the set or nil if not value restricted.

Example

Using restriction() on a non-restricted set:

set().restriction();

Return value in JSON format

null

Using restriction() on a restricted set:

// Create an example type
new_type('S');
set_type('Y', {set: '{S}'});

Y{}.set.restriction();

Return value in JSON format

"S"