You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
499 B
18 lines
499 B
"use strict";
|
|
|
|
var toString = require("@sinonjs/commons").prototypes.object.toString;
|
|
|
|
/**
|
|
* Returns the internal `Class` by calling `Object.prototype.toString`
|
|
* with the provided value as `this`. Return value is a `String`, naming the
|
|
* internal class, e.g. "Array"
|
|
*
|
|
* @private
|
|
* @param {*} value - Any value
|
|
* @returns {string} - A string representation of the `Class` of `value`
|
|
*/
|
|
function getClass(value) {
|
|
return toString(value).split(/[ \]]/)[1];
|
|
}
|
|
|
|
module.exports = getClass;
|
|
|