main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
487 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import getMapData from './_getMapData.js';
|
---|
| 2 |
|
---|
| 3 | /**
|
---|
| 4 | * Sets the map `key` to `value`.
|
---|
| 5 | *
|
---|
| 6 | * @private
|
---|
| 7 | * @name set
|
---|
| 8 | * @memberOf MapCache
|
---|
| 9 | * @param {string} key The key of the value to set.
|
---|
| 10 | * @param {*} value The value to set.
|
---|
| 11 | * @returns {Object} Returns the map cache instance.
|
---|
| 12 | */
|
---|
| 13 | function mapCacheSet(key, value) {
|
---|
| 14 | var data = getMapData(this, key),
|
---|
| 15 | size = data.size;
|
---|
| 16 |
|
---|
| 17 | data.set(key, value);
|
---|
| 18 | this.size += data.size == size ? 0 : 1;
|
---|
| 19 | return this;
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | export default mapCacheSet;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.