MCPcopy
hub / github.com/KilledByAPixel/LittleJS / isStringLike

Function isStringLike

src/engineMath.js:304–304  ·  view source on GitHub ↗

* Check if a value is stringifiable — i.e. it has a toString that returns * a string. Use this for ASSERTs and inputs that will be coerced to text; * use `typeof x === 'string'` inline if you need strict-string semantics. * - Returns true for strings, numbers, and most objects * - Returns false

(s)

Source from the content-addressed store, hash-verified

302 * @return {boolean}
303 * @memberof Math */
304function isStringLike(s) { return s != null && typeof s?.toString() === 'string'; }
305
306/**
307 * Check if object is an array

Callers 15

util.test.mjsFile · 0.90
keyIsDownFunction · 0.85
keyWasPressedFunction · 0.85
keyWasReleasedFunction · 0.85
keyDirectionFunction · 0.85
debugRectFunction · 0.85
debugPolyFunction · 0.85
debugCircleFunction · 0.85
debugTextFunction · 0.85
saveDataURLFunction · 0.85
shareURLFunction · 0.85
readSaveDataFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected