選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

_Stack.js 734B

123456789101112131415161718192021222324252627
  1. var ListCache = require('./_ListCache'),
  2. stackClear = require('./_stackClear'),
  3. stackDelete = require('./_stackDelete'),
  4. stackGet = require('./_stackGet'),
  5. stackHas = require('./_stackHas'),
  6. stackSet = require('./_stackSet');
  7. /**
  8. * Creates a stack cache object to store key-value pairs.
  9. *
  10. * @private
  11. * @constructor
  12. * @param {Array} [entries] The key-value pairs to cache.
  13. */
  14. function Stack(entries) {
  15. var data = this.__data__ = new ListCache(entries);
  16. this.size = data.size;
  17. }
  18. // Add methods to `Stack`.
  19. Stack.prototype.clear = stackClear;
  20. Stack.prototype['delete'] = stackDelete;
  21. Stack.prototype.get = stackGet;
  22. Stack.prototype.has = stackHas;
  23. Stack.prototype.set = stackSet;
  24. module.exports = Stack;