Skip to content

Class: UtilsRecord ​

Record utilities (key-value objects): human-readable formatting.

Remarks ​

Available everywhere via k.Utils.Record. All methods are static.

Example ​

ts
k.Utils.Record.toString({ score: 10, lives: 3 }); // "score: 10 | lives: 3"

Constructors ​

Constructor ​

ts
new UtilsRecord(): UtilsRecord;

Returns ​

UtilsRecord

Methods ​

toString() ​

ts
static toString(record): string;

Formats a record into a human-readable key: value string, with pairs separated by |.

Parameters ​

record ​

Record<string, any>

The key-value object to format.

Returns ​

string

The string describing each pair; an empty string if the record is empty.

Example ​

ts
k.Utils.Record.toString({ username: 'Alice', level: 7 });
// → "username: Alice | level: 7"