defs.js 732 B

12345678910111213141516171819202122
  1. 'use strict';
  2. const none = Symbol.for('stream-chain.none');
  3. const finalSymbol = Symbol.for('stream-chain.final');
  4. const manySymbol = Symbol.for('stream-chain.many');
  5. const final = value => ({[finalSymbol]: value});
  6. const many = values => ({[manySymbol]: values});
  7. const isFinal = o => o && typeof o == 'object' && finalSymbol in o;
  8. const isMany = o => o && typeof o == 'object' && manySymbol in o;
  9. const getFinalValue = o => o[finalSymbol];
  10. const getManyValues = o => o[manySymbol];
  11. module.exports.none = none;
  12. module.exports.final = final;
  13. module.exports.isFinal = isFinal;
  14. module.exports.getFinalValue = getFinalValue;
  15. module.exports.many = many;
  16. module.exports.isMany = isMany;
  17. module.exports.getManyValues = getManyValues;