LogoPixi’VN
pixi-jsFunctions

Function: cleanHash()

> cleanHash<T>(hash): Record<string, T>

Defined in: node_modules/pixi.js/lib/utils/data/clean.d.ts:11

Internal

Takes a hash and removes all the undefined/null values from it. In PixiJS, we tend to null properties instead of using 'delete' for performance reasons. However, in some cases, this could be a problem if the hash grows too large over time, this function can be used to clean a hash.

Type Parameters

T

T

Parameters

hash

Record<string, T>

The hash to clean.

Returns

Record<string, T>

A new hash with all the undefined/null values removed.