MCPcopy Index your code
hub / github.com/documentationjs/documentation / elementOrSelector

Function elementOrSelector

src/default_theme/assets/split.js:51–61  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

49 // interchangeably. In either case an element is returned. This allows us to
50 // do `Split([elem1, elem2])` as well as `Split(['#id1', '#id2'])`.
51 var elementOrSelector = function (el) {
52 if (isString(el)) {
53 var ele = document.querySelector(el);
54 if (!ele) {
55 throw new Error(("Selector " + el + " did not match a DOM element"))
56 }
57 return ele
58 }
59
60 return el
61 };
62
63 // Helper function gets a property from the properties object, with a default fallback
64 var getOption = function (options, propName, def) {

Callers 1

SplitFunction · 0.85

Calls 1

isStringFunction · 0.85

Tested by

no test coverage detected