_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q59400 | workflowGuidWorkflowLocale | validation | function workflowGuidWorkflowLocale() {
return self.apos.docs.db.ensureIndex({ workflowGuid: 1, workflowLocale: 1 }, { sparse: 1, unique: 1 })
// eslint-disable-next-line handle-callback-err
.catch(function(err) {
return resolveDuplicateDocs()
.then(function() {
... | javascript | {
"resource": ""
} |
q59401 | replaceIdsRecursively | validation | function replaceIdsRecursively(doc) {
_.each(doc, function(val, key) {
if (key === 'workflowGuidAndLocaleDuplicates') {
// Do not alter ids inside the historical archive of
// the original orphaned docs. -Tom
return;
... | javascript | {
"resource": ""
} |
q59402 | fallback | validation | function fallback(callback) {
return async.series([ viaBasis, noBasis ], callback);
function viaBasis(callback) {
return self.apos.migrations.eachDoc({ workflowLocale: basis }, 5, function(doc, callback) {
if (!self.includeType(doc.type)) {
return setImmediate(callback);
... | javascript | {
"resource": ""
} |
q59403 | getWorkflowGuids | validation | function getWorkflowGuids(callback) {
return self.apos.docs.db.findWithProjection(
{ _id: { $in: _.pluck(related, '_id') } },
{ _id: 1, workflowGuid: 1, type: 1 }
).toArray(function(err, guidDocs) {
if (err) {
return fail(err);
}
_.each(guidD... | javascript | {
"resource": ""
} |
q59404 | toAwsParams | validation | function toAwsParams(file) {
var params = {};
var headers = file.s3.headers || {};
for (var header in headers) {
if (header === 'x-amz-acl') {
params.ACL = headers[header];
} else if (header === 'Content-MD5') {
params.ContentMD5 = headers[header];
} else {
params[pascalCase(header... | javascript | {
"resource": ""
} |
q59405 | Publisher | validation | function Publisher(AWSConfig, cacheOptions) {
this.config = AWSConfig;
this.client = new AWS.S3(AWSConfig);
var bucket = this.config.params.Bucket;
if (!bucket) {
throw new Error('Missing `params.Bucket` config value.');
}
// init Cache file
this._cacheFile =
cacheOptions && cacheOptions.cacheFi... | javascript | {
"resource": ""
} |
q59406 | ZarinPal | validation | function ZarinPal(MerchantID, sandbox) {
if (typeof MerchantID === 'string' && MerchantID.length === config.merchantIDLength) {
this.merchant = MerchantID;
} else {
console.error('The MerchantID must be ' + config.merchantIDLength + ' Characters.');
return false;
}
this.sandbox = sandbox || false;
this.url ... | javascript | {
"resource": ""
} |
q59407 | deferred | validation | function deferred() {
var outResolve = function() {}; // will be overwritten
var outReject = function() {}; // will be overwritten
var promise = new Promise(function (resolve, reject) {
outResolve = resolve;
outReject = reject;
});
return {
promise: promise,
resolve: ... | javascript | {
"resource": ""
} |
q59408 | parseResponse | validation | async function parseResponse(header, response, active = false, id) {
const rows = [];
_.each(response, (value, key) => {
let row = [];
if (active) {
_.each(response[key].active, (activeValue) => {
row = [];
// filter by id
if (id === un... | javascript | {
"resource": ""
} |
q59409 | display | validation | async function display(header, items, type, active = false, parse = false, id) {
let rows;
if (type === 'txt') {
await text(header, items);
} else if (type === 'txtHorizontal') {
const opts = {
head: header,
chars: {
top... | javascript | {
"resource": ""
} |
q59410 | _getClusterState | validation | function _getClusterState() {
return k8s.list('app=teraslice', 'pods')
.then(k8sPods => k8sState.gen(k8sPods, clusterState, clusterNameLabel))
.catch((err) => {
// TODO: We might need to do more here. I think it's OK to just
// log though. This only gets... | javascript | {
"resource": ""
} |
q59411 | allocateWorkers | validation | function allocateWorkers(execution) {
const kr = new K8sResource(
'deployments', 'worker', context.sysconfig.teraslice, execution
);
const workerDeployment = kr.resource;
logger.debug(`workerDeployment:\n\n${JSON.stringify(workerDeployment, null, 2)}`);
return k8s.... | javascript | {
"resource": ""
} |
q59412 | getChunk | validation | function getChunk(readerClient, slice, opConfig, logger, metadata) {
const delimiter = opConfig.line_delimiter;
async function getMargin(offset, length) {
let margin = '';
return new Promise(async (resolve) => {
while (margin.indexOf(delimiter) === -1) {
// reader cl... | javascript | {
"resource": ""
} |
q59413 | finishExecution | validation | function finishExecution(exId, err) {
if (err) {
const error = new TSError(err, {
reason: `terminal error for execution: ${exId}, shutting down execution`,
context: {
ex_id: exId,
}
});
logger.error(error);
... | javascript | {
"resource": ""
} |
q59414 | getActiveExecution | validation | function getActiveExecution(exId) {
const str = terminalStatusList().map(state => ` _status:${state} `).join('OR');
const query = `ex_id: ${exId} NOT (${str.trim()})`;
return searchExecutionContexts(query, null, 1, '_created:desc')
.then((ex) => {
if (ex.length === 0)... | javascript | {
"resource": ""
} |
q59415 | gen | validation | function gen(k8sPods, clusterState, clusterNameLabel) {
// Make sure we clean up the old
const hostIPs = _.uniq(_.map(k8sPods.items, 'status.hostIP'));
const oldHostIps = _.difference(_.keys(clusterState), hostIPs);
_.forEach(oldHostIps, (ip) => {
delete clusterState[ip];
});
// Loop ov... | javascript | {
"resource": ""
} |
q59416 | errorHandler | validation | function errorHandler(err) {
// eslint-disable-next-line no-console
const logErr = logger ? logger.error.bind(logger) : console.log;
if (cluster.isMaster) {
logErr(`Error in master with pid: ${process.pid}`);
} else {
logErr(`Error in worker: ${cluster.worker.id} ... | javascript | {
"resource": ""
} |
q59417 | allocateWorkers | validation | function allocateWorkers(execution, numOfWorkersRequested) {
const exId = execution.ex_id;
const jobId = execution.job_id;
const jobStr = JSON.stringify(execution);
const sortedNodes = _.orderBy(clusterState, 'available', 'desc');
let workersRequested = numOfWorkersRequested;
... | javascript | {
"resource": ""
} |
q59418 | getRecord | validation | function getRecord(recordId, indexArg, fields) {
logger.trace(`getting record id: ${recordId}`);
const query = {
index: indexArg || indexName,
type: recordType,
id: recordId
};
if (fields) {
query._source = fields;
}
return... | javascript | {
"resource": ""
} |
q59419 | verifyStatusUpdate | validation | function verifyStatusUpdate(exId, desiredStatus) {
if (!desiredStatus || !_isValidStatus(desiredStatus)) {
const error = new Error(`Invalid Job status: "${desiredStatus}"`);
error.statusCode = 422;
return Promise.reject(error);
}
return getStatus(exId)
... | javascript | {
"resource": ""
} |
q59420 | _attachRoomsSocketIO | validation | function _attachRoomsSocketIO() {
if (!io) return;
// middleware
io.use((socket, next) => {
const {
node_id: nodeId,
} = socket.handshake.query;
if (nodeId) {
logger.info(`node ${nodeId} joining room on connect`);
... | javascript | {
"resource": ""
} |
q59421 | _toRecords | validation | function _toRecords(rawData, delimiter, slice) {
// Since slices with a non-zero chunk offset grab the character
// immediately preceding the main chunk, if one of those chunks has a
// delimiter as the first or second character, it means the chunk starts
// with a complete record. In this case as well ... | javascript | {
"resource": ""
} |
q59422 | raw | validation | function raw(incomingData, logger, opConfig, metadata, slice) {
const data = _toRecords(incomingData, opConfig.line_delimiter, slice);
return data.map((record) => {
try {
return DataEntity.make(
{ data: record },
metadata
);
} catch (err) {... | javascript | {
"resource": ""
} |
q59423 | tsv | validation | function tsv(incomingData, logger, opConfig, metadata, slice) {
return csv(incomingData, logger, opConfig, metadata, slice);
} | javascript | {
"resource": ""
} |
q59424 | TransformStreamCloseReadable | validation | function TransformStreamCloseReadable(transformStream) {
// console.log('TransformStreamCloseReadable()');
if (transformStream._errored === true) {
throw new TypeError('TransformStream is already errored');
}
if (transformStream._readableClosed === true) {
throw new TypeError('Readable side is already... | javascript | {
"resource": ""
} |
q59425 | TransformStreamCloseReadableInternal | validation | function TransformStreamCloseReadableInternal(transformStream) {
assert(transformStream._errored === false);
assert(transformStream._readableClosed === false);
try {
ReadableStreamDefaultControllerClose(transformStream._readableController);
} catch (e) {
assert(false);
}
transformStream._readableC... | javascript | {
"resource": ""
} |
q59426 | pipeLoop | validation | function pipeLoop() {
currentWrite = Promise.resolve();
if (shuttingDown === true) {
return Promise.resolve();
}
return writer._readyPromise.then(() => {
return ReadableStreamDefaultReaderRead(reader).then(({ value, done }) => {
if (done === true) {
... | javascript | {
"resource": ""
} |
q59427 | ReadableStreamAddReadIntoRequest | validation | function ReadableStreamAddReadIntoRequest(stream) {
assert(IsReadableStreamBYOBReader(stream._reader) === true);
assert(stream._state === 'readable' || stream._state === 'closed');
const promise = new Promise((resolve, reject) => {
const readIntoRequest = {
_resolve: resolve,
_reject: reject
... | javascript | {
"resource": ""
} |
q59428 | ReadableStreamReaderGenericCancel | validation | function ReadableStreamReaderGenericCancel(reader, reason) {
const stream = reader._ownerReadableStream;
assert(stream !== undefined);
return ReadableStreamCancel(stream, reason);
} | javascript | {
"resource": ""
} |
q59429 | ReadableStreamDefaultControllerClose | validation | function ReadableStreamDefaultControllerClose(controller) {
const stream = controller._controlledReadableStream;
assert(controller._closeRequested === false);
assert(stream._state === 'readable');
controller._closeRequested = true;
if (controller._queue.length === 0) {
ReadableStreamClose(stream);
}
... | javascript | {
"resource": ""
} |
q59430 | ReadableByteStreamControllerClose | validation | function ReadableByteStreamControllerClose(controller) {
const stream = controller._controlledReadableStream;
assert(controller._closeRequested === false);
assert(stream._state === 'readable');
if (controller._totalQueuedBytes > 0) {
controller._closeRequested = true;
return;
}
if (controller._p... | javascript | {
"resource": ""
} |
q59431 | WritableStreamAddWriteRequest | validation | function WritableStreamAddWriteRequest(stream) {
assert(IsWritableStreamLocked(stream) === true);
assert(stream._state === 'writable');
const promise = new Promise((resolve, reject) => {
const writeRequest = {
_resolve: resolve,
_reject: reject
};
stream._writeRequests.push(writeRequest)... | javascript | {
"resource": ""
} |
q59432 | IsWritableStreamDefaultWriter | validation | function IsWritableStreamDefaultWriter(x) {
if (!typeIsObject(x)) {
return false;
}
if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) {
return false;
}
return true;
} | javascript | {
"resource": ""
} |
q59433 | WritableStreamDefaultWriterAbort | validation | function WritableStreamDefaultWriterAbort(writer, reason) {
const stream = writer._ownerWritableStream;
assert(stream !== undefined);
return WritableStreamAbort(stream, reason);
} | javascript | {
"resource": ""
} |
q59434 | WritableStreamDefaultControllerAbort | validation | function WritableStreamDefaultControllerAbort(controller, reason) {
controller._queue = [];
const sinkAbortPromise = PromiseInvokeOrFallbackOrNoop(controller._underlyingSink, 'abort', [reason],
'close', [controller]);
return sinkAbortPromise.then(() => und... | javascript | {
"resource": ""
} |
q59435 | WritableStreamDefaultControllerError | validation | function WritableStreamDefaultControllerError(controller, e) {
const stream = controller._controlledWritableStream;
assert(stream._state === 'writable' || stream._state === 'closing');
WritableStreamError(stream, e);
controller._queue = [];
} | javascript | {
"resource": ""
} |
q59436 | pipe | validation | function pipe() {
var _this = this;
var items = [];
for (var _i = 0; _i < arguments.length; _i++) {
items[_i] = arguments[_i];
}
var _done = false;
var targets = items.map(wrap_async_iterable_iterator_1.wrapAsyncIterableIterator);
var call = function (methodName, value) {
ret... | javascript | {
"resource": ""
} |
q59437 | validation | function() {
var uris = [];
var db = this.getAnalyser().getDatabase();
function add(classname) {
var def = db.classInfo[classname];
uris.push(def.libraryName + ":" + classname.replace(/\./g, "/") + ".js");
}
this.__loadDeps.forEach(add);
return uris;
} | javascript | {
"resource": ""
} | |
q59438 | validation | function() {
var result = {};
this.__classes.forEach(name => result[name] = true);
this.__expandClassnames(this.getInclude()).forEach(name => result[name] = true);
this.__expandClassnames(this.getExclude()).forEach(name => delete result[name]);
// We sort the result so that we can g... | javascript | {
"resource": ""
} | |
q59439 | validation | function(value, oldValue) {
var loader = path.join(__dirname, "loader-" + (this.isBrowserApp() ? "browser" : "server") + ".tmpl.js");
this.setLoaderTemplate(loader);
this.setTheme(null);
} | javascript | {
"resource": ""
} | |
q59440 | mkpath | validation | function mkpath(dir, cb) {
dir = path.normalize(dir);
var segs = dir.split(path.sep);
var made = "";
async.eachSeries(
segs,
function(seg, cb) {
if (made.length || !seg.length) {
made += "/";
}
made += seg;
fs.exists(made, function(exists) {
if (!e... | javascript | {
"resource": ""
} |
q59441 | validation | function() {
var t = this;
var p;
if (!this.__opened) {
this.__opened = true;
var resManager = null;
if (this.isProcessResources()) {
resManager = new qx.tool.compiler.resources.Manager(this);
}
this.__resManager = resManager;
p = Promise.all... | javascript | {
"resource": ""
} | |
q59442 | validation | function(cb) {
var t = this;
if (!this.__db) {
this.__db = {};
}
async.parallel(
[
// Load Resources
function(cb) {
if (!t.__resManager) {
cb(null);
return;
}
t.__resManager.findA... | javascript | {
"resource": ""
} | |
q59443 | validation | function(cb) {
async.each(t.__libraries,
function(library, cb) {
library.scanForClasses(err => {
log.debug("Finished scanning for " + library.getNamespace());
cb(err);
});
},
... | javascript | {
"resource": ""
} | |
q59444 | validation | function(cb) {
var t = this;
async.waterfall(
[
/**
* Reads the db.json, if it exists
*
* @param cb
*/
function readDb(cb) {
fs.exists(t.getDbFilename(), function(exists) {
if (exists) {
... | javascript | {
"resource": ""
} | |
q59445 | readDb | validation | function readDb(cb) {
fs.exists(t.getDbFilename(), function(exists) {
if (exists) {
fs.readFile(t.getDbFilename(), {encoding: "utf-8"}, cb);
} else {
cb(null, null);
}
});
} | javascript | {
"resource": ""
} |
q59446 | parseDb | validation | function parseDb(data, cb) {
if (data && data.trim().length) {
log.debug("Parsing database");
t.__db = jsonlint.parse(data);
} else {
log.debug("No database to parse");
t.__db = {};
}
cb(null, t.__db)... | javascript | {
"resource": ""
} |
q59447 | validation | function(className) {
let t = this;
// __classes will be null if analyseClasses has not formally been called; this would be if the
// analyser is only called externally for getClass()
if (!t.__classes) {
t.__classes = [];
}
// Add it
if (t.__classes.indexOf(classNam... | javascript | {
"resource": ""
} | |
q59448 | validation | async function(locale) {
var t = this;
var cldr = this.__cldrs[locale];
if (cldr) {
return cldr;
}
return qx.tool.compiler.app.Cldr.loadCLDR(locale)
.then(cldr => t.__cldrs[locale] = cldr);
} | javascript | {
"resource": ""
} | |
q59449 | validation | async function(library, locale) {
var t = this;
var id = locale + ":" + library.getNamespace();
var translation = t.__translations[id];
if (!translation) {
translation = t.__translations[id] = new qx.tool.compiler.app.Translation(library, locale);
await translation.checkRead();
... | javascript | {
"resource": ""
} | |
q59450 | validation | function(library, locales) {
const Promisify = qx.tool.compiler.utils.Promisify;
return Promise.all(locales.map(locale => {
var translation = new qx.tool.compiler.app.Translation(library, locale);
return translation.read()
.then(() => {
let unusedEntries = {};
... | javascript | {
"resource": ""
} | |
q59451 | validation | function(name) {
var t = this;
for (var j = 0; j < t.__libraries.length; j++) {
var library = t.__libraries[j];
var info = library.getSymbolType(name);
if (info) {
return info;
}
}
return null;
} | javascript | {
"resource": ""
} | |
q59452 | validation | function(className) {
var t = this;
var info = this.__classFiles[className];
if (info) {
return info.library;
}
for (var j = 0; j < t.__libraries.length; j++) {
var library = t.__libraries[j];
info = library.getSymbolType(className);
if (info && (inf... | javascript | {
"resource": ""
} | |
q59453 | validation | function(className) {
var library = this.getLibraryFromClassname(className);
if (!library) {
return null;
}
var path = library.getRootDir() + "/" + library.getSourcePath() + "/" + className.replace(/\./g, "/") + ".js";
return path;
} | javascript | {
"resource": ""
} | |
q59454 | validation | function(key, value) {
if (typeof key == "object") {
var map = key;
for (key in map) {
this.__environmentChecks[key] = map[key];
}
} else if (value === undefined) {
delete this.__environmentChecks[key];
} else {
this.__environmentChecks[key] = value;
... | javascript | {
"resource": ""
} | |
q59455 | validation | function() {
if (this.__qooxdooVersion) {
return this.__qooxdooVersion;
}
if (!this.__qooxdooVersion) {
let lib = this.findLibrary("qx");
if (lib) {
this.__qooxdooVersion = lib.getVersion();
}
}
return this.__qooxdooVersion;
} | javascript | {
"resource": ""
} | |
q59456 | validation | function() {
var m = this.__dbFilename.match(/(^.*)\/([^/]+)$/);
var resDb;
if (m && m.length == 3) {
resDb = m[1] + "/resource-db.json";
} else {
resDb = "resource-db.json";
}
return resDb;
} | javascript | {
"resource": ""
} | |
q59457 | validation | function(comment) {
var current = { name: "@description", body: "" };
var cmds = [ current ];
if (typeof comment == "string") {
comment = comment.split("\n");
}
comment.forEach(function(line) {
// Strip optional leading *
line = line.trim();
var m = line.mat... | javascript | {
"resource": ""
} | |
q59458 | validation | function() {
return path.join(process.cwd(), qx.tool.cli.ConfigSchemas.lockfile.filename);
} | javascript | {
"resource": ""
} | |
q59459 | validation | async function() {
let contrib_json_path = this.getContribFileName();
if (!await fs.existsAsync(contrib_json_path)) {
return {
version: qx.tool.cli.ConfigSchemas.lockfile.version,
libraries: []
};
}
return qx.tool.compiler.utils.Json.loadJsonAsync(contrib_json... | javascript | {
"resource": ""
} | |
q59460 | validation | async function(repo_name, library_name) {
let library = (await this.getContribData()).libraries.find(lib => lib.repo_name === repo_name && lib.library_name === library_name);
return library ? library.repo_tag : false;
} | javascript | {
"resource": ""
} | |
q59461 | validation | async function(library_name) {
return (await this.getContribData()).libraries.find(lib => lib.library_name === library_name);
} | javascript | {
"resource": ""
} | |
q59462 | validation | function(readFromFile = false) {
if (!readFromFile && this.__cache && typeof this.__cache == "object") {
return this.__cache;
}
try {
this.__cache = jsonlint.parse(fs.readFileSync(this.getCachePath(), "UTF-8"));
} catch (e) {
this.__cache = {
repos : {
... | javascript | {
"resource": ""
} | |
q59463 | validation | async function() {
await qx.tool.cli.Utils.makeParentDir(this.getCachePath());
await fs.writeFileAsync(this.getCachePath(), JSON.stringify(this.__cache, null, 2), "UTF-8");
} | javascript | {
"resource": ""
} | |
q59464 | validation | async function(path) {
return fs.writeFileAsync(path, JSON.stringify(this.__cache, null, 2), "UTF-8")
.catch(e => console.error(`Error exporting cache to ${path}:` + e.message));
} | javascript | {
"resource": ""
} | |
q59465 | expandMemberExpression | validation | function expandMemberExpression(str) {
var segs = str.split(".");
var expr = types.memberExpression(types.identifier(segs[0]), types.identifier(segs[1]));
for (var i = 2; i < segs.length; i++) {
expr = types.memberExpression(expr, types.identifier(segs[i]));
}
return expr;
} | javascript | {
"resource": ""
} |
q59466 | validation | function(callback) {
var t = this;
var className = this.__className;
t.__fatalCompileError = false;
t.__numClassesDefined = 0;
fs.readFile(this.getSourcePath(), {encoding: "utf-8"}, function(err, src) {
if (err) {
callback(err);
return;
}
try {... | javascript | {
"resource": ""
} | |
q59467 | validation | function(className) {
var pos = className.lastIndexOf(".");
var meta = {
className: className,
packageName: pos > -1 ? className.substring(0, pos) : null,
name: pos > -1 ? className.substring(pos + 1) : className,
superClass: null,
interfaces: [],
... | javascript | {
"resource": ""
} | |
q59468 | validation | function(className) {
if (!this.__metaStack.length) {
throw new Error("No __metaStack entries to pop");
}
let meta = this.__metaStack[this.__metaStack.length - 1];
if (className && meta.className != className) {
throw new Error("Wrong __metaStack entries to pop, expected " + cla... | javascript | {
"resource": ""
} | |
q59469 | validation | function(functionName, node, isClassMember) {
this.__scope = {
functionName: functionName,
parent: this.__scope,
vars: {},
unresolved: {},
isClassMember: !!isClassMember
};
} | javascript | {
"resource": ""
} | |
q59470 | validation | function(node) {
var old = this.__scope;
var scope = this.__scope = this.__scope.parent;
var unresolved = scope.unresolved;
for (var name in old.unresolved) {
var entry = unresolved[name];
if (!entry) {
entry = unresolved[name] = {
name: name,
l... | javascript | {
"resource": ""
} | |
q59471 | validation | function(name, valueName) {
if (this.__scope.vars[name] === undefined) {
this.__scope.vars[name] = valueName || true;
var unresolved = this.__scope.unresolved;
delete unresolved[name];
var re = new RegExp(name + "\\.");
for (var tmp in unresolved) {
if (re.test(tm... | javascript | {
"resource": ""
} | |
q59472 | validation | function(name) {
var pos = name.indexOf(".");
if (pos > -1) {
name = name.substring(0, pos);
}
for (var tmp = this.__scope; tmp; tmp = tmp.parent) {
if (tmp.vars[name] !== undefined) {
return true;
}
}
return false;
} | javascript | {
"resource": ""
} | |
q59473 | validation | function(name, loc) {
var str = "";
for (var i = 0; i < name.length; i++) {
if (i) {
str += ".";
}
str += name[i];
if (qx.tool.compiler.ClassFile.GLOBAL_SYMBOLS[str] || this.isIgnored(str)) {
return;
}
}
name = name.join(".");
if ... | javascript | {
"resource": ""
} | |
q59474 | validation | function(name) {
delete this.__scope.unresolved[name];
var stub = name + ".";
for (var id in this.__scope.unresolved) {
if (id.startsWith(stub)) {
delete this.__scope.unresolved[id];
}
}
} | javascript | {
"resource": ""
} | |
q59475 | validation | function(name) {
var scope = this.__scope;
if (!scope.ignore) {
scope.ignore = {};
}
var segs = name.split(",");
segs.forEach(name => {
if (name.endsWith(".*")) {
scope.ignore[name] = name.substring(0, name.length - 2);
} else if (name.endsWith("*")) {
... | javascript | {
"resource": ""
} | |
q59476 | validation | function(name) {
for (var tmp = this.__scope; tmp; tmp = tmp.parent) {
if (tmp.ignore) {
if (tmp.ignore[name]) {
return true;
}
for (var key in tmp.ignore) {
if (tmp.ignore[key] !== true) {
if (name.startsWith(tmp.ignore[key])) {
... | javascript | {
"resource": ""
} | |
q59477 | validation | function(name, location) {
var t = this;
var requiredOpts = {
load: t.isLoadScope(),
defer: t.__inDefer,
construct: t.__classMeta && t.__classMeta.functionName == "$$constructor",
location: location
};
var dest = t.__environmentChecks.required[name];
if (!de... | javascript | {
"resource": ""
} | |
q59478 | validation | function(name, opts) {
if (qx.lang.Type.isArray(name)) {
name.forEach(name => this._requireClass(name));
return null;
}
let t = this;
if (name == this.__className) {
return null;
}
if (!name) {
throw new Error("No classname");
}
if (this.i... | javascript | {
"resource": ""
} | |
q59479 | validation | function(path) {
if (path.indexOf("/") < 0 && path.indexOf(".") > -1) {
path = path.replace(/\./g, "/");
}
if (!qx.lang.Array.contains(this.__requiredAssets, path)) {
this.__requiredAssets.push(path);
}
} | javascript | {
"resource": ""
} | |
q59480 | validation | function(library, className) {
return pathModule.join(library.getRootDir(), library.getSourcePath(), className.replace(/\./g, pathModule.sep) + ".js");
} | javascript | {
"resource": ""
} | |
q59481 | validation | function(analyser, className) {
var filename = pathModule.join(analyser.getOutputDir(), "transpiled", className.replace(/\./g, pathModule.sep) + ".js");
return filename;
} | javascript | {
"resource": ""
} | |
q59482 | validation | function(array, searchElement) {
var minIndex = 0;
var maxIndex = array.length - 1;
var currentIndex;
var currentElement;
while (minIndex <= maxIndex) {
currentIndex = (minIndex + maxIndex) / 2 | 0;
currentElement = array[currentIndex];
... | javascript | {
"resource": ""
} | |
q59483 | validation | async function() {
let compile = await this.parseCompileConfig();
for (let target of compile.targets) {
await this.__removePath(path.join(process.cwd(), target.outputPath));
}
await this.__removePath(path.join(process.cwd(), "contrib"));
} | javascript | {
"resource": ""
} | |
q59484 | getPages | validation | function getPages(files, metalsmith, done) {
var metadata = metalsmith.metadata();
var pages = [];
var order = {};
if (metadata.site.pages)
metadata.site.pages.forEach((url, index) => typeof url == "string" ? order[url] = index : null);
var unorderedPages = [];
function addPage(url, title) {
v... | javascript | {
"resource": ""
} |
q59485 | loadPartials | validation | function loadPartials(files, metalsmith, done) {
var metadata = metalsmith.metadata();
fs.readdirAsync("./partials", "utf8")
.then(files => {
var promises = files.map(filename => {
var m = filename.match(/^(.+)\.([^.]+)$/);
if (!m)
return;
var name = m[1];
var ... | javascript | {
"resource": ""
} |
q59486 | generateSite | validation | function generateSite() {
return new Promise((resolve, reject) => {
Metalsmith(__dirname)
.metadata({
site: {
title: "Qooxdoo Application Server",
description: "Mini website used by \"qx serve\"",
email: "info@qooxdoo.org",
twitter_username: "qooxdoo",
... | javascript | {
"resource": ""
} |
q59487 | compileScss | validation | function compileScss() {
return new Promise((resolve, reject) => {
sass.render({
file: "sass/qooxdoo.scss",
outFile: "build/qooxdoo.css"
}, function(err, result) {
if (err)
reject(err);
else
resolve(result);
});
})
.then(result => fs.writeF... | javascript | {
"resource": ""
} |
q59488 | validation | function() {
return {
command: "list [repository]",
describe:
"if no repository name is given, lists all available contribs that are compatible with the project's qooxdoo version (\"--all\" lists incompatible ones as well). Otherwise, list all compatible contrib libraries.",
buil... | javascript | {
"resource": ""
} | |
q59489 | validation | async function() {
if (!this.__mtime) {
return this.read();
}
var poFile = this.getPoFilename();
let stat = await qx.tool.compiler.files.Utils.safeStat(poFile);
if (stat && this.__mtime == stat.mtime) {
return undefined;
}
return this.read();
} | javascript | {
"resource": ""
} | |
q59490 | validation | function(filename, cb) {
var t = this;
var lines = [];
function write(key, value) {
if (value === undefined || value === null) {
return;
}
value = value.replace(/\t/g, "\\t").replace(/\r/g, "\\r")
.replace(/\n/g, "\\n")
.replace(/"/g, "\\\""... | javascript | {
"resource": ""
} | |
q59491 | validation | function(id) {
var t = this;
var entry = t.__translations[id];
if (!entry) {
entry = t.__translations[id] = {
msgid: id
};
}
return entry;
} | javascript | {
"resource": ""
} | |
q59492 | validation | async function() {
let {libraries} = await this.getProjectData();
if (libraries instanceof Array && libraries.length) {
return path.resolve(process.cwd(), libraries[0].path);
}
throw new qx.tool.cli.Utils.UserError("Cannot find library path - are you in the right directory?");
} | javascript | {
"resource": ""
} | |
q59493 | validation | async function() {
let {applications} = await this.getProjectData();
if (applications instanceof Array && applications.length) {
return path.resolve(process.cwd(), applications[0].path);
}
throw new qx.tool.cli.Utils.UserError("Cannot find application path - are you in the right director... | javascript | {
"resource": ""
} | |
q59494 | validation | async function(filePath) {
var data = await fs.readFileAsync(filePath, "utf8");
try {
let compileAst = JsonToAst.parseToAst(data, {verbose: true});
let compileJson = JsonToAst.astToObject(compileAst);
return compileJson;
} catch (e) {
throw new qx.tool.cli.Utils.UserErr... | javascript | {
"resource": ""
} | |
q59495 | validation | async function() {
let compileJsonPath = null;
try {
path.join(await this.getApplicationPath(), "compile.json");
} catch (ex) {
// Nothing - cannot find compile.json
}
if (compileJsonPath && await fs.existsAsync(compileJsonPath)) {
let compileConfig = await this.par... | javascript | {
"resource": ""
} | |
q59496 | validation | async function() {
let qxpath = await this.getAppQxPath();
return path.isAbsolute(qxpath) ? qxpath : path.resolve(qxpath);
} | javascript | {
"resource": ""
} | |
q59497 | validation | async function(libPath) {
let manifestPath = path.join(libPath, "Manifest.json");
let manifest = await this.parseJsonFile(manifestPath);
let version;
try {
version = manifest.info.version;
} catch (e) {
throw new qx.tool.cli.Utils.UserError(`No valid version data in manifes... | javascript | {
"resource": ""
} | |
q59498 | validation | function(cmd, args) {
let opts = {env: process.env};
return new Promise((resolve, reject) => {
let exe = child_process.spawn(cmd, args, opts);
// suppress all output unless in verbose mode
exe.stdout.on("data", data => {
if (this.argv.verbose) {
console.log(data... | javascript | {
"resource": ""
} | |
q59499 | validation | function(cmd) {
return new Promise((resolve, reject) => {
child_process.exec(cmd, (err, stdout, stderr) => {
if (err) {
reject(err);
}
if (stderr) {
reject(new Error(stderr));
}
resolve(stdout);
});
});
} | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.