_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
52
373k
language
stringclasses
1 value
meta_information
dict
q61800
flip
validation
function flip(it) { return __asyncGenerator(this, arguments, function* flip_1() { yield __await(yield* __asyncDelegator(__asyncValues(yield __await(reduce((prev, next) => [next].concat(prev), [])(it))))); }); }
javascript
{ "resource": "" }
q61801
repeat
validation
function repeat(times) { return function (it) { return __asyncGenerator(this, arguments, function* () { var e_26, _a; const buffer = []; try { for (var it_6 = __asyncValues(it), it_6_1; it_6_1 = yield __await(it_6.next()), !it_6_1.done;) { ...
javascript
{ "resource": "" }
q61802
doppler
validation
function doppler(it) { return __asyncGenerator(this, arguments, function* doppler_1() { var e_27, _a; const buffer = []; try { for (var it_7 = __asyncValues(it), it_7_1; it_7_1 = yield __await(it_7.next()), !it_7_1.done;) { const item = it_7_1.value; ...
javascript
{ "resource": "" }
q61803
count
validation
async function count(source) { var e_33, _a; let i = 0; try { for (var source_4 = __asyncValues(source), source_4_1; source_4_1 = await source_4.next(), !source_4_1.done;) { const it = source_4_1.value; ++i; } } catch (e_33_1) { e_33 = { error: e_33_1...
javascript
{ "resource": "" }
q61804
empty
validation
async function empty(source) { var e_34, _a; let i = 0; try { for (var source_5 = __asyncValues(source), source_5_1; source_5_1 = await source_5.next(), !source_5_1.done;) { const it = source_5_1.value; return false; } } catch (e_34_1) { e_34 = { erro...
javascript
{ "resource": "" }
q61805
CloseCommand
validation
function CloseCommand(args, define) { var parsed = new statements.ExpressionStatement(args, define); if (!(parsed.child instanceof statements.PointerStatement)) throw new SyntaxError('Expected pointer'); this.pointer = parsed; }
javascript
{ "resource": "" }
q61806
Block
validation
function Block(line, def, parent) { this.startNames = []; this.thenNames = []; this.endNames = []; for (var i = 0; i < def.start.length; i++) this.startNames.push(def.start[i].toLowerCase()); for (var x = 0; x < def.end.length; x++) this.endNames.push(def.end[x].toLowerCase()); for (var y = 0; y...
javascript
{ "resource": "" }
q61807
ReadCommand
validation
function ReadCommand(args) { var parsed = new statements.ArgumentStatement(args); for (var i = 0; i < parsed.args.length; i++) { var placeVar = parsed.args[i]; if (!(placeVar.child instanceof statements.VariableStatement || placeVar.child instanceof statements.FunctionStatement)) thr...
javascript
{ "resource": "" }
q61808
compileValue
validation
function compileValue(value) { if (value.subtype === 'array') { return compileArray(value) } else if (value.subtype === 'object') { return compileObject(value) } else if (value.subtype === 'mixin') { return compileMixin(value) } else if (value.subtype === 'js') { return compileJS(value) } else if ...
javascript
{ "resource": "" }
q61809
DrawspriteCommand
validation
function DrawspriteCommand(args) { var parsed = new statements.ArgumentStatement(args); if (parsed.args.length < 3) throw new SyntaxError('DRAWSPRITE command requires 3 arguments'); this.id = parsed.args[0]; this.x = parsed.args[1]; this.y = parsed.args[2]; this.scale = parsed.args.length === 4...
javascript
{ "resource": "" }
q61810
validation
function (string) { // string.check check sting type and size return ((typeof string === 'string' || string instanceof String) && string.length >= this.min && string.length <= this.max && (!this.match || string.match(this.match)) ...
javascript
{ "resource": "" }
q61811
sprintf
validation
function sprintf (fstr, array) { // check the formatted string is for JSON and confirm is a valid JSON array.forEach(function (value) { fstr = format(fstr, value); }); return fstr; }
javascript
{ "resource": "" }
q61812
deepLook
validation
function deepLook(obj, types) { if (typeof (obj) !== 'object') return obj; for (var key in obj) { if (!obj[key].type) { obj[key] = deepLook(obj[key], types); } else { if (!types[obj[key].type]) { throw new Error('No type ' + obj[key].type + ' in Types: key ' + key); } // che...
javascript
{ "resource": "" }
q61813
validateObjectRequired
validation
function validateObjectRequired(options, modelObject, entity, parents, errors) { for (var key in modelObject) { if (!modelObject[key].type && entity) { validateObjectRequired( options, modelObject[key], entity[key], parents + '.' + key, errors); } else if (!option...
javascript
{ "resource": "" }
q61814
validateObjectEntity
validation
function validateObjectEntity(modelObject, entity, parents, errors) { if (!errors) errors = {}; if (!errors.text) errors.text = []; if (!parents) parents = []; for (var key in entity) { var fieldName = parents + '.' + key; if (!modelObject || !modelObject[key]) { if (!errors.notRequired) errors.n...
javascript
{ "resource": "" }
q61815
validation
function (params) { var res = []; if (typeof (params) === 'undefined') params = { displayEverything: false }; if (!this.registeredModels || Object.keys(this.registeredModels).length === 0) { res.push('There is no registered models'); } else { res.push('List of registered models'); for ...
javascript
{ "resource": "" }
q61816
validation
function (modelName, entity, options, next) { if (typeof options === 'function') next = options; if (!options) options = {}; var modelObject = this.registeredModels[modelName]; if (typeof modelName === 'object') { modelObject = deepLook(modelName, this.types); } else if (this.types[modelName...
javascript
{ "resource": "" }
q61817
validation
function (type) { var examples = this.getExamples(type); return examples[Math.floor(Math.random() * examples.length)]; }
javascript
{ "resource": "" }
q61818
SleepCommand
validation
function SleepCommand(args, define) { this.duration = new statements.ExpressionStatement(args, define); if (this.duration.error) throw this.duration.error; }
javascript
{ "resource": "" }
q61819
validation
function(callback,compilationSource){ if( compilationSource && this.cache.compilationSource && this.cache.compilationSource === compilationSource ) return; var callbackError=function(type,strOrErr){ /*if(strOrErr instanceof Array){ var i,finalStr='Errors :'; for(i in strOrErr){ console.error(strOrEr...
javascript
{ "resource": "" }
q61820
errorHandler
validation
function errorHandler(response, error) { response .status(500) .send(error !== undefined && error !== null ? error.toString() : '') }
javascript
{ "resource": "" }
q61821
validation
function(cb) { Person.find('Scott', function(err, person) { if (err) { return cb(err); } assert(person.uuid); assert(person.name === 'Scott'); scott = person; cb(); }); }
javascript
{ "resource": "" }
q61822
validation
function(cb) { var calli = Dog.new({ name: 'Calli' }); // saves and creates connection scott.addDog(calli, function(err) { if (err) { return cb(err); } scott.fetchDogs(function(err) { if (err) { return cb(err); } assert(scott.dogs); var dog = scott.dogs[...
javascript
{ "resource": "" }
q61823
CircleCommand
validation
function CircleCommand(args) { var parsed = new statements.ArgumentStatement(args); if (parsed.args.length < 3) throw new SyntaxError('CIRCLE command requires 3 arguments'); this.x = parsed.args[0]; this.y = parsed.args[1]; this.radius = parsed.args[2]; this.stroke = parsed.args.length > 3 ? pa...
javascript
{ "resource": "" }
q61824
Polling
validation
function Polling (objGoogleCheckout) { var self = this; //todo: check the constructor name assert.ok(objGoogleCheckout, "A GoogleCheckout object is the only required argument"); self.gc = objGoogleCheckout; self.settings = self.gc.settings; self.continueToken = null; }
javascript
{ "resource": "" }
q61825
TriangleCommand
validation
function TriangleCommand(args) { var parsed = new statements.ArgumentStatement(args); if (parsed.args.length < 6) throw new SyntaxError('TRIANGLE command requires 6 arguments'); this.x1 = parsed.args[0]; this.y1 = parsed.args[1]; this.x2 = parsed.args[2]; this.y2 = parsed.args[3]; this.x3 =...
javascript
{ "resource": "" }
q61826
processFile
validation
function processFile(file) { var changed = true; while(changed && !file.processed) { changed = false; changed = processWraps(file); changed = processInserts(file); } file.processed = true; }
javascript
{ "resource": "" }
q61827
Service
validation
function Service(name) { debug('new service: %s', name); assert(name, "service not supplied with name"); this.name = name; this.middleware = []; this.uri = new Uri(); this.status = new Status(); this.initialize(); return this; }
javascript
{ "resource": "" }
q61828
Analyzer
validation
function Analyzer(config, state) { config = config || {}; this.state = state; this.config = extend(true, { finders: { styl : [ { name: 'regex', config: { pattern: /^\s*(?:@import|@require)\s+['"](.+?)['"](?:$|;)/gm, exclude: ['nib'] } } ], coffee: [ { name: '...
javascript
{ "resource": "" }
q61829
RrectCommand
validation
function RrectCommand(args) { var parsed = new statements.ArgumentStatement(args); if (parsed.args.length < 5) throw new SyntaxError('RRECT command requires 5 arguments'); this.x1 = parsed.args[0]; this.y1 = parsed.args[1]; this.x2 = parsed.args[2]; this.y2 = parsed.args[3]; this.radius = p...
javascript
{ "resource": "" }
q61830
cons
validation
function cons (b, value, next) { var free = readValue(b, 0) || 8 updateValue(b, free, value); updateNext(b, free, next) updateValue(b, 0, free+8) //update free pointer return free }
javascript
{ "resource": "" }
q61831
insert
validation
function insert (b, node, value) { return updateNext(b, node, cons(b, value, readNext(b, node))) }
javascript
{ "resource": "" }
q61832
init
validation
function init(pathToModels, cb, addToSwagger) { modelPath = pathToModels; glob(modelPath + '/**/*.js', function(err, files) { if (err) return cb && cb(err); files.forEach(function(file) { var Model = require(file)(), modelSwagger = null; if (Model.init) { Model.init(); ...
javascript
{ "resource": "" }
q61833
ArgumentStatement
validation
function ArgumentStatement(args, options, define) { options = options || {}; this.value = args; this.flags = {}; this.args = []; this.options = options; if (typeof options.parse === 'undefined') options.parse = true; if (typeof options.separator === 'undefined') options.separator = ','; ...
javascript
{ "resource": "" }
q61834
OpenCommand
validation
function OpenCommand(args, define) { var lowerArgs = args.toLowerCase(); var forIndex = lowerArgs.indexOf(' for '); if (forIndex === -1) throw new SyntaxError('OPEN without FOR'); var filename = new statements.ExpressionStatement(args.substring(0, forIndex).trim(), define); var asIndex = lowerArgs....
javascript
{ "resource": "" }
q61835
CommonJSResolverStrategy
validation
function CommonJSResolverStrategy(config) { BasicResolverStrategy.call(this, config); this.config = extend(true, this.config, {}, config); }
javascript
{ "resource": "" }
q61836
WhileCommand
validation
function WhileCommand(args, define) { var parsed = new statements.ArgumentStatement(args, { separator: false }); this.condition = parsed.args[0]; this.block = define({ start: 'WHILE', end: 'WEND' }); }
javascript
{ "resource": "" }
q61837
load
validation
function load(file, options) { var stream = fs.createReadStream(file, options); function onEnd() { this.emit('load'); } function onError(err) { this.emit('error', err); } //stream.on('data', function onData(buf) { //console.dir('got buffer length: ' + buf.length); //}) stream.on('end', onE...
javascript
{ "resource": "" }
q61838
validation
function(cb) { // Callback is optional cb = util.optional(cb); // Grab policies config & policy modules and trigger callback this.loadMiddleware(function (err) { if (err) return cb(err); sails.log.verbose('Finished loading policy middlewa...
javascript
{ "resource": "" }
q61839
validation
function() { // Build / normalize policy config this.mapping = this.buildPolicyMap(); _bindPolicies(this.mapping, sails.middleware.controllers); // Emit event to let other hooks know we're ready to go sails.log.verbose('Policy-controller bindings complete!');...
javascript
{ "resource": "" }
q61840
validation
function () { var mapping = { }; _.each(sails.config.policies, function (_policy, controllerId) { // Accept `FooController` or `foo` // Case-insensitive controllerId = util.normalizeControllerId(controllerId); // Controller-level ...
javascript
{ "resource": "" }
q61841
validation
function (event) { // Only pay attention to delegated route events // if `policy` is declared in event.target if ( !event.target || !event.target.policy ) { return; } // Bind policy function to route var fn = this.lookupFn(event.ta...
javascript
{ "resource": "" }
q61842
FunctionStatement
validation
function FunctionStatement(name, args) { if (name[name.length - 1] === '$') { this.type = 'string'; this.name = name.substring(0, name.length - 1); } else { this.type = 'number'; this.name = name; } var positions = util.findPositions(args, [ { 'start': '"', 'end'...
javascript
{ "resource": "" }
q61843
LoadspriteCommand
validation
function LoadspriteCommand(args) { var parsed = new statements.ArgumentStatement(args); if (parsed.args.length < 2) throw new SyntaxError('LOADSPRITE command requires 2 arguments'); else if (parsed.args.length > 2 && parsed.args.length < 5) throw new SyntaxError('LOADSPRITE command requires 5 arguments'); ...
javascript
{ "resource": "" }
q61844
validation
function(verb, path, controller, method){ // Only add the route if we recognise the verb. if (this.__verbs.indexOf(verb) >= 0){ // Create an actual object. var entry = { verb: verb, path: path, controller: controller, ...
javascript
{ "resource": "" }
q61845
validation
function(url, val){ // Create a new object that we can manipulate safely. var object = extend({}, val); // Flag so we remember to append any attributes that can't be bound. var append = false; // If there are still parameters to bind, pull them out. // Note: We use a d...
javascript
{ "resource": "" }
q61846
validation
function(app, route){ var self = this; var controller; var controllerPath = self.options.controllersPath + route.controller; // Load the controller. try { controller = require(self.options.rootPath + controllerPath); } catch (e) { throw ...
javascript
{ "resource": "" }
q61847
validation
function(app, route){ var self = this; // Figure out the folder they want to bind. var folderPath = route.controller.replace(/staticDir:/g, ''); var folder = self.options.rootPath + folderPath; // Make sure that's actually a folder. try { var info = fs.lsta...
javascript
{ "resource": "" }
q61848
validation
function(app){ // Cache the instance. var self = this; // Insert the instance into app.locals so it can be used in views. app.locals[self.options.templateVar] = self; // Grab the routes. var routes = self.getRoutes(); // Bind them. routes.forEach(funct...
javascript
{ "resource": "" }
q61849
validation
function(){ // If we've already loaded the routes, skip. if (this.routes.length === 0){ // Grab the entries. var routes; try { routes = this.readFile(this.options.rootPath + this.options.routesFile); } catch (e) { ...
javascript
{ "resource": "" }
q61850
validation
function(verb, path, controllerName){ // Load the referenced controller. var controllerPath = this.options.controllersPath + controllerName; try { var controller = require(this.options.rootPath + controllerPath); // Iterate over the controller, creating new route entrie...
javascript
{ "resource": "" }
q61851
validation
function(path){ // Define the array we'll return. var routes = []; // Grab the FS library. var fs = require('fs'); // Read the contents from disk. var array = fs.readFileSync(path).toString().split("\n"); // We need to post-process since there might have been ...
javascript
{ "resource": "" }
q61852
validation
function(action){ var url; var error; // Iterate over the routes, looking for a match. var routes = this.getRoutes(); for (var i = 0; url === undefined && i < routes.length; i++){ try { // Simplify access. var route = routes[i]; ...
javascript
{ "resource": "" }
q61853
validation
function(value){ /*#if BROWSER*/ if(this._label) this._label.text(value); else /*#/if*/ this._label=$.create('label').attr('for',this.getAttr('id'))/*#if BROWSER*/.prependTo(this._container)/*#/if*/.text(value); return this; }
javascript
{ "resource": "" }
q61854
parse
validation
function parse(code) { try { var labels = {}; var root = []; var manager = new BlockManager(); var lines = code.split('\n'); for (var i = 0; i < lines.length; i++) { try { var line = parseLine(lines[i].trim(), i, labels, false, manager); ...
javascript
{ "resource": "" }
q61855
CommandStatement
validation
function CommandStatement(name, args, manager, line) { this.name = name; this.args = args; if (!commands[name]) throw new SyntaxError('Unknown command: ' + name); this.command = new commands[name](args, manager.create(line)); }
javascript
{ "resource": "" }
q61856
BasicResolverStrategy
validation
function BasicResolverStrategy(config) { ResolverStrategy.call(this, config); this.config = extend(true, this.config, {}, config); }
javascript
{ "resource": "" }
q61857
toArray
validation
function toArray() { return Object .keys(data) .map(function(name) { return data[name]; }) .sort(function(a, b) { return a.compareTo(b); }); }
javascript
{ "resource": "" }
q61858
add
validation
function add(snapshot) { return Promise .resolve(mapFn(snapshot)) .then(function(val) { data[snapshot.key()] = val; }); }
javascript
{ "resource": "" }
q61859
emitValue
validation
function emitValue() { var arr = toArray(); marker = arr[arr.length - 1]; setTimeout(function() { emitter.emit('value', arr); }, 0); }
javascript
{ "resource": "" }
q61860
onChildAdd
validation
function onChildAdd(newData) { // ignore all events before first read if (!started) return; // ignore already added item if (data[newData.key()]) return; // ignore older items that are not loaded if ( !ended && !data[newData.key()] && marker && newData.compareTo(marker) > 0) retur...
javascript
{ "resource": "" }
q61861
addChildren
validation
function addChildren(newData) { var promises = []; newData.forEach(function (child) { promises.push(add(child)); }); return Promise.all(promises).then(emitValue); }
javascript
{ "resource": "" }
q61862
modalOpen
validation
function modalOpen (options) { if (isString(options)) options = optionsFromTarget(options); var modal = select('#d3-view-modal'); if (!modal.size()) select('body').append('modal').mount(options, vm => vm.model.$showModal()); else modal.model().$update(options).$showModal(); }
javascript
{ "resource": "" }
q61863
ColorCommand
validation
function ColorCommand(args) { var parsed = new statements.ArgumentStatement(args); if (parsed.args.length < 3) throw new SyntaxError('COLOR command requires 3 arguments'); this.red = parsed.args[0]; this.green = parsed.args[1]; this.blue = parsed.args[2]; this.alpha = parsed.args.length > 3 ? p...
javascript
{ "resource": "" }
q61864
onChange
validation
function onChange () { if (props.onChange) { var changeHandlers = [...props.onChange] var value = editor.getValue() return changeHandlers.map((f) => f(value)) } }
javascript
{ "resource": "" }
q61865
PrintCommand
validation
function PrintCommand(args, define) { if (args[args.length - 1] === ";") { this.noLine = true; args = args.substr(-1); } else this.noLine = false; var parsed = new statements.ArgumentStatement(args, { flags: ['USING'], parseArgs: false }); if (parsed.flags.USING) { ...
javascript
{ "resource": "" }
q61866
intoExport
validation
function intoExport(obj) { for (var k in obj) { if (!obj.hasOwnProperty(k)) continue; exports[k] = obj[k]; } }
javascript
{ "resource": "" }
q61867
charAt
validation
function charAt(index) { return value => value.length <= index ? undefined : value.charAt(index); }
javascript
{ "resource": "" }
q61868
replace
validation
function replace(target, replaceWith) { function escapeRegExp(str) { return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string } return target instanceof RegExp ? value => value.replace(target, replaceWith) : replace(new RegExp(escapeRegExp(target)...
javascript
{ "resource": "" }
q61869
ExpressionStatement
validation
function ExpressionStatement(data, define) { this.child = parseExpression(data, define ? define.line : 'unknown'); if (this.child instanceof SyntaxError) throw this.child; else if (this.child.error) throw this.child.error; }
javascript
{ "resource": "" }
q61870
cleanLines
validation
function cleanLines(block, lines) { var removeFirst = false if (lines.length && emptyRegex.test(lines[0].str)) { block.line += 1 block.size -= 1 removeFirst = true } return lines.filter(function (each, i) { return !(!i && removeFirst) && !commentRegex.test(each.str) }) }
javascript
{ "resource": "" }
q61871
drawAllDataPoints
validation
function drawAllDataPoints(animationDecimal){ var rotationDegree = (2*Math.PI)/data.datasets[0].data.length; ctx.save(); //translate to the centre of the canvas. ctx.translate(width/2,height/2); //We accept multiple data sets for radar charts, so show loop through each set for (var i=0; i<data.da...
javascript
{ "resource": "" }
q61872
populateLabels
validation
function populateLabels(labelTemplateString, labels, numberOfSteps, graphMin, stepValue) { if (labelTemplateString) { //Fix floating point errors by setting to fixed the on the same decimal as the stepValue. for (var i = 1; i < numberOfSteps + 1; i++) { labels.push(tmpl(l...
javascript
{ "resource": "" }
q61873
validation
function(path){ var xhr=new XMLHttpRequest; xhr.open('GET',baseUrl+'web/'+path+'.js', false); xhr.send(); if(xhr.status !== 200) new FatalError(/*#if DEV*/'Unable to load: '+path+'.js'/*#/if*/); var s = document.createElement('script'); s.type = "text/javascript"; s.text = xhr.responseText; document.getElement...
javascript
{ "resource": "" }
q61874
TcolorCommand
validation
function TcolorCommand(args) { var parsed = new statements.ArgumentStatement(args); if (parsed.args.length < 3) throw new SyntaxError('TCOLOR command requires 3 arguments'); this.red = parsed.args[0]; this.green = parsed.args[1]; this.blue = parsed.args[2]; }
javascript
{ "resource": "" }
q61875
publish
validation
function publish(subject, op, target) { try { var type = (_.isString(target)) ? target : target.type; var topic = getTopic(type); // optimization: would be nice to tell if there are subscribers before I bother to create var event = new Event(subject, op, target); provider.publish(topic, event); ...
javascript
{ "resource": "" }
q61876
ExecutionContext
validation
function ExecutionContext(options) { EventEmitter.call(this); this.stringVars = {}; this.numberVars = {}; this.pointers = {}; this.gosubs = []; this.private = { rnd_seed: Math.random(), sprites: [], data: [] }; this.constants = require('./constants'); this.ru...
javascript
{ "resource": "" }
q61877
setArrayIndexAt
validation
function setArrayIndexAt(arr, dimensions, val, data) { var currentDimension = dimensions[0].execute(data); data.validate(currentDimension, 'number'); currentDimension -= 1; if (currentDimension < 0) currentDimension = 0; if (arr.length <= currentDimension) throw new Error('Invalid array bounds'); ...
javascript
{ "resource": "" }
q61878
getArrayIndexAt
validation
function getArrayIndexAt(arr, dimensions, data) { var currentDimension = dimensions[0]; data.validate(currentDimension, 'number'); currentDimension = Math.max(0, Math.floor(currentDimension - 1)); if (arr.length <= currentDimension) throw new Error('Invalid array bounds'); var item = arr[currentDim...
javascript
{ "resource": "" }
q61879
createArrayDepth
validation
function createArrayDepth(dimensions, endpoint) { var currentDimension = dimensions[0]; var newArr = new Array(currentDimension); for (var i = 0; i < currentDimension; i++) { var value = endpoint; if (dimensions.length > 1) value = createArrayDepth(dimensions.slice(1), endpoint); ne...
javascript
{ "resource": "" }
q61880
validation
function (section) { section.children.forEach(function (child) { if (child.type === 'section') { finalParse(child) } else if (child.type === 'text' || child.type === 'value' || child.type === 'code') { var sliceStart = child.line - 1, sliceEnd = child.line + child.size - 1, subLines = ...
javascript
{ "resource": "" }
q61881
takeHeader
validation
function takeHeader(content, level, name) { var currLevel = sectionStack.length if (level > currLevel + 1) { throwSyntaxError('Unexpected header level ' + level + ' on section level ' + currLevel) } else if (level === 1) { throwSyntaxError('There can be only one header level 1, the first line of the file')...
javascript
{ "resource": "" }
q61882
throwSyntaxError
validation
function throwSyntaxError(message, errorLine, size) { errorLine = errorLine === undefined ? line : errorLine size = size === undefined ? 1 : size var snippet = getSnippet(source, errorLine, size), err = new SyntaxError(message + '\n' + snippet) err.line = errorLine throw err }
javascript
{ "resource": "" }
q61883
appendLine
validation
function appendLine(type) { var len = section.children.length if (newBlock || !len || section.children[len - 1].type !== type) { section.children.push({ type: type, line: line, size: 1 }) } else { section.children[len - 1].size += 1 } newBlock = false }
javascript
{ "resource": "" }
q61884
on
validation
function on(event, cb, context) { var args = Array.prototype.slice.call(arguments, 0); return dom.on.apply(false, [this].concat(args)); }
javascript
{ "resource": "" }
q61885
detach
validation
function detach(node) { if (node.placeholder instanceof HTMLElement === false) { node.placeholder = createPlaceholder(node.data.tag || node.el.tagName); } if (node && node.el && node.el.parentNode) { node.el.parentNode.replaceChild(node.placeholder, no...
javascript
{ "resource": "" }
q61886
attach
validation
function attach(node) { if (node && node.el && node.placeholder && node.placeholder.parentNode) { node.placeholder.parentNode.replaceChild(node.el, node.placeholder); } }
javascript
{ "resource": "" }
q61887
append
validation
function append(parent, child) { if (parent.el !== undefined && child.el !== undefined) { parent.el.appendChild(child.el); } }
javascript
{ "resource": "" }
q61888
insertBefore
validation
function insertBefore(parent, child, index) { var parentEl = parent.el, childEl = child.el; if (parentEl !== undefined && childEl !== undefined) { if (parentEl.childNodes[index] !== undefined) { parentEl.insertBefore(childEl, parentEl.childNode...
javascript
{ "resource": "" }
q61889
changePosition
validation
function changePosition(el, index) { var HTMLElement = el.el; if (HTMLElement && HTMLElement.parentNode) { var parentNode = HTMLElement.parentNode, elGroup = el.elGroup, size = elGroup.size, target = elGroup.getKeyByIn...
javascript
{ "resource": "" }
q61890
text
validation
function text(node, _text2) { if (node && node.el) { node.el.innerHTML = _text2; } }
javascript
{ "resource": "" }
q61891
setAttribute
validation
function setAttribute(node, prop, value) { if (node && node.el) { if (isObject(prop)) { Object.keys(prop).forEach(function (key) { node.el.setAttribute(key, prop[key]); }); } else { node.el.se...
javascript
{ "resource": "" }
q61892
getAttribute
validation
function getAttribute(node, prop) { if (node && node.el) { return node.el.getAttribute(prop); } else { return undefined; } }
javascript
{ "resource": "" }
q61893
removeAttribute
validation
function removeAttribute(node, prop) { if (node && node.el) { node.el.removeAttribute(prop); } }
javascript
{ "resource": "" }
q61894
setStyle
validation
function setStyle(node, prop, value) { if (node && node.el) { if (isObject(prop)) { Object.keys(prop).forEach(function (key) { node.el.style[key] = prop[key]; }); } else { node.el.style[prop] ...
javascript
{ "resource": "" }
q61895
getStyle
validation
function getStyle(node, prop) { if (node && node.el) { if (node.el !== undefined && node.el.style !== undefined) { return node.el.style[prop]; } else { return undefined; } } }
javascript
{ "resource": "" }
q61896
removeStyle
validation
function removeStyle(node, prop) { if (node && node.el) { node.el.style[prop] = ''; } }
javascript
{ "resource": "" }
q61897
addClass
validation
function addClass(node, className) { if (node && node.el) { node.el.classList.add(className); } }
javascript
{ "resource": "" }
q61898
hasClass
validation
function hasClass(node, className) { if (node && node.el) { return node.el.classList.contains(className); } else { return false; } }
javascript
{ "resource": "" }
q61899
removeClass
validation
function removeClass(node, className) { if (node && node.el) { node.el.classList.remove(className); } }
javascript
{ "resource": "" }