This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/fablabchemnitz/papercraft/openjscad/node_modules/most/lib/combinator/build.js

36 lines
852 B
JavaScript

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cons = cons;
exports.concat = concat;
var _core = require('../source/core');
var _continueWith = require('./continueWith');
/**
* @param {*} x value to prepend
* @param {Stream} stream
* @returns {Stream} new stream with x prepended
*/
/** @license MIT License (c) copyright 2010-2016 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
function cons(x, stream) {
return concat((0, _core.of)(x), stream);
}
/**
* @param {Stream} left
* @param {Stream} right
* @returns {Stream} new stream containing all events in left followed by all
* events in right. This *timeshifts* right to the end of left.
*/
function concat(left, right) {
return (0, _continueWith.continueWith)(function () {
return right;
}, left);
}