rubico
Version:
[a]synchronous functional programming
9 lines (7 loc) • 632 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.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`)}}());