rubico
Version:
[a]synchronous functional programming
10 lines (8 loc) • 631 B
JavaScript
/**
* Rubico v2.8.3
* https://rubico.land/
*
* © Richard Yufei Tong, King of Software
* Rubico may be freely distributed under the CFOSS license.
*/
!function(r,t){"object"==typeof module?module.exports=t:"function"==typeof define?define((()=>t)):r.append=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)?[...o,...n]:[...o,n];if(r(o)){if(!r(n))throw new TypeError(`${n} is not a string`);return`${o}${n}`}throw new TypeError(`${o} is not an Array or string`)}}());