MCPcopy Index your code
hub / github.com/imsun/gitment / getTargetContainer

Function getTargetContainer

src/utils.js:5–16  ·  view source on GitHub ↗
(container)

Source from the content-addressed store, hash-verified

3export const isString = s => toString.call(s) === '[object String]'
4
5export function getTargetContainer(container) {
6 let targetContainer
7 if (container instanceof Element) {
8 targetContainer = container
9 } else if (isString(container)) {
10 targetContainer = document.getElementById(container)
11 } else {
12 targetContainer = document.createElement('div')
13 }
14
15 return targetContainer
16}
17
18export const Query = {
19 parse(search = window.location.search) {

Callers 1

extendRendererFunction · 0.90

Calls 1

isStringFunction · 0.85

Tested by

no test coverage detected