mirror of
https://github.com/swc-project/swc.git
synced 2024-12-23 05:32:09 +03:00
35 lines
896 B
TypeScript
35 lines
896 B
TypeScript
// Loaded from https://deno.land/x/ramda@v0.27.2/source/isEmpty.js
|
|
|
|
|
|
import _curry1 from './internal/_curry1.js';
|
|
import empty from './empty.js';
|
|
import equals from './equals.js';
|
|
|
|
|
|
/**
|
|
* Returns `true` if the given value is its type's empty value; `false`
|
|
* otherwise.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.1.0
|
|
* @category Logic
|
|
* @sig a -> Boolean
|
|
* @param {*} x
|
|
* @return {Boolean}
|
|
* @see R.empty
|
|
* @example
|
|
*
|
|
* R.isEmpty([1, 2, 3]); //=> false
|
|
* R.isEmpty([]); //=> true
|
|
* R.isEmpty(''); //=> true
|
|
* R.isEmpty(null); //=> false
|
|
* R.isEmpty({}); //=> true
|
|
* R.isEmpty({length: 0}); //=> false
|
|
* R.isEmpty(Uint8Array.from('')); //=> true
|
|
*/
|
|
var isEmpty = _curry1(function isEmpty(x) {
|
|
return x != null && equals(x, empty(x));
|
|
});
|
|
export default isEmpty;
|