Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pull.js 356B

1234567891011121314151617
  1. 'use strict';
  2. module.exports = function pull(key, defaultValue) {
  3. var returnValue = this.items[key] || null;
  4. if (!returnValue && defaultValue !== undefined) {
  5. if (typeof defaultValue === 'function') {
  6. returnValue = defaultValue();
  7. } else {
  8. returnValue = defaultValue;
  9. }
  10. }
  11. delete this.items[key];
  12. return returnValue;
  13. };