UNPKG

arcade-physics

Version:
37 lines 1.14 kB
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Sets a value in an object, allowing for dot notation to control the depth of the property. * * For example: * * ```javascript * var data = { * world: { * position: { * x: 200, * y: 100 * } * } * }; * * SetValue(data, 'world.position.y', 300); * * console.log(data.world.position.y); // 300 * ``` * * @function Phaser.Utils.Objects.SetValue * @since 3.17.0 * * @param {object} source - The object to set the value in. * @param {string} key - The name of the property in the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) * @param {any} value - The value to set into the property, if found in the source object. * * @return {boolean} `true` if the property key was valid and the value was set, otherwise `false`. */ declare const SetValue: (source: any, key: any, value: any) => boolean; export default SetValue; //# sourceMappingURL=SetValue.d.ts.map