MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / isEmptyOrWhitespace

Function isEmptyOrWhitespace

javascript/atoms/typescript/get-text.ts:83–85  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

81// goog.string.isEmptyOrWhitespace treats \xa0 as whitespace for this check.
82// (referenced at dom.js lines 1079, 1115)
83function isEmptyOrWhitespace(str: string): boolean {
84 return /^[\s\xa0]*$/.test(str)
85}
86
87// Joins the accumulated lines with '\n', trims each line and the overall
88// result (excluding NBSP), then converts all remaining NBSP to regular spaces.

Callers 1

Calls 1

testMethod · 0.45

Tested by

no test coverage detected