MCPcopy
hub / github.com/slevithan/xregexp / isEmpty

Function isEmpty

tests/spec/s-xregexp.js:59–61  ·  view source on GitHub ↗
(regex)

Source from the content-addressed store, hash-verified

57 // XRegExp follows the native RegExp. Chrome 20 follows the spec and converts empty
58 // patterns to (?:), but Firefox 14.0.1, Safari 5.1.2, Opera 12, and IE 9 do not
59 function isEmpty(regex) {
60 return regex.source === '(?:)' || regex.source === '';
61 }
62
63 emptyTypes.forEach(function(item) {
64 expect(isEmpty(XRegExp(item))).toBe(true);

Callers 1

s-xregexp.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…