_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q59700 | validation | function (success, fail, args, env) {
var result = new PluginResult(args, env);
args = | javascript | {
"resource": ""
} | |
q59701 | validation | function (success, fail, args, env) {
var result = new PluginResult(args, env); | javascript | {
"resource": ""
} | |
q59702 | mkextract | validation | function mkextract (opts) {
var chunk = null
var indent = 0
var number = 0
opts = merge({}, {
trim: true,
dotted_names: false,
parsers: [
PARSERS.parse_tag,
PARSERS.parse_type,
PARSERS.parse_name,
PARSERS.parse_description
]
}, opts || {})
/**
* Read lines until ... | javascript | {
"resource": ""
} |
q59703 | tokenize | validation | function tokenize(content) {
var tokens = [];
var parser = new htmlparser.Parser({
onopentag: function(name, attribs) { },
ontext: function(text) {
var start = parser.startIndex;
| javascript | {
"resource": ""
} |
q59704 | tokenizeDefine | validation | function tokenizeDefine(infos) {
return tokenize.split(function(text, tok) {
var _infos = _.isFunction(infos)? infos.apply(null, arguments) : _.clone(infos);
if (!_infos) return null;
| javascript | {
"resource": ""
} |
q59705 | tokenizeCheck | validation | function tokenizeCheck() {
var fn = tokenize.serie.apply(tokenize, arguments);
return function(text, opts, callback) {
try {
| javascript | {
"resource": ""
} |
q59706 | parseFile | validation | function parseFile(input) {
fileContent = fs.readFileSync(input, { encoding: "utf-8" }); | javascript | {
"resource": ""
} |
q59707 | softReplace | validation | function softReplace(contentBlock, nativeString, localizedString) {
var escapedString = ignoreExtraSpaces(
ignoreEmptyAttrs(
utils.escapeRegExpSpecialChars(
| javascript | {
"resource": ""
} |
q59708 | generateNonce | validation | function generateNonce(length) {
return generateSecureRandom(length).then((nonce) => {
const nonceString = | javascript | {
"resource": ""
} |
q59709 | _isEqualArray | validation | function _isEqualArray(a, b) {
if (a === b) {
return true;
}
if ((a === undefined) || (b === undefined)) {
return false;
| javascript | {
"resource": ""
} |
q59710 | _destroyNode | validation | function _destroyNode(node) {
// Remove node from linked-list
if (node._next) {
node._next._prev = node._prev;
}
if (node._prev) {
node._prev._next = node._next;
}
else {
this._first = node._next;
}
// Destroy the node... | javascript | {
"resource": ""
} |
q59711 | _contextNext | validation | function _contextNext() {
// Get the next node from the sequence
if (!this._contextState.nextSequence) {
return undefined;
}
if (this._context.reverse) {
this._contextState.nextSequence = this._contextState.nextSequence.getNext();
if (!this._contextSt... | javascript | {
"resource": ""
} |
q59712 | _contextPrev | validation | function _contextPrev() {
// Get the previous node from the sequence
if (!this._contextState.prevSequence) {
return undefined;
}
if (!this._context.reverse) {
this._contextState.prevSequence = this._contextState.prevSequence.getPrevious();
if (!this._... | javascript | {
"resource": ""
} |
q59713 | _contextGet | validation | function _contextGet(contextNodeOrId) {
if (this._nodesById && ((contextNodeOrId instanceof String) || (typeof contextNodeOrId === 'string'))) {
var renderNode = this._nodesById[contextNodeOrId];
if (!renderNode) {
return undefined;
}
// Return ar... | javascript | {
"resource": ""
} |
q59714 | _contextSet | validation | function _contextSet(contextNodeOrId, set) {
var contextNode = this._nodesById ? _contextGet.call(this, contextNodeOrId) : contextNodeOrId;
if (contextNode) {
var node = contextNode.node;
if (!node) {
if (contextNode.next) {
if (contextNode.in... | javascript | {
"resource": ""
} |
q59715 | _resolveConfigSize | validation | function _resolveConfigSize(renderNode) {
if (renderNode instanceof RenderNode) {
var result = null;
var target = renderNode.get();
if (target) {
result = _resolveConfigSize(target);
if (result) {
return result;
... | javascript | {
"resource": ""
} |
q59716 | _getRoundedValue3D | validation | function _getRoundedValue3D(prop, def, precision, lockValue) {
if (!prop || !prop.init) {
return def;
}
return [
prop.enabled[0] ? (Math.round((prop.curState.x + ((prop.endState.x - prop.curState.x) * lockValue)) / precision) | javascript | {
"resource": ""
} |
q59717 | _forEachRenderable | validation | function _forEachRenderable(callback) {
if (this._nodesById) {
for (var key in this._nodesById) {
callback(this._nodesById[key]);
}
}
else {
| javascript | {
"resource": ""
} |
q59718 | _getActualDirection | validation | function _getActualDirection(direction) {
// When the direction is configured in the capabilities, look it up there
if (this._layout.capabilities && this._layout.capabilities.direction) {
// Multiple directions are supported
if (Array.isArray(this._layout.capabilities.direction... | javascript | {
"resource": ""
} |
q59719 | _getViewSequenceAtIndex | validation | function _getViewSequenceAtIndex(index, startViewSequence) {
if (this._viewSequence.getAtIndex) {
return this._viewSequence.getAtIndex(index, startViewSequence);
}
var viewSequence = startViewSequence || this._viewSequence;
var i = viewSequence ? viewSequence.getIndex() : ind... | javascript | {
"resource": ""
} |
q59720 | _mouseDown | validation | function _mouseDown(event) {
// Check whether mouse-scrolling is enabled
if (!this.options.mouseMove) {
return;
}
// Reset any previous mouse-move operation that has not yet been
// cleared.
if (this._scroll.mouseMove) {
this.releaseScrollForce(t... | javascript | {
"resource": ""
} |
q59721 | _touchStart | validation | function _touchStart(event) {
// Create touch-end event listener
if (!this._touchEndEventListener) {
this._touchEndEventListener = function(event2) {
event2.target.removeEventListener('touchend', this._touchEndEventListener);
_touchEnd.call(this, event2);
... | javascript | {
"resource": ""
} |
q59722 | _touchEnd | validation | function _touchEnd(event) {
// Remove touch
var primaryTouch = this._scroll.activeTouches.length ? this._scroll.activeTouches[0] : undefined;
for (var i = 0; i < event.changedTouches.length; i++) {
var changedTouch = event.changedTouches[i];
for (var j = 0; j < this._scr... | javascript | {
"resource": ""
} |
q59723 | _scrollUpdate | validation | function _scrollUpdate(event) {
if (!this.options.enabled) {
return;
}
var offset = | javascript | {
"resource": ""
} |
q59724 | _setParticle | validation | function _setParticle(position, velocity, phase) {
if (position !== undefined) {
//var oldPosition = this._scroll.particle.getPosition1D();
this._scroll.particleValue = position;
this._scroll.particle.setPosition1D(position);
//_log.call(this, 'setParticle.positio... | javascript | {
"resource": ""
} |
q59725 | _calcScrollOffset | validation | function _calcScrollOffset(normalize, refreshParticle) {
// When moving using touch-gestures, make the offset stick to the
// finger. When the bounds is exceeded, decrease the scroll distance
// by two.
if (refreshParticle || (this._scroll.particleValue === undefined)) {
thi... | javascript | {
"resource": ""
} |
q59726 | _snapToPage | validation | function _snapToPage() {
// Check whether pagination is active
if (!this.options.paginated ||
this._scroll.scrollForceCount || //don't paginate while moving
(this._scroll.springPosition !== undefined)) {
return;
}
// When the energy is below the thre... | javascript | {
"resource": ""
} |
q59727 | _normalizePrevViewSequence | validation | function _normalizePrevViewSequence(scrollOffset) {
var count = 0;
var normalizedScrollOffset = scrollOffset;
var normalizeNextPrev = false;
var node = this._nodes.getStartEnumNode(false);
while (node) {
if (!node._invalidated || !node._viewSequence) {
... | javascript | {
"resource": ""
} |
q59728 | _getVisibleItem | validation | function _getVisibleItem(first) {
var result = {};
var diff;
var prevDiff = 10000000;
var diffDelta = (first && this.options.alignment) ? -this._contextSizeCache[this._direction] : ((!first && !this.options.alignment) ? this._contextSizeCache[this._direction] : 0);
var scrollOffs... | javascript | {
"resource": ""
} |
q59729 | _goToSequence | validation | function _goToSequence(viewSequence, next, noAnimation) {
if (noAnimation) {
this._viewSequence = viewSequence;
this._scroll.springPosition = undefined;
_updateSpring.call(this);
this.halt();
this._scroll.scrollDelta = 0;
_setParticle.call(... | javascript | {
"resource": ""
} |
q59730 | _ensureVisibleSequence | validation | function _ensureVisibleSequence(viewSequence, next) {
this._scroll.scrollToSequence = undefined;
this._scroll.scrollToRenderNode = undefined;
| javascript | {
"resource": ""
} |
q59731 | _goToPage | validation | function _goToPage(amount, noAnimation) {
// Get current scroll-position. When a previous call was made to
// `scroll' or `scrollTo` and that node has not yet been reached, then
// the amount is accumalated onto that scroll target.
var viewSequence = (!noAnimation ? this._scroll.scrollT... | javascript | {
"resource": ""
} |
q59732 | _innerRender | validation | function _innerRender() {
var specs = this._specs;
for (var i3 = 0, j3 = specs.length; i3 < j3; i3++) {
if (specs[i3].renderNode) {
specs[i3].target = specs[i3].renderNode.render();
}
}
// Add our cleanup-registration id also to the list, so that ... | javascript | {
"resource": ""
} |
q59733 | _setPullToRefreshState | validation | function _setPullToRefreshState(pullToRefresh, state) {
if (pullToRefresh.state !== state) {
pullToRefresh.state = state;
if (pullToRefresh.node && pullToRefresh.node.setPullToRefreshStatus) | javascript | {
"resource": ""
} |
q59734 | ViewStackLayout | validation | function ViewStackLayout(context, options) {
var set = {
size: context.size,
translate: [0, 0, 0]
};
this._size[0] = context.size[0];
this._size[1] = context.size[1];
var views = context.get('views');
var transferables = context.get('transferables'... | javascript | {
"resource": ""
} |
q59735 | _createLayout | validation | function _createLayout() {
this._renderables = {
views: [],
transferables: []
};
this._viewStack = [];
this.layout = new LayoutController({
layout: ViewStackLayout.bind(this),
layoutOptions: this.options,
| javascript | {
"resource": ""
} |
q59736 | _getViewSpec | validation | function _getViewSpec(item, view, id, callback) {
if (!item.view) {
return;
}
var spec = view.getSpec(id);
if (spec && !spec.trueSizeRequested) {
callback(spec);
}
| javascript | {
"resource": ""
} |
q59737 | _getTransferable | validation | function _getTransferable(item, view, id) {
// 1. If view supports getTransferable, use that
if (view.getTransferable) {
return view.getTransferable(id);
}
// 2. If view is derived from layoutcontroller, use that
if (view.getSpec && view.get && view.replace) {
... | javascript | {
"resource": ""
} |
q59738 | _initTransferableAnimations | validation | function _initTransferableAnimations(item, prevItem, callback) {
var callbackCount = 0;
function waitForAll() {
callbackCount--;
if (callbackCount === 0) {
callback();
}
}
for (var sourceId in item.options.transfer.items) | javascript | {
"resource": ""
} |
q59739 | _endTransferableAnimations | validation | function _endTransferableAnimations(item) {
for (var j = 0; j < item.transferables.length; j++) {
var transferable = item.transferables[j];
for (var i = 0; i < this._renderables.transferables.length; i++) {
if (this._renderables.transferables[i] === transferable.renderNod... | javascript | {
"resource": ""
} |
q59740 | _processAnimations | validation | function _processAnimations(event) {
var prevItem;
for (var i = 0; i < this._viewStack.length; i++) {
var item = this._viewStack[i];
switch (item.state) {
case ItemState.HIDE:
item.state = ItemState.HIDING;
_initHideAnimatio... | javascript | {
"resource": ""
} |
q59741 | _initShowAnimation | validation | function _initShowAnimation(item, prevItem, size) {
var spec = item.options.show.animation ? item.options.show.animation.call(undefined, true, size) : {};
item.startSpec = spec;
item.endSpec = {
opacity: 1,
transform: Transform.identity
};
item.mod.halt();... | javascript | {
"resource": ""
} |
q59742 | _startShowAnimation | validation | function _startShowAnimation(item, spec) {
if (!item.halted) {
var callback = item.showCallback;
if (spec.transform) {
item.mod.setTransform(Transform.identity, item.options.show.transition, callback);
| javascript | {
"resource": ""
} |
q59743 | _haltItemAtFrame | validation | function _haltItemAtFrame(item, perc) {
item.mod.halt();
item.halted = true;
if (item.startSpec && (perc !== undefined)) {
if ((item.startSpec.opacity !== undefined) && (item.endSpec.opacity !== undefined)) {
item.mod.setOpacity(_interpolate(item.startSpec.opacity, it... | javascript | {
"resource": ""
} |
q59744 | _initHideAnimation | validation | function _initHideAnimation(item, prevItem, size) {
var startHideAnimation = _startHideAnimation.bind(this, item, prevItem, size);
if (item.wait) {
| javascript | {
"resource": ""
} |
q59745 | _startHideAnimation | validation | function _startHideAnimation(item, prevItem, size) {
var spec = item.options.hide.animation ? item.options.hide.animation.call(undefined, false, size) : {};
item.endSpec = spec;
item.startSpec = {
opacity: 1,
transform: Transform.identity
};
if (!item.halt... | javascript | {
"resource": ""
} |
q59746 | _setItemOptions | validation | function _setItemOptions(item, options, callback) {
item.options = {
show: {
transition: this.options.show.transition || this.options.transition,
animation: this.options.show.animation || this.options.animation
},
hide: {
transi... | javascript | {
"resource": ""
} |
q59747 | _updateState | validation | function _updateState() {
var prevItem;
var invalidated = false;
var hiddenViewCount = 0;
var i = 0;
while (i < this._viewStack.length) {
if (this._viewStack[i].state === ItemState.HIDDEN) {
hiddenViewCount++;
for (var j = 0; j < this._... | javascript | {
"resource": ""
} |
q59748 | Base | validation | function Base(options) {
this._eventOutput = new EventHandler();
this._pool = [];
EventHandler.setOutputHandler(this, this._eventOutput);
if (options) {
| javascript | {
"resource": ""
} |
q59749 | _getDateFromScrollWheels | validation | function _getDateFromScrollWheels() {
var date = new Date(this._date);
for (var i = 0; i < this.scrollWheels.length; i++) {
var scrollWheel = this.scrollWheels[i];
var component = scrollWheel.component;
var item = scrollWheel.scrollController.getFirstVisibleItem();
... | javascript | {
"resource": ""
} |
q59750 | _createLayout | validation | function _createLayout() {
this.container = new ContainerSurface(
this.options.container
);
this.container.setClasses(this.classes);
this.layout = new LayoutController({
layout: ProportionalLayout,
layoutOptions: {
| javascript | {
"resource": ""
} |
q59751 | _clickItem | validation | function _clickItem(scrollWheel, event) {
if (scrollWheel && event && | javascript | {
"resource": ""
} |
q59752 | _createOverlay | validation | function _createOverlay() {
this.overlay = new LayoutController({
layout: OverlayLayout,
layoutOptions: {
itemSize: this.options.wheelLayout.itemSize
},
| javascript | {
"resource": ""
} |
q59753 | _setSelectedItem | validation | function _setSelectedItem(index) {
if (index !== this._selectedItemIndex) {
var oldIndex = this._selectedItemIndex;
this._selectedItemIndex = index;
this.layout.setLayoutOptions({
selectedItemIndex: index
});
if ((oldIndex >= 0) && this... | javascript | {
"resource": ""
} |
q59754 | _setListeners | validation | function _setListeners() {
this.tabBar.on('tabchange', function(event) {
_updateView.call(this, event);
this._eventOutput.emit('tabchange', {
target: this,
| javascript | {
"resource": ""
} |
q59755 | _updateView | validation | function _updateView(event) {
var index = this.tabBar.getSelectedItemIndex();
this.animationController.halt();
if (index >= 0) {
| javascript | {
"resource": ""
} |
q59756 | _resolveNodeSize | validation | function _resolveNodeSize(node) {
var localItemSize = itemSize;
if (getItemSize) {
localItemSize = getItemSize(node.renderNode, size);
}
if ((localItemSize[0] === true) || (localItemSize[1] === true)) {
var result = context.resolveSize(node, size);
if ... | javascript | {
"resource": ""
} |
q59757 | FontLayout | validation | function FontLayout(context, options) {
// Prepare
size = context.size;
direction = context.direction;
text = options.text || 'KLMNOPQRSTUVW';
spacing = (options.spacing === undefined) ? 10 : options.spacing;
offset = 0;
set.size[0] = options.segmentSize ? option... | javascript | {
"resource": ""
} |
q59758 | removeFromExports | validation | function removeFromExports(exports, dependencies = {}) {
const localExports = { ...exports };
Object.keys(localExports).forEach((exported) => | javascript | {
"resource": ""
} |
q59759 | encode | validation | function encode (payload) {
var checksum = checksumFn(payload)
return base58.encode(Buffer.concat([
| javascript | {
"resource": ""
} |
q59760 | main | validation | function main() {
return new Promise((resolve) => {
fsx.readFile(path.resolve(__dirname, '../package.json'), 'utf8', (err, data) => {
if (err) {
throw err;
}
resolve(data);
});
})
.then((data) => JSON.parse(data))
.then((packageData) => {
const {
author,
... | javascript | {
"resource": ""
} |
q59761 | authTileLoader | validation | function authTileLoader(fetchOptions) {
return function(tile, src) {
fetch(src, fetchOptions)
.then(r => r.blob())
.then((imgData) => {
tile.getImage().src | javascript | {
"resource": ""
} |
q59762 | authVectorTileLoader | validation | function authVectorTileLoader(fetchOptions) {
return function(tile, url) {
const loader = () => {
fetch(url, fetchOptions)
.then(r => r.arrayBuffer())
.then((source) => {
const format = | javascript | {
"resource": ""
} |
q59763 | configureGeojsonSource | validation | function configureGeojsonSource(glSource, mapView, baseUrl, wrapX, fetchOptions) {
const use_bbox = (typeof glSource.data === 'string' && glSource.data.indexOf(BBOX_STRING) >= 0);
const vector_src = new VectorSource({
strategy: use_bbox ? bboxStrategy : allStrategy,
loader: getLoaderFunction(glSource, mapVi... | javascript | {
"resource": ""
} |
q59764 | hydrateLayerGroup | validation | function hydrateLayerGroup(layersDef, layerGroup) {
const hydrated_group = [];
for (let i = 0, ii = layerGroup.length; i < ii; i++) {
// hydrateLayer checks for "ref"
| javascript | {
"resource": ""
} |
q59765 | incrementVersion | validation | function incrementVersion(metadata, version) {
const new_metadata = Object.assign({}, metadata);
new_metadata[version] | javascript | {
"resource": ""
} |
q59766 | placeLayer | validation | function placeLayer(state, layer, targetId) {
const new_layers = state.layers.slice();
const idx1 = getLayerIndexById(new_layers, layer.id);
const idx2 = getLayerIndexById(new_layers, targetId);
| javascript | {
"resource": ""
} |
q59767 | moveGroup | validation | function moveGroup(state, action) {
const place_at = getLayerIndexById(state.layers, action.placeAt);
const n_layers = state.layers.length;
// sanity check the new index.
if (place_at < 0 || place_at > n_layers) {
return state;
}
// find the starting and ending points of the group
let group_start = ... | javascript | {
"resource": ""
} |
q59768 | changeData | validation | function changeData(state, sourceName, data) {
const source = state.sources[sourceName];
if (!source) {
return state;
}
const src_mixin = {};
// update the individual source.
src_mixin[sourceName] = Object.assign({}, source, {
data,
});
| javascript | {
"resource": ""
} |
q59769 | mapDispatchToProps | validation | function mapDispatchToProps(dispatch) {
return {
moveSlide: (count) => {
dispatch(bookmarkAction.moveSlide(count));
},
| javascript | {
"resource": ""
} |
q59770 | addPoints | validation | function addPoints(sourceName, n_points = 10) {
for (let i = 0; i < n_points; i++) {
// the feature is a normal GeoJSON feature definition
store.dispatch(mapActions.addFeatures(sourceName, [{
type: 'Feature',
| javascript | {
"resource": ""
} |
q59771 | stripZeros | validation | function stripZeros(aInput) {
var a = aInput; // eslint-disable-line
var first = a[0]; // eslint-disable-line
while (a.length > 0 && | javascript | {
"resource": ""
} |
q59772 | decodeParams | validation | function decodeParams(names, types, data, useNumberedParams = true) {
// Names is optional, so shift over all the parameters if not provided
if (arguments.length < 3) {
data = types;
types = names;
names = [];
}
data = utils.hexOrBuffer(data);
var values = new Result();
var offset = 0;
types... | javascript | {
"resource": ""
} |
q59773 | encodeSignature | validation | function encodeSignature(method) {
const signature = `${method.name}(${utils.getKeys(method.inputs, 'type').join(',')})`;
const signatureEncoded | javascript | {
"resource": ""
} |
q59774 | encodeMethod | validation | function encodeMethod(method, values) {
const paramsEncoded = encodeParams(utils.getKeys(method.inputs, | javascript | {
"resource": ""
} |
q59775 | decodeLogItem | validation | function decodeLogItem(eventObject, log, useNumberedParams = true) {
if (eventObject && log.topics[0] === eventSignature(eventObject)) {
return | javascript | {
"resource": ""
} |
q59776 | logDecoder | validation | function logDecoder(abi, useNumberedParams = true) {
const eventMap = {}
abi.filter(item => item.type === 'event').map(item => {
eventMap[eventSignature(item)] = item
})
return function(logItems) {
| javascript | {
"resource": ""
} |
q59777 | loader | validation | function loader(content) {
const { addDependency, resource, resourcePath } = this;
// Get callback because the SVG is going to be optimized and that is an async operation
const callback = this.async();
// Parse the loader query and apply the default values in case no values are provided
const { ic... | javascript | {
"resource": ""
} |
q59778 | validation | function() {
var client = redis.client();
return client.keysAsync('bull:*:id').then(function(keys) {
return _.map(keys, | javascript | {
"resource": ""
} | |
q59779 | validation | function(qName) {
if (!qName || qName.length === 0) {
throw new Error('You must specify a queue name.');
}
| javascript | {
"resource": ""
} | |
q59780 | validation | function(qName) {
if (this._q.name !== qName) {
this._q.name = qName;
var queueOpts = {
redis: {
host: redis.redisOpts.host,
port: redis.redisOpts.port,
DB: redis.redisOpts.db,
opts: {
| javascript | {
"resource": ""
} | |
q59781 | validation | function(qName, id) {
var q = queue.get(qName);
return q.getJob(id).then(function(job) {
if (!job) {
return job;
| javascript | {
"resource": ""
} | |
q59782 | validation | function(qName, data, opts) {
var q = queue.get(qName);
return q.add(data, opts).then(function(job) {
| javascript | {
"resource": ""
} | |
q59783 | validation | function(qName, id) {
var q = queue.get(qName);
| javascript | {
"resource": ""
} | |
q59784 | validation | function(qName, type) {
var client = redis.client();
var key = 'bull:' + qName + ':' + type;
if (type === 'wait' || type === 'active') {
return client.llenAsync(key);
} else if (type === 'delayed') {
return | javascript | {
"resource": ""
} | |
q59785 | validation | function(qName, type, offset, limit) {
var q = queue.get(qName);
if (!(offset >= 0)) {
offset = 0;
}
if (!(limit >= 0)) {
limit = 30;
}
if (type === 'wait' || type === 'active') {
return q.getJobs(type, 'LIST', offset, offset + limit - 1).then(function(jobs) {
return Pr... | javascript | {
"resource": ""
} | |
q59786 | validation | function(opts) {
this._client = Promise.promisifyAll(redis.createClient(opts));
if (opts.db) {
| javascript | {
"resource": ""
} | |
q59787 | validation | function() {
var multi = this._client.multi();
| javascript | {
"resource": ""
} | |
q59788 | ial | validation | function ial(app, opts) {
/**
* Lazily creates an i18n.
*
* @api public
*/
Object.defineProperty(app.context, 'i18n', {
get: function () {
if (this._i18n) {
return this._i18n
}
const i18n = new I18n(opts)
i18n.request = this.request
this._i18n = i18n
/... | javascript | {
"resource": ""
} |
q59789 | handleGroup | validation | function handleGroup(self, group, width, maxColumns) {
if (group.length === 0) {
return;
}
var minRows = Math.ceil(group.length / maxColumns);
for (var row = 0; row < minRows; row++) {
for (var col = 0; col < maxColumns; col++) {
var idx | javascript | {
"resource": ""
} |
q59790 | emitKeypressEvents | validation | function emitKeypressEvents(stream, iface) {
if (stream[KEYPRESS_DECODER]) return;
if (StringDecoder === undefined)
StringDecoder = require('string_decoder').StringDecoder;
stream[KEYPRESS_DECODER] = new StringDecoder('utf8');
stream[ESCAPE_DECODER] = emitKeys(stream);
stream[ESCAPE_DECODER].next();
... | javascript | {
"resource": ""
} |
q59791 | cursorTo | validation | function cursorTo(stream, x, y) {
if (stream === null || stream === undefined)
return;
if (typeof x !== 'number' && typeof y !== 'number')
return;
if (typeof x !== 'number')
throw | javascript | {
"resource": ""
} |
q59792 | moveCursor | validation | function moveCursor(stream, dx, dy) {
if (stream === null || stream === undefined)
return;
if (dx < 0) {
stream.write(CSI`${-dx}D`);
} else if (dx > 0) {
stream.write(CSI`${dx}C`);
}
| javascript | {
"resource": ""
} |
q59793 | toCompute | validation | function toCompute(value) {
if(value) {
if(value.isComputed) {
return value;
| javascript | {
"resource": ""
} |
q59794 | HelperOptions | validation | function HelperOptions(scope, nodeList, exprData, stringOnly) {
this.metadata = { rendered: false };
this.stringOnly = stringOnly;
this.scope = | javascript | {
"resource": ""
} |
q59795 | valueShouldBeInsertedAsHTML | validation | function valueShouldBeInsertedAsHTML(value) {
return value !== null && typeof value === "object" && (
typeof value[toDOMSymbol] === "function" || | javascript | {
"resource": ""
} |
q59796 | debuggerHelper | validation | function debuggerHelper (left, right) {
//!steal-remove-start
if (process.env.NODE_ENV !== 'production') {
var shouldBreak = evaluateArgs.apply(null, Array.prototype.slice.call(arguments, 0, -1));
if (!shouldBreak) {
return;
}
var options = arguments[arguments.length - 1],
scope = options && options.sc... | javascript | {
"resource": ""
} |
q59797 | validation | function(helperOptions) {
// lookup
// TODO: remove in prod
// make sure we got called with the right stuff
if(helperOptions.exprData.argExprs.length !== 1) {
throw new Error("for(of) broken syntax");
}
// TODO: check if an instance of helper;
var helperExpr = helperOptions.exprData.argExprs[0].expr;
var v... | javascript | {
"resource": ""
} | |
q59798 | validation | function(process){
var subSection = new TextSection();
this.last().add({process: process, truthy: | javascript | {
"resource": ""
} | |
q59799 | inferType | validation | function inferType(type) {
if (!type) return '';
function iterateTypes(subTree) {
return map(normalizeValue(subTree), inferType).join(', ');
}
switch (type.name) {
case 'arrayOf':
return `array of ${iterateTypes(type.value)}`;
case 'custom':
return COMMON_PROP_TYPES_TO_LINKS_MAP[type.r... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.