diff --git a/lib/node_modules/@stdlib/utils/type-of/lib/main.js b/lib/node_modules/@stdlib/utils/type-of/lib/main.js index 4a17563d2ccb..f305cd2e1141 100644 --- a/lib/node_modules/@stdlib/utils/type-of/lib/main.js +++ b/lib/node_modules/@stdlib/utils/type-of/lib/main.js @@ -21,6 +21,7 @@ // MODULES // var ctorName = require( '@stdlib/utils/constructor-name' ); +var lowercase = require( '@stdlib/string/base/lowercase' ); // NOTES // @@ -53,6 +54,14 @@ var ctorName = require( '@stdlib/utils/constructor-name' ); * * @param {*} v - input value * @returns {string} string indicating the value's type +* +* @example +* var str = typeOf( 'a' ); +* // returns 'string' +* +* @example +* var str = typeOf( 5 ); +* // returns 'number' */ function typeOf( v ) { var type; @@ -65,7 +74,7 @@ function typeOf( v ) { // If the `typeof` operator returned something other than `object`, we are done. Otherwise, we need to check for an internal class name or search for a constructor. if ( type === 'object' ) { - return ctorName( v ).toLowerCase(); + return lowercase( ctorName( v ) ); } return type; } diff --git a/lib/node_modules/@stdlib/utils/type-of/lib/polyfill.js b/lib/node_modules/@stdlib/utils/type-of/lib/polyfill.js index 856e26e438af..f8b46020cab8 100644 --- a/lib/node_modules/@stdlib/utils/type-of/lib/polyfill.js +++ b/lib/node_modules/@stdlib/utils/type-of/lib/polyfill.js @@ -21,6 +21,7 @@ // MODULES // var ctorName = require( '@stdlib/utils/constructor-name' ); +var lowercase = require( '@stdlib/string/base/lowercase' ); // MAIN // @@ -30,9 +31,17 @@ var ctorName = require( '@stdlib/utils/constructor-name' ); * * @param {*} v - input value * @returns {string} string indicating the value's type +* +* @example +* var str = typeOf( 'a' ); +* // returns 'string' +* +* @example +* var str = typeOf( 5 ); +* // returns 'number' */ function typeOf( v ) { - return ctorName( v ).toLowerCase(); + return lowercase( ctorName( v ) ); }