UNPKG

phaser

Version:

A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers.

32 lines (28 loc) 849 B
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2018 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ /** * Verifies that an object contains at least one of the requested keys * * @function Phaser.Utils.Object.HasAny * @since 3.0.0 * * @param {object} source - an object on which to check for key existence * @param {string[]} keys - an array of keys to search the object for * * @return {boolean} true if the source object contains at least one of the keys, false otherwise */ var HasAny = function (source, keys) { for (var i = 0; i < keys.length; i++) { if (source.hasOwnProperty(keys[i])) { return true; } } return false; }; module.exports = HasAny;