|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
489 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | var getMapData = require('./_getMapData');
|
|---|
| 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 | module.exports = mapCacheSet;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.