UNPKG

@kikiutils/node

Version:

A modular utility library for Node.js offering secure hashing, flexible logging, datetime manipulation, and more.

43 lines 1.45 kB
/** * Extracts the numeric values from an enumeration-like object. * * @param {Record<number | string, number | string>} data - The enumeration-like object to extract numeric values from. * The keys can be numbers or strings, and the values can be numbers or strings. * @returns {number[]} An array of numeric values extracted from the object. * * @example * ```typescript * import { getEnumNumberValues } from '@kikiutils/node/enum'; * * enum RecordType { * Receive = 0, * Send = 1, * Unknown = 'unknown' * } * * console.log(getEnumNumberValues(RecordType)); // [0, 1] * ``` */ export declare function getEnumNumberValues(data: Record<number | string, number | string>): number[]; /** * Extracts the string values from an enumeration-like object. * * @param {Record<number | string, number | string>} data - The enumeration-like object to extract string values from. * The keys can be numbers or strings, and the values can be numbers or strings. * @returns {string[]} An array of string values extracted from the object. * * @example * ```typescript * import { getEnumStringValues } from '@kikiutils/node/enum'; * * enum RecordType { * Receive = 0, * Send = 1, * Unknown = 'unknown' * } * * console.log(getEnumStringValues(RecordType)); // ['unknown'] * ``` */ export declare function getEnumStringValues(data: Record<number | string, number | string>): any[]; //# sourceMappingURL=enum.d.ts.map