arcade-physics
Version:
Use Arcade Physics without Phaser.
28 lines • 868 B
JavaScript
;
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Verifies that an object contains all requested keys
*
* @function Phaser.Utils.Objects.HasAll
* @since 3.0.0
*
* @param {object} source - an object on which to check for key existence
* @param {string[]} keys - an array of keys to ensure the source object contains
*
* @return {boolean} true if the source object contains all keys, false otherwise.
*/
const HasAll = (source, keys) => {
for (let i = 0; i < keys.length; i++) {
if (!source.hasOwnProperty(keys[i])) {
return false;
}
}
return true;
};
exports.default = HasAll;
//# sourceMappingURL=HasAll.js.map