UNPKG

logitar-js

Version:

Helper functions distributed by Logitar.

23 lines (22 loc) 746 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isEmpty = exports.assign = void 0; /** * Assigns the specified value to the specified key in the specified object. * @param obj The object to be assigned to. * @param key The key to assign the value to. * @param value The value to assign. */ function assign(obj, key, value) { obj[key] = value; } exports.assign = assign; /** * Returns a value indicating whether or not the specified object is empty. An object is empty when it has no key. * @param obj The object to check. * @returns True if the object is empty (it has no key), or false otherwise. */ function isEmpty(obj) { return Object.keys(obj).length === 0; } exports.isEmpty = isEmpty;