25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
734 B

4 년 전
  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;