Remove getRandomElement
This commit is contained in:
parent
6da7e7603c
commit
d0f919c414
1 changed files with 6 additions and 5 deletions
|
@ -7,12 +7,13 @@ const make = require('../make')
|
||||||
const utils = require('../utils')
|
const utils = require('../utils')
|
||||||
|
|
||||||
class script extends utils {
|
class script extends utils {
|
||||||
|
/**
|
||||||
|
* Helper method for appending an element to body or documentElement
|
||||||
|
* @param {string} name - Element identifier
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
static addElementToBody (name) {
|
static addElementToBody (name) {
|
||||||
return `(document.body || document.documentElement).appendChild${script.methodHead([name])}`
|
return `(document.body || document.documentElement).appendChild(${name})`
|
||||||
}
|
|
||||||
|
|
||||||
static getRandomElement () {
|
|
||||||
return `document.getElementsByTagName('*')[${random.number(document.getElementsByTagName('*').length)}]`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static makeArray (type, arrayLength, cb) {
|
static makeArray (type, arrayLength, cb) {
|
||||||
|
|
Loading…
Reference in a new issue