mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-05 11:31:31 +08:00
R=jacktfranklin@chromium.org DISABLE_THIRD_PARTY_CHECK=Adding sinon to deps Change-Id: If47962332a4d9a4b4f0edbe637bca4f9894545ba Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2562704 Auto-Submit: Paul Lewis <aerotwist@chromium.org> Commit-Queue: Paul Lewis <aerotwist@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
19 lines
499 B
JavaScript
19 lines
499 B
JavaScript
"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;
|