method legacyCompat.refType
legacyCompat.refType(x: unknown): string

Perl's ref($x) builtin — returns "HASH"/"ARRAY" for a hashref/arrayref, or "" for anything else (a plain scalar, undef, etc.), matching Perl's own string-truthiness rule closely enough that ref($x) used as a bare boolean condition (return if ref $x;) works unmodified once translated. Only hashref/arrayref detection — real Perl ref() also recognizes CODE/SCALAR/blessed-object-class-name, none of which the legacy plugin corpus's own use of ref() ever tests for.

Parameters

x: unknown

Return Type

string

Usage

import { legacyCompat } from "plugins/legacy-globals.d.ts";