rubico
Version:
[a]synchronous functional programming
8 lines (7 loc) • 484 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.
*/
const isArray=Array.isArray,sameValueZero=function(n,e){return n===e||n!=n&&e!=e},objectIncludes=function(n,e){for(const r in n)if(sameValueZero(e,n[r]))return!0;return!1},includes=n=>function(e){return null!=e&&("function"==typeof e.includes?e.includes(n):e.constructor==Object&&objectIncludes(e,n))};export default includes;