rubico
Version:
[a]synchronous functional programming
9 lines (7 loc) • 633 B
JavaScript
/**
* rubico v2.6.2
* https://github.com/a-synchronous/rubico
* (c) 2019-2024 Richard Tong
* rubico may be freely distributed under the MIT license.
*/
!function(r,t){"object"==typeof module?module.exports=t:"function"==typeof define?define((()=>t)):r.prepend=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";const r=function(r){return"string"==typeof r||null!=r&&r.constructor==String},t=Array.isArray;return n=>function(o){if(t(o))return t(n)?[...n,...o]:[n,...o];if(r(o)){if(!r(n))throw new TypeError(`${n} is not a string`);return`${n}${o}`}throw new TypeError(`${o} is not an Array or string`)}}());