swc/bundler/tests/.cache/deno/e8b5867dc1dbb41f4e0d2cb9e6052378956bedcf.ts
강동윤 bbaf619f63
fix(bundler): Fix bugs (#1437)
swc_bundler:
 - [x] Fix wrapped esms. (denoland/deno#9307)
 - [x] Make test secure.
2021-03-02 17:33:03 +09:00

40 lines
1.0 KiB
TypeScript

// Loaded from https://deno.land/x/ramda@v0.27.2/source/type.js
import _curry1 from './internal/_curry1.js';
/**
* Gives a single-word string description of the (native) type of a value,
* returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not
* attempt to distinguish user Object types any further, reporting them all as
* 'Object'.
*
* @func
* @memberOf R
* @since v0.8.0
* @category Type
* @sig (* -> {*}) -> String
* @param {*} val The value to test
* @return {String}
* @example
*
* R.type({}); //=> "Object"
* R.type(1); //=> "Number"
* R.type(false); //=> "Boolean"
* R.type('s'); //=> "String"
* R.type(null); //=> "Null"
* R.type([]); //=> "Array"
* R.type(/[A-z]/); //=> "RegExp"
* R.type(() => {}); //=> "Function"
* R.type(undefined); //=> "Undefined"
*/
var type = _curry1(function type(val) {
return val === null
? 'Null'
: val === undefined
? 'Undefined'
: Object.prototype.toString.call(val).slice(8, -1);
});
export default type;