_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q63500 | test | function(){
_a(oj.isDOM(this.el), this.typeName, 'constructor did not set this.el')
// Set instance on @el
_setInstanceOnElement(this.el, this)
var u = oj.unionArguments(arguments),
options = u.options,
args = u.args
// Emit as a tag if it isn't quiet or used new keyword... | javascript | {
"resource": ""
} | |
q63501 | test | function($el, args){
// No arguments return the first instance
if (args.length === 0)
return $el[0].oj
// Compile ojml
var r = oj.compile.apply(oj, [{dom: 1, html: 0, cssMap: 1 }].concat(slice.call(args)))
_insertStyles(r.cssMap, {global: 0})
// Reset content and append t... | javascript | {
"resource": ""
} | |
q63502 | _jqGetValue | test | function _jqGetValue($el, args){
var el = $el[0],
child = el.firstChild
// Return the instance if the element has an oj instance
if (oj.isOJInstance(_getInstanceOnElement(el)))
return _getInstanceOnElement(el)
// Parse the text to turn it into bool, number, or string
else if (oj.isDOMT... | javascript | {
"resource": ""
} |
q63503 | test | function(describe) {
if (!Array.isArray(describe.m)) {
return when.reject('no modules in describe message');
}
var allDeps = [];
var modules = describe.m;
for(var i=0;i<modules.length;i++) {
var checkModule = modules[i];
// don't look for dependencies of things that don't have dependencies.
// ... | javascript | {
"resource": ""
} | |
q63504 | main | test | async function main() {
// Initialize the application.
process.title = 'Coveralls.js';
// Parse the command line arguments.
program.name('coveralls')
.description('Send a coverage report to the Coveralls service.')
.version(packageVersion, '-v, --version')
.arguments('<file>').action(file => progra... | javascript | {
"resource": ""
} |
q63505 | Shortline | test | function Shortline(options) {
const self = this;
self._input = (options && options.input) || process.stdin;
self._output = (options && options.output) || process.stderr;
/** Most recent error emitted by the input stream.
* @type {Error}
*/
self.inputError = null;
self._input.on('end', () => {
se... | javascript | {
"resource": ""
} |
q63506 | findElements | test | function findElements(node, name) {
return name in node && Array.isArray(node[name]) ? node[name] : [];
} | javascript | {
"resource": ""
} |
q63507 | main | test | async function main() { // eslint-disable-line no-unused-vars
try {
const coverage = await promises.readFile('/path/to/coverage.report', 'utf8');
await new Client().upload(coverage);
console.log('The report was sent successfully.');
}
catch (error) {
console.log(`An error occurred: ${error.messag... | javascript | {
"resource": ""
} |
q63508 | TravisStatusHttp | test | function TravisStatusHttp(endpoint, options) {
if (endpoint && typeof endpoint !== 'string') {
throw new TypeError('endpoint must be a string');
}
endpoint = endpoint && trimSlash(endpoint);
if (options && typeof options !== 'object') {
throw new TypeError('options must be an object');
}
options =... | javascript | {
"resource": ""
} |
q63509 | git | test | function git(...args) {
return new Promise((resolve, reject) => {
const child = execFile('git', args, (err, stdout, stderr) => {
if (err) {
reject(err);
} else {
// Creating an object with named properties would probably be clearer
// but this is compatible with thenify/promisi... | javascript | {
"resource": ""
} |
q63510 | SlugDetectionError | test | function SlugDetectionError(message) {
if (!(this instanceof SlugDetectionError)) {
return new SlugDetectionError(message);
}
Error.captureStackTrace(this, SlugDetectionError);
// Like http://www.ecma-international.org/ecma-262/6.0/#sec-error-message
if (message !== undefined) {
Object.defineProperty... | javascript | {
"resource": ""
} |
q63511 | createScopedCss | test | function createScopedCss(html, scope, filepath, cssVariables) {
scope = typeof scope === 'string' ? {ns: scope, vars: new Map()} : scope;
const style = html.match(styleMatcher);
if (!style) {
return [{}, scope.vars, ''];
}
const cssom = css.parse(style[1], {source: filepath});
const vars = new Map(scope.vars.e... | javascript | {
"resource": ""
} |
q63512 | combineCss | test | function combineCss(templates, scopedCss) {
if (!Array.isArray(scopedCss)) {
scopedCss = [scopedCss];
}
return [
...Object.keys(templates).map(name => templates[name].css),
...scopedCss
]
.join('\n').trim();
} | javascript | {
"resource": ""
} |
q63513 | InvalidSlugError | test | function InvalidSlugError(message) {
if (!(this instanceof InvalidSlugError)) {
return new InvalidSlugError(message);
}
Error.captureStackTrace(this, InvalidSlugError);
// Like http://www.ecma-international.org/ecma-262/6.0/#sec-error-message
if (message !== undefined) {
Object.defineProperty(this, '... | javascript | {
"resource": ""
} |
q63514 | checkBuildCommit | test | function checkBuildCommit(build, localCommit) {
const buildCommit = build.commit;
let message = `Build commit ${buildCommit.sha
} does not match ${localCommit.sha}`;
if (localCommit.name) {
message += ` (${localCommit.name})`;
}
// assert gives us useful exception properties for callers
assert.strictE... | javascript | {
"resource": ""
} |
q63515 | trimSlash | test | function trimSlash(string) {
if (typeof string !== 'string') {
return string;
}
if (string.length > 0 && string.charAt(string.length - 1) === '/') {
return string.slice(0, string.length - 1);
}
return string;
} | javascript | {
"resource": ""
} |
q63516 | parseOptions | test | function parseOptions (opts) {
return removeEmpty({
plugins: convertFn.call(this, opts.plugins),
locals: convertFn.call(this, opts.locals),
filename: convertFn.call(this, opts.filename),
parserOptions: convertFn.call(this, opts.parserOptions),
generatorOptions: convertFn.call(this, opts.generatorO... | javascript | {
"resource": ""
} |
q63517 | serializeVerbatim | test | function serializeVerbatim (obj) {
let i = 0
const fns = []
let res = JSON.stringify(obj, (k, v) => {
if (typeof v === 'function') {
fns.push(v.toString())
return `__REPLACE${i++}`
} else {
return v
}
})
res = res.replace(/"__REPLACE(\d{1})"/g, (m, v) => {
return fns[v]
})
... | javascript | {
"resource": ""
} |
q63518 | renderPages | test | function renderPages(filepaths, dest, {templates, vars, statics, disableValidation, cssVariables, host}) {
console.log(`\nGenerating pages...`);
return Promise.all(filepaths.map(filepath => {
return sander.readFile(filepath)
.then(content => renderPage(content, filepath, {templates, vars, dest, cssVariables}))
... | javascript | {
"resource": ""
} |
q63519 | gitUrlPath | test | function gitUrlPath(gitUrl) {
// Foreign URL for remote helper
// See transport_get in transport.c
// Note: url.parse considers second : as part of path. So check this first.
const foreignParts = /^([A-Za-z0-9][A-Za-z0-9+.-]*)::(.*)$/.exec(gitUrl);
if (foreignParts) {
return foreignParts[2];
}
// T... | javascript | {
"resource": ""
} |
q63520 | test | function() {
var appEnv = this.app.env;
if (process.env.DEPLOY_TARGET) {
appEnv = process.env.DEPLOY_TARGET;
}
var publicFiles = new Funnel(this.app.trees.public);
this._requireBuildPackages();
fs.stat(
path.join(this.project.root, 'public', 'robots.txt'),
function(err, stats... | javascript | {
"resource": ""
} | |
q63521 | compileIndex | test | function compileIndex() {
fs.readFile(path.join(__dirname, 'templates', 'index.hogan'), function(err, data) {
if (err) throw err;
// write rendered result to index.html
fs.writeFile(path.join(__dirname, 'index.html'),
hogan.compile(data.toString()).render({
... | javascript | {
"resource": ""
} |
q63522 | sortMentions | test | function sortMentions(mentions) {
return mentions.slice().sort((a, b) => b.length - a.length);
} | javascript | {
"resource": ""
} |
q63523 | findEmoji | test | function findEmoji(names, match) {
const compare = match.toLowerCase();
for (let i = 0; i < names.length; i += 1) {
const name = names[i].toLowerCase();
if (name === compare) {
return names[i];
}
}
return null;
} | javascript | {
"resource": ""
} |
q63524 | fiberize | test | function fiberize(fn){
return function(done){
var self = this;
Fiber(function(){
try{
if(fn.length == 1){
fn.call(self, done);
} else {
fn.call(self);
done();
}
} catch(e) {
process.nextTick(function(){
throw(e);
});... | javascript | {
"resource": ""
} |
q63525 | test | function(regex, type, types, selector) {
var matches = selector.match(regex);
if (matches) {
for (var i = 0; i < matches.length; i++) {
types[type]++;
// Replace this simple selector with whitespace so it won't be counted in further simple selectors
selector = selector.replace(matches[i], ' ')... | javascript | {
"resource": ""
} | |
q63526 | test | function(selector) {
var commaIndex = selector.indexOf(',');
if (commaIndex !== -1) {
selector = selector.substring(0, commaIndex);
}
var types = {
a: 0,
b: 0,
c: 0
};
// Remove the negation psuedo-class (:not) but leave its argument because specificity is calculated on its argument
sel... | javascript | {
"resource": ""
} | |
q63527 | test | function(collectionName, indexName, columns, unique, callback) {
var options = {
indexName: indexName,
columns: columns,
unique: unique
};
return this._run('createIndex', collectionName, options)
.nodeify(callback);
} | javascript | {
"resource": ""
} | |
q63528 | test | function (name, callback) {
return this._run('insert', this.internals.migrationTable, {name: name, run_on: new Date()})
.nodeify(callback);
} | javascript | {
"resource": ""
} | |
q63529 | test | function (name, callback) {
return this._run('insert', this.internals.seedTable, {name: name, run_on: new Date()})
.nodeify(callback);
} | javascript | {
"resource": ""
} | |
q63530 | test | function(err, data) {
if(err) {
prCB(err);
}
prCB(null, data);
db.close();
} | javascript | {
"resource": ""
} | |
q63531 | parseParameters | test | function parseParameters(options) {
var opt = {
maximumAge: 0,
enableHighAccuracy: true,
timeout: Infinity,
interval: 6000,
fastInterval: 1000,
priority: PRIORITY_HIGH_ACCURACY
};
if (options) {
if (options.maximumAge !== undefined && !isNaN(options.maximumAge) && options.maximumAge >... | javascript | {
"resource": ""
} |
q63532 | noProp | test | function noProp(props, propNameOrFunction) {
if (!props) {
throw new Error('Headful: You must pass all declared props when you use headful.props.x() calls.');
}
const propName = typeof propNameOrFunction === 'function' ? propNameOrFunction.name : propNameOrFunction;
return !props.hasOwnProperty(... | javascript | {
"resource": ""
} |
q63533 | GifCli | test | function GifCli(path, callback) {
var frames = [];
OneByOne([
Tmp.dir
, function (next, tmpDir) {
var str = Fs.createReadStream(path)
, isFinished = false
, complete = []
, i = 0
;
str.on("end", function () {
... | javascript | {
"resource": ""
} |
q63534 | shouldLog | test | function shouldLog(testlevel, thresholdLevel) {
var allowed = logLevelAllowedGranular(testlevel);
if (allowed) {
return true;
}
return logLevelAllowed(testlevel, thresholdLevel);
} | javascript | {
"resource": ""
} |
q63535 | test | function() {
if (attrs.type === 'radio') {
return attrs.value || $parse(attrs.ngValue)(scope) || true;
}
var trueValue = ($parse(attrs.ngTrueValue)(scope));
if (angular.isUndefined(trueValue)) {
trueValue = true;
}
return trueValue;
... | javascript | {
"resource": ""
} | |
q63536 | test | function(attrName) {
var map = {
'switchRadioOff': getBooleanFromStringDefTrue,
'switchActive': function(value) {
return !getBooleanFromStringDefTrue(value);
},
'switchAnimate': getBooleanFromStringDefTrue,
'switchLabel': function(value... | javascript | {
"resource": ""
} | |
q63537 | test | function() {
// if it's the first initialization
if (!isInit) {
var viewValue = (controller.$modelValue === getTrueValue());
isInit = !isInit;
// Bootstrap the switch plugin
element.bootstrapSwitch({
radioAllOff: getSwitchAttrValue('switc... | javascript | {
"resource": ""
} | |
q63538 | test | function () {
attrs.$observe('switchActive', function (newValue) {
var active = getBooleanFromStringDefTrue(newValue);
// if we are disabling the switch, delay the deactivation so that the toggle can be switched
if (!active) {
$timeout(setActive);
... | javascript | {
"resource": ""
} | |
q63539 | test | function () {
if (attrs.type === 'radio') {
// when the switch is clicked
element.on('change.bootstrapSwitch', function (e) {
// discard not real change events
if ((controller.$modelValue === controller.$viewValue) && (e.target.checked !== $(e.target).boots... | javascript | {
"resource": ""
} | |
q63540 | test | function (n) {
var r,
i,
c = parseCookies();
if (typeof n === 'string') {
r = (c[n] !== undef) ? c[n] : null;
} else if (typeof n === 'object' && n !== null) {
r = {};
fo... | javascript | {
"resource": ""
} | |
q63541 | test | function (p) {
var n,
r = {},
c = parseCookies();
if (typeof p === 'string') {
p = new RegExp(p);
}
for (n in c) {
if (Object.prototype.hasOwnProperty.call(c, n) && n.match(p... | javascript | {
"resource": ""
} | |
q63542 | test | function (n, v, o) {
if (typeof o !== 'object' || o === null) {
o = {};
}
if (v === undef || v === null) {
v = '';
o.expires = new Date();
o.expires.setFullYear(1978);
} else ... | javascript | {
"resource": ""
} | |
q63543 | test | function () {
var r = false,
n = 'test_cookies_jaaulde_js',
v = 'data';
this.set(n, v);
if (this.get(n) === v) {
this.del(n);
r = true;
}
return r;
... | javascript | {
"resource": ""
} | |
q63544 | formatMessage | test | function formatMessage (str) {
return String(str).split('\n')
.map(function(s) {
return s.magenta;
})
.join('\n');
} | javascript | {
"resource": ""
} |
q63545 | createZoomRangePath | test | function createZoomRangePath(options) {
if (!angular.isObject(options.state)) {
options.state = {};
}
if (!angular.isObject(options.state.range)) {
options.state.range = [];
}
} | javascript | {
"resource": ""
} |
q63546 | synchronizeZoom | test | function synchronizeZoom(options, configuration, watcher) {
if (angular.isObject(options.chart) && angular.isObject(options.chart.zoom) && options.chart.zoom.enabled === true) {
// setup onzoomend listener
configuration.zoom.onzoomend = function (domain) {
// update state
Ang... | javascript | {
"resource": ""
} |
q63547 | addSelections | test | function addSelections(chart, selections) {
service.disableSelectionListener = true;
selections.forEach(function (selection) {
chart.select([selection.id], [selection.index]);
});
service.disableSelectionListener = false;
} | javascript | {
"resource": ""
} |
q63548 | applySelection | test | function applySelection(options, chart) {
if (angular.isObject(options.state) && angular.isArray(options.state.selected)) {
// TODO: get new selections
// TODO: get removed selections
// var chartSelections = chart.selected();
// // addedSelections
// var addedSelecti... | javascript | {
"resource": ""
} |
q63549 | createSelectionsPath | test | function createSelectionsPath(options) {
if (!angular.isObject(options.state)) {
options.state = {};
}
if (!angular.isArray(options.state.selected)) {
options.state.selected = [];
}
} | javascript | {
"resource": ""
} |
q63550 | synchronizeSelection | test | function synchronizeSelection(options, configuration, watcher) {
if (angular.isObject(options.chart) && angular.isObject(options.chart.data) && angular.isObject(options.chart.data.selection) && options.chart.data.selection.enabled === true) {
// add onselected listener
configuration.data.onselect... | javascript | {
"resource": ""
} |
q63551 | setupDataSmallWatcher | test | function setupDataSmallWatcher(watcher) {
return watcher.scope.$watch('options.data', function () {
if (angular.isFunction(watcher.dataCallback)) {
watcher.dataCallback();
}
setupDataWatcher(watcher);
}, true);
} | javascript | {
"resource": ""
} |
q63552 | setupDataBigWatcher | test | function setupDataBigWatcher(watcher) {
return watcher.scope.$watch(function () {
if (watcher.scope.options.data && angular.isArray(watcher.scope.options.data)) {
return watcher.scope.options.data.length;
} else {
return 0;
}
}, function () {
if (angular.i... | javascript | {
"resource": ""
} |
q63553 | addIdentifier | test | function addIdentifier() {
$scope.dataAttributeChartID = 'chartid' + Math.floor(Math.random() * 1000000001);
angular.element($element).attr('id', $scope.dataAttributeChartID);
configuration.bindto = '#' + $scope.dataAttributeChartID;
} | javascript | {
"resource": ""
} |
q63554 | loadEntity | test | function loadEntity(name, promise, options) {
if (!name || typeof name !== 'string') throw new Error('Missing required entity name');
if (!promise || !promise.then) throw new Error('Missing required entity promise');
try {
!(0, _validateOptions.default)(options);
} catch (error) {
throw error;
}
v... | javascript | {
"resource": ""
} |
q63555 | generateAction | test | function generateAction(action, keys, values) {
var generatedAction = Object.assign({}, action);
keys.forEach(function (arg, index) {
generatedAction[keys[index]] = values[index];
});
return generatedAction;
} | javascript | {
"resource": ""
} |
q63556 | makeActionCreator | test | function makeActionCreator(type) {
for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
keys[_key - 1] = arguments[_key];
}
if (!type) throw new Error('Type cannot be null/undefined');
return function () {
for (var _len2 = arguments.length, value... | javascript | {
"resource": ""
} |
q63557 | _getRandomDelayBetween | test | function _getRandomDelayBetween (min, max, roundTo) {
return Number(Math.random() * (max - min) + min).toFixed(roundTo);
} | javascript | {
"resource": ""
} |
q63558 | _logDetails | test | function _logDetails (action) {
if (action) {
console.log(`${chalk.white.bgRed(' Prev State:')}
${__toString(state)}`);
console.log(`${chalk.white.bgBlue(' Action:')}
${__toString(action)}`);
} else {
console.log(`${chalk.white.bgGreen(' Next State:')}
${... | javascript | {
"resource": ""
} |
q63559 | _removeSubscribers | test | function _removeSubscribers(aSubscribers, oSubscriber) {
let nUnsubscribed = 0;
if (!isTypeOf(aSubscribers, sNotDefined)) {
let nIndex = aSubscribers.length - 1;
for (; nIndex >= 0; nIndex--) {
if (aSubscribers[nIndex].subscriber === oSubscriber) {
nUnsubscribed++;
aSubscribers.splice(... | javascript | {
"resource": ""
} |
q63560 | _removeSubscribersPerEvent | test | function _removeSubscribersPerEvent(oEventsCallbacks, sChannelId, oSubscriber) {
let nUnsubscribed = 0;
iterateObject(oEventsCallbacks, function (oItem, sEvent) {
const aEventsParts = sEvent.split(':');
let sChannel = sChannelId;
let sEventType = sEvent;
if (aEventsParts[0] === 'global') {
sCh... | javascript | {
"resource": ""
} |
q63561 | _addSubscribers | test | function _addSubscribers(oEventsCallbacks, sChannelId, oSubscriber) {
iterateObject(oEventsCallbacks, function (oItem, sEvent) {
subscribeTo(sChannelId, sEvent, oItem, oSubscriber);
});
} | javascript | {
"resource": ""
} |
q63562 | _getChannelEvents | test | function _getChannelEvents(sChannelId, sEvent) {
if (oChannels[sChannelId] === und) {
oChannels[sChannelId] = {};
}
if (oChannels[sChannelId][sEvent] === und) {
oChannels[sChannelId][sEvent] = [];
}
return oChannels[sChannelId][sEvent];
} | javascript | {
"resource": ""
} |
q63563 | subscribersByEvent | test | function subscribersByEvent(oChannel, sEventName) {
let aSubscribers = [];
if (!isTypeOf(oChannel, sNotDefined)) {
iterateObject(oChannel, function (oItem, sKey) {
if (sKey === sEventName) {
aSubscribers = oItem;
}
});
}
return aSubscribers;
} | javascript | {
"resource": ""
} |
q63564 | subscribeTo | test | function subscribeTo(sChannelId, sEventType, fpHandler, oSubscriber) {
const aChannelEvents = _getChannelEvents(sChannelId, sEventType);
aChannelEvents.push({
subscriber: oSubscriber,
handler: fpHandler
});
} | javascript | {
"resource": ""
} |
q63565 | unsubscribeFrom | test | function unsubscribeFrom(sChannelId, sEventType, oSubscriber) {
const aChannelEvents = _getChannelEvents(sChannelId, sEventType);
for (let nEvent = aChannelEvents.length - 1; nEvent >= 0; nEvent--) {
const oItem = aChannelEvents[nEvent];
if (oItem.subscriber === oSubscriber) {
aChannelEvents.splice(nE... | javascript | {
"resource": ""
} |
q63566 | subscribe | test | function subscribe(oSubscriber) {
const oEventsCallbacks = oSubscriber.events;
if (!oSubscriber || oEventsCallbacks === und) {
return false;
}
iterateObject(oEventsCallbacks, function (oItem, sChannelId) {
if (oChannels[sChannelId] === und) {
oChannels[sChannelId] = {};
}
_addSubscribers(o... | javascript | {
"resource": ""
} |
q63567 | unsubscribe | test | function unsubscribe(oSubscriber) {
let nUnsubscribed = 0;
const oEventsCallbacks = oSubscriber.events;
if (!oSubscriber || oEventsCallbacks === und) {
return false;
}
iterateObject(oEventsCallbacks, function (oItem, sChannelId) {
if (oChannels[sChannelId] === und) {
oChannels[sChannelId] = {};
... | javascript | {
"resource": ""
} |
q63568 | _executeHandler | test | function _executeHandler(oHandlerObject, oData, sChannelId, sEvent) {
oHandlerObject.handler.call(oHandlerObject.subscriber, oData);
if (getDebug()) {
const ErrorHandler = errorHandler();
ErrorHandler.log(sChannelId, sEvent, oHandlerObject);
}
} | javascript | {
"resource": ""
} |
q63569 | publish | test | function publish(sChannelId, sEvent, oData) {
const aSubscribers = copyArray(this.subscribers(sChannelId, sEvent));
let oSubscriber;
const nLenSubscribers = aSubscribers.length;
if (nLenSubscribers === 0) {
return false;
}
oData = preprocessorsPublishData(oData);
while (!!(oSubscriber = aSubscribers.s... | javascript | {
"resource": ""
} |
q63570 | resolveNamespace | test | function resolveNamespace(sNamespace) {
var oObj = root,
aElements = sNamespace.split('.'),
sElement;
while (!!( sElement = aElements.shift() )) {
oObj = oObj[sElement] !== und ? oObj[sElement] : oObj[sElement] = {};
}
return oObj;
} | javascript | {
"resource": ""
} |
q63571 | getResolveDICallback | test | function getResolveDICallback(oMapping) {
return function (sDependency) {
var oPromise = getPromise();
if (!oMapping.__map__[sDependency]) {
return false;
}
oPromise.resolve(oMapping.__map__[sDependency]);
return oPromise;
};
} | javascript | {
"resource": ""
} |
q63572 | getPromiseCallbacks | test | function getPromiseCallbacks(oContext, sType) {
return function () {
var aCompleted, nLenPromises, oDeferred, aPromises, nPromise, oPromise, aResults = [];
oContext.bCompleted = true;
oContext.sType = sType;
oContext.oResult = arguments;
while (oContext.aPending[0]) {
oContext.aPending.shift... | javascript | {
"resource": ""
} |
q63573 | test | function (fpSuccess, fpFailure) {
var oResult = this.oResult;
if (this.bCompleted) {
if (this.sType === 'resolve') {
fpSuccess.apply(fpSuccess, oResult);
} else {
fpFailure.apply(fpFailure, oResult);
}
} else {
this.aPending.push({ resolve: fpSuccess, reject: fpFailur... | javascript | {
"resource": ""
} | |
q63574 | FakeModule | test | function FakeModule(sModuleId, fpCreator) {
if (isTypeOf(fpCreator, sNotDefined)) {
throw new Error('Something goes wrong!');
}
this.creator = fpCreator;
this.instances = {};
this.sModuleId = sModuleId;
} | javascript | {
"resource": ""
} |
q63575 | isJqueryObject | test | function isJqueryObject(oObj) {
var isJquery = false,
$ = getRoot().jQuery;
if ($) {
isJquery = isInstanceOf(oObj, $);
}
return isJquery;
} | javascript | {
"resource": ""
} |
q63576 | isEvent | test | function isEvent(oObj) {
try {
return isInstanceOf(oObj, Event);
} catch (erError) {
// Duck typing detection (If it sounds like a duck and it moves like a duck, it's a duck)
if (oObj.altKey !== und && ( oObj.srcElement || oObj.target )) {
return true;
}
}
return false;
} | javascript | {
"resource": ""
} |
q63577 | addPropertiesAndMethodsToModule | test | function addPropertiesAndMethodsToModule(sModuleId, aDependencies, fpCallback) {
var oPromise;
function success(mapping) {
const oModules = getModules();
var oModule, fpInitProxy;
oModule = oModules[sModuleId].creator.apply(oModules[sModuleId], [].slice.call(arguments, 1));
oModule.__children__ = [... | javascript | {
"resource": ""
} |
q63578 | wrapMethod | test | function wrapMethod(oInstance, sName, sModuleId, fpMethod) {
oInstance[sName] = ( function (sName, fpMethod) {
return function () {
var aArgs = copyArray(arguments);
try {
return fpMethod.apply(this, aArgs);
}
catch (erError) {
const ErrorHandler = errorHandler();
E... | javascript | {
"resource": ""
} |
q63579 | register | test | function register(sModuleId, aDependencies, fpCreator) {
const oModules = getModules();
if (isFunction(aDependencies)) {
fpCreator = aDependencies;
aDependencies = [ '$$_bus', '$$_module', '$$_log', 'gl_Hydra' ];
}
oModules[sModuleId] = new FakeModule(sModuleId, fpCreator);
oModules[sModuleId].depend... | javascript | {
"resource": ""
} |
q63580 | setInstance | test | function setInstance(sModuleId, sIdInstance, oInstance) {
const oModules = getModules();
var oModule = oModules[sModuleId];
if (!oModule) {
fpThrowErrorModuleNotRegistered(sModuleId, true);
}
oModule.instances[sIdInstance] = oInstance;
return oModule;
} | javascript | {
"resource": ""
} |
q63581 | _multiModuleStart | test | function _multiModuleStart(oInstance, aModulesIds, sIdInstance, oData, bSingle) {
var aInstancesIds, aData, aSingle, nIndex, nLenModules, sModuleId;
if (isArray(sIdInstance)) {
aInstancesIds = copyArray(sIdInstance);
}
if (isArray(oData)) {
aData = copyArray(oData);
}
if (isArray(bSingle)) {
aSi... | javascript | {
"resource": ""
} |
q63582 | beforeInit | test | function beforeInit(oInstance, oData, bSingle) {
iterateObject(oModifyInit, function (oMember) {
if (oMember && isTypeOf(oMember, sFunctionType)) {
oMember(oInstance, oData, bSingle);
}
});
} | javascript | {
"resource": ""
} |
q63583 | startSingleModule | test | function startSingleModule(oWrapper, sModuleId, sIdInstance, oData, bSingle) {
const oModules = getModules();
var oModule;
oModule = oModules[sModuleId];
if ( (bSingle && isModuleStarted(sModuleId)) || isModuleStarted(sModuleId, sIdInstance)) {
oWrapper.stop(sModuleId, sIdInstance);
}
if (!isTypeOf(oMod... | javascript | {
"resource": ""
} |
q63584 | _singleModuleStart | test | function _singleModuleStart(oInstance, sModuleId, sIdInstance, oData, bSingle) {
if (!isTypeOf(sIdInstance, 'string')) {
bSingle = oData;
oData = sIdInstance;
sIdInstance = generateUniqueKey();
}
startSingleModule(oInstance, sModuleId, sIdInstance, oData, bSingle);
} | javascript | {
"resource": ""
} |
q63585 | createInstance | test | function createInstance(sModuleId, aDependencies, fpCallback) {
const oModules = getModules();
if (isTypeOf(oModules[sModuleId], sNotDefined)) {
fpThrowErrorModuleNotRegistered(sModuleId, true);
}
addPropertiesAndMethodsToModule(sModuleId, aDependencies, function (oInstance) {
if (!getDebug()) {
i... | javascript | {
"resource": ""
} |
q63586 | getCallbackToSetObjectFromTemplate | test | function getCallbackToSetObjectFromTemplate(oMethodsObject, oPropertiesObject) {
return function (oValue, sKey) {
if (typeof oValue === 'function') {
oMethodsObject[sKey] = getSimpleFunction(oValue);
} else if (isArray(oValue)) {
oPropertiesObject[sKey] = copyArray(oValue);
} else if (typeof o... | javascript | {
"resource": ""
} |
q63587 | startAll | test | function startAll() {
const oModules = getModules();
iterateObject(oModules, function (_oModule, sModuleId) {
if (!isTypeOf(_oModule, sNotDefined)) {
start(sModuleId, generateUniqueKey());
}
});
} | javascript | {
"resource": ""
} |
q63588 | stop | test | function stop(sModuleId, sInstanceId) {
const oModules = getModules();
var oModule;
oModule = oModules[sModuleId];
if (isTypeOf(oModule, sNotDefined)) {
return false;
}
if (!isTypeOf(sInstanceId, sNotDefined)) {
_singleModuleStop(oModule, sInstanceId);
} else {
_multiModuleStop(oModule);
}
... | javascript | {
"resource": ""
} |
q63589 | _multiModuleStop | test | function _multiModuleStop(oModule) {
iterateObject(oModule.instances, function (oInstance) {
if (!isTypeOf(oModule, sNotDefined) && !isTypeOf(oInstance, sNotDefined)) {
oInstance.destroy();
}
});
oModule.instances = {};
} | javascript | {
"resource": ""
} |
q63590 | _singleModuleStop | test | function _singleModuleStop(oModule, sInstanceId) {
var oInstance = oModule.instances[sInstanceId];
if (!isTypeOf(oModule, sNotDefined) && !isTypeOf(oInstance, sNotDefined)) {
oInstance.destroy();
delete oModule.instances[sInstanceId];
}
} | javascript | {
"resource": ""
} |
q63591 | stopAll | test | function stopAll() {
const oModules = getModules();
iterateObject(oModules, function (_oModule, sModuleId) {
if (!isTypeOf(_oModule, sNotDefined)) {
_stopOneByOne(_oModule, sModuleId);
}
});
} | javascript | {
"resource": ""
} |
q63592 | _stopOneByOne | test | function _stopOneByOne(oModule, sModuleId) {
iterateObject(oModule.instances, function (oItem, sInstanceId) {
stop(sModuleId, sInstanceId);
});
} | javascript | {
"resource": ""
} |
q63593 | remove | test | function remove(sModuleId) {
const oModules = getModules();
var oModule = oModules[sModuleId];
if (isTypeOf(oModule, sNotDefined)) {
return null;
}
if (!isTypeOf(oModule, sNotDefined)) {
try {
return Module;
}
finally {
_delete(sModuleId);
createMapping(getMappingMaps(), 'hm_... | javascript | {
"resource": ""
} |
q63594 | _delete | test | function _delete(sModuleId) {
const oModules = getModules();
if (!isTypeOf(oModules[sModuleId], sNotDefined)) {
delete oModules[sModuleId];
return true;
}
return false;
} | javascript | {
"resource": ""
} |
q63595 | main | test | function main() {
return __awaiter(this, void 0, void 0, function () {
var outputDataSize, interval, dataFrame, dateFormat, api;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
outputDataSize = "compact";
if (ar... | javascript | {
"resource": ""
} |
q63596 | test | function(val) {
// here you may parse your format when you build your plugin
var valueInPicker = this.options.itemProperty ? this.pickerValue[this.options.itemProperty] : this.pickerValue;
return (val ? val : valueInPicker);
} | javascript | {
"resource": ""
} | |
q63597 | test | function(val) {
val = this.setValue(val);
if ((val !== false) && (val !== '')) {
if (this.hasInput()) {
this.input.val(this.getValue());
} else {
this.element.data('pickerValue', this.getValue());
... | javascript | {
"resource": ""
} | |
q63598 | test | function(defaultValue) {
// returns the input or element value, as string
defaultValue = defaultValue || this.options.defaultValue;
var val = defaultValue;
if (this.hasInput()) {
val = this.input.val();
} else {
... | javascript | {
"resource": ""
} | |
q63599 | createMarkdownSerializer | test | function createMarkdownSerializer(indentCodeBlocks) {
return {
serialize: (name, suite) => snapshotToMarkdown(name, suite, indentCodeBlocks),
deserialize: markdownToSnapshot,
};
} | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.