_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
27
233k
language
stringclasses
1 value
meta_information
dict
q12300
train
function () { var connection = this.connection(); // if a connection is defined, get the ID from connection if (connection) { if (!connection.transactionId) { throw new AdapterError(AdapterError.TRANSACTION_NOT_ASSOCIATED); } return (this._id...
javascript
{ "resource": "" }
q12301
train
function (connectionName, callback) { var self = this, _db = Transaction.databases[connectionName], transactionId; // validate db setup prior to every connection. this ensures nothing goes forward post teardown if (!_db) { callback(new AdapterError(AdapterErr...
javascript
{ "resource": "" }
q12302
train
function (connectionName, callback) { var self = this, conn = self.connection(); // if not yet connected, spawn new connection and initiate transaction if (!conn) { self.connect(connectionName, function (error, conn) { if (error) { cal...
javascript
{ "resource": "" }
q12303
train
function (callback) { var conn = this.connection(), id = this._id; // use the raw ID object // prevent new transactions from using this connection. this.disconnect(); // if commit was called with no active conn, it implies, no transact action // was called. as such ...
javascript
{ "resource": "" }
q12304
train
function (callback) { var conn = this.connection(), id = this._id; // use the raw ID object // prevent new transactions from using this connection. this.disconnect(); // if commit was called with no active conn, it implies, no transact action // was called. as such ...
javascript
{ "resource": "" }
q12305
train
function (config) { if (!config) { return; } var replConfig, peerNames, sanitisePeerConfig, source = this.sources[config.identity]; // fn // at this stage, the source should not be there if (source) { source.end(); // in case sources exi...
javascript
{ "resource": "" }
q12306
train
function () { // release all pending connections util.each(this.connections, function (connection, threadId, connections) { try { connection.release(); } catch (e) { } // nothing to do with error delete connections[threadId]; }); ...
javascript
{ "resource": "" }
q12307
train
function (callback) { var self = this; if (!Multiplexer.sources[self._connectionName]) { return callback(new AdapterError(AdapterError.UNKNOWN_CONNECTION)); } Multiplexer.sources[self._connectionName].getConnection(function (error, connection) { if (error) { ret...
javascript
{ "resource": "" }
q12308
train
function (threadId) { Multiplexer.connections[threadId] && Multiplexer.connections[threadId].release();
javascript
{ "resource": "" }
q12309
train
function (connectionName, collectionName, obj, cb) { if (_.isObject(obj)) { try { var modelInstance = new
javascript
{ "resource": "" }
q12310
mapOptions
train
function mapOptions() { return { element: element[0], scope: 'usa', height: scope.height, width: scope.width, fills: { defaultFill: '#b9b9b9' }, data: {}, done: function (datamap) { function redraw() { ...
javascript
{ "resource": "" }
q12311
train
function(path) { // TODO: Does file exist at the file location path? If so, do something about it... //var defaultManager = $.NSFileManager('alloc')('init') //if (defaultManager('fileExistsAtPath',NSlocation)) { // console.log("File already exists!") //} if (!path){ ...
javascript
{ "resource": "" }
q12312
train
function(player, options, ready){ this.player_ = player; // Make a copy of prototype.options_ to protect against overriding global defaults this.options_ = vjs.obj.copy(this.options_); // Updated options with supplied options options = this.options(options); // Get ID from options, element, o...
javascript
{ "resource": "" }
q12313
train
function(tag, options, ready){ this.tag = tag; // Store the original tag used to set options // Make sure tag ID exists tag.id = tag.id || 'vjs_video_' + vjs.guid++; // Set Options // The options argument overrides options set in the video tag // which overrides globally set options. // Th...
javascript
{ "resource": "" }
q12314
train
function (data) { if (!isLog()) { return undefined; } try { _fs.appendFileSync("pkgscript.log", (_utils.now() + " " + data + "\n"), "utf8"); } catch (e) {
javascript
{ "resource": "" }
q12315
train
function (msg) { if (!isLog()) { return undefined; }
javascript
{ "resource": "" }
q12316
setSpawnObject
train
function setSpawnObject(admin) { admin = ((admin === undefined) ? getDefaultAdmin() : admin); if (isLinux && admin) {
javascript
{ "resource": "" }
q12317
install
train
function install(items, callback) { var item = items[next], command = item.command, args = item.args, admin = item.admin, spawnopt = (item.spawnopt || {}), print; // set the spawn object according to the passed admin argument admin = setSpawnObject(admin); // ...
javascript
{ "resource": "" }
q12318
train
function(config, init, callback) { var me = this; // first initialize if (init) { this.init(init); } logger.log2file("\n\n************ Package Script ************************************* process id: " + process.pid); if (confi...
javascript
{ "resource": "" }
q12319
wrapQueryMethod
train
function wrapQueryMethod(fn, ctx) { return function() { // Obtain function arguments var args = [].slice.call(arguments); // Return a thunkified function that receives a done callback return function(done) { // Add a custom callback to provided args a...
javascript
{ "resource": "" }
q12320
wrapConnection
train
function wrapConnection(conn) { // Already wrapped this function? if (conn._coWrapped) { return conn; } // Set flag to avoid re-wrapping conn._coWrapped = true; // Functions to thunkify var queryMethods = [ 'query', 'execute' ];
javascript
{ "resource": "" }
q12321
evaluateCardCodes
train
function evaluateCardCodes(codes) { const len = codes.length if (len === 5) return evaluate5cards.apply(null, codes) if (len === 6) return evaluate6cards.apply(null, codes) if
javascript
{ "resource": "" }
q12322
evaluateBoard
train
function evaluateBoard(board) { if (typeof board !== 'string') throw new Error('board needs to be a string') const
javascript
{ "resource": "" }
q12323
setCardCodes
train
function setCardCodes(set) { const codeSet = new
javascript
{ "resource": "" }
q12324
setStringifyCardCodes
train
function setStringifyCardCodes(set) { const stringSet = new
javascript
{ "resource": "" }
q12325
hash_binary
train
function hash_binary(q, len, k) { var sum = 0 for (var i = 0; i < len; i++) { if (q[i]) { if (len - i - 1 >= k) {
javascript
{ "resource": "" }
q12326
Handle_forEach
train
function Handle_forEach(t, path, aggressive_optimization, possible_undefined) { var arrayName = path.scope.generateUidIdentifier("a"), funcName = path.scope.generateUidIdentifier("f"), iterator = path.scope.generateUidIdentifier("i"), call = t.expressionStatement ( t.callExpression(funcName, [ t.memberExp...
javascript
{ "resource": "" }
q12327
stringifyCardCode
train
function stringifyCardCode(code) { const rank = code & 0b111100 const suit = code & 0b000011
javascript
{ "resource": "" }
q12328
handRank
train
function handRank(val) { if (val > 6185) return HIGH_CARD // 1277 high card if (val > 3325) return ONE_PAIR // 2860 one pair if (val > 2467) return TWO_PAIR // 858 two pair if (val > 1609) return THREE_OF_A_KIND // 858 three-kind if (val > 1599) return STRAIGHT // 10 straig...
javascript
{ "resource": "" }
q12329
handleRoute
train
function handleRoute(seneca, options, request, reply, route, next) { if (options.parseBody) { return ReadBody(request, finish) } finish(null, request.body || {}) // Express requires a body parser to work in production // This util creates a body obj without neededing a parser // but doesn't impact load...
javascript
{ "resource": "" }
q12330
unsecuredRoute
train
function unsecuredRoute(seneca, options, context, method, middleware, route) { const routeArgs = [route.path].concat(middleware).concat([
javascript
{ "resource": "" }
q12331
authRoute
train
function authRoute(seneca, options, context, method, route, middleware, auth) { const opts = { failureRedirect: route.auth.fail, successRedirect: route.auth.pass } const routeArgs = [route.path] .concat([auth.authenticate(route.auth.strategy, opts)]) .concat(middleware) .concat([
javascript
{ "resource": "" }
q12332
initCpt
train
function initCpt(numValues) { var cpt = []; var sum = 0; for(var i=0; i < numValues; i++) { cpt[i] = Math.random(); sum +=
javascript
{ "resource": "" }
q12333
initCptWithParents
train
function initCptWithParents(values, parents, paIndex) { if(parents && parents.length > 0) { if(parents.length === 1 || paIndex === parents.length - 1) { var idx = parents.length === 1 ? 0 : paIndex; var numPaVals = parents[idx].values.length; var cpts = []; for(var i=0; i < num...
javascript
{ "resource": "" }
q12334
async
train
function async(f, args) { return new Promise( function(resolve, reject) { try { var r = f.apply(undefined, args);
javascript
{ "resource": "" }
q12335
isArrayOfArray
train
function isArrayOfArray(o) { if(isArray(o)) { if(o.length > 0) { if(isArray(o[0])) {
javascript
{ "resource": "" }
q12336
setNodeCptProbs
train
function setNodeCptProbs(cpt, probs, index) { if(!isArrayOfArray(cpt)) { for(var i=0; i < cpt.length; i++) { cpt[i] = probs[index][i]; } var nextIndex = index + 1; return nextIndex; } else {
javascript
{ "resource": "" }
q12337
initNodeCpt
train
function initNodeCpt(values, parents, probs) { var cpt = initCptWithParents(values, parents, 0);
javascript
{ "resource": "" }
q12338
normalizeProbs
train
function normalizeProbs(arr) { var probs = []; var sum = 0.0; for (var i=0; i < arr.length; i++) {
javascript
{ "resource": "" }
q12339
normalizeCpts
train
function normalizeCpts(cpts) { var probs = [] for (var i=0; i < cpts.length; i++) {
javascript
{ "resource": "" }
q12340
check
train
function check(cmd, filter, mapping, coefficient = 1) { return new Promise((resolve, reject) => { exec(cmd, (error, stdout) => { if (error) { reject(error) } try {
javascript
{ "resource": "" }
q12341
checkWin32
train
function checkWin32(directoryPath) { if (directoryPath.charAt(1) !== ':') { return new Promise((resolve, reject) => { reject(new InvalidPathError(`The following path is invalid (should be X:\\...): ${directoryPath}`)) }) } return check( `wmic logicaldisk get size,freespace,caption`, driveDa...
javascript
{ "resource": "" }
q12342
checkUnix
train
function checkUnix(directoryPath) { if (!path.normalize(directoryPath).startsWith(path.sep)) { return new Promise((resolve, reject) => { reject(new InvalidPathError(`The following path is invalid (should start by ${path.sep}): ${directoryPath}`))
javascript
{ "resource": "" }
q12343
init
train
function init() { element.wrap('<div class="ng-flat-datepicker-wrapper"></div>'); $compile(template)(scope);
javascript
{ "resource": "" }
q12344
getWeeks
train
function getWeeks (date) { var weeks = []; var date = moment.utc(date); var firstDayOfMonth = moment(date).date(1); var lastDayOfMonth = moment(date).date(date.daysInMonth()); var startDay = moment(firstDayOfMonth); ...
javascript
{ "resource": "" }
q12345
resetSelectedDays
train
function resetSelectedDays () { scope.currentWeeks.forEach(function(week, wIndex){ week.forEach(function(day, dIndex){
javascript
{ "resource": "" }
q12346
getYearsList
train
function getYearsList() { var yearsList = []; for (var i = 2005; i <= moment().year(); i++) {
javascript
{ "resource": "" }
q12347
getDaysNames
train
function getDaysNames () { var daysNameList = []; for (var i = 0; i < 7 ; i++) {
javascript
{ "resource": "" }
q12348
encrypt
train
function encrypt (input, firstKey = 0xAB) { const buf = Buffer.from(input); let key = firstKey; for (let i = 0; i < buf.length; i++) {
javascript
{ "resource": "" }
q12349
encryptWithHeader
train
function encryptWithHeader (input, firstKey = 0xAB) { const msgBuf = encrypt(input, firstKey); const outBuf = Buffer.alloc(msgBuf.length + 4);
javascript
{ "resource": "" }
q12350
decrypt
train
function decrypt (input, firstKey = 0xAB) { const buf = Buffer.from(input); let key = firstKey; let nextKey; for (let i = 0; i < buf.length; i++) {
javascript
{ "resource": "" }
q12351
getPendingPacket
train
function getPendingPacket(ls){ var i; for (i = pendingPackets.length - 1; i >= 0; i--)
javascript
{ "resource": "" }
q12352
UserPacket
train
function UserPacket(commands){ Packet.call(this); this.interval = undefined; // If the packet contains commands if (typeof commands !== 'undefined'){ // If it is a connect packet if (commands === null) { this.header.flags = flags.connect; this.body.commands = [{ get length() { return 8; }, ...
javascript
{ "resource": "" }
q12353
AtemPacket
train
function AtemPacket(msg){ Packet.call(this); this.header.flags = msg[0]>>>3; this.header.uid = msg.readUInt16BE(2); this.header.fs = msg.readUInt16BE(4); this.header.ls = msg.readUInt16BE(10); if ((this.header.flags & flags.unknown) == flags.unknown) console.log('Unknown Packet flag!'); if (state ===...
javascript
{ "resource": "" }
q12354
handleQueue
train
function handleQueue() { const count = commandQueue.length if (count>0) {
javascript
{ "resource": "" }
q12355
generate
train
function generate(schema) { const ret = []; if (!validate(schema)) { return ret; } const fullSample = jsf(schema); if (!fullSample) { return ret; } ret.push({ valid: true, data: fullSample, message: 'should
javascript
{ "resource": "" }
q12356
serversync
train
function serversync(key, action, handler) { var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, _ref$tracing = _ref.tracing, tracing = _ref$tracing === undefined ? false : _ref$tracing, _ref$logger = _ref.logger, logger = _ref$logger === undefined ? console : _re...
javascript
{ "resource": "" }
q12357
_extractLocaleDays
train
function _extractLocaleDays(abbr, locale) { if(abbr) { return cldr ? cldr.extractDayNames(locale).format.abbreviated : ['Mon', 'Tue', 'Wed', 'Thu',
javascript
{ "resource": "" }
q12358
_extractLocaleMonths
train
function _extractLocaleMonths(abbr, locale) { var months = [] if(abbr) { months = cldr ? cldr.extractMonthNames(locale).format.abbreviated : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; } else { months = cldr ? cldr.extractMonthNames(local...
javascript
{ "resource": "" }
q12359
_toordinal
train
function _toordinal(year, month, day) { var days_before_year = ((year - 1) * 365) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) + Math.floor((year - 1) / 400); var days_before_month
javascript
{ "resource": "" }
q12360
leapdays
train
function leapdays(y1, y2) { y1--; y2--; return (Math.floor(y2/4) - Math.floor(y1/4)) - (Math.floor(y2/100)
javascript
{ "resource": "" }
q12361
setlocale
train
function setlocale(locale) { locale = typeof(locale) === "undefined" ? "en_US" : locale; if((cldr && (cldr.localeIds.indexOf(locale.replace(/-/g, '_').toLowerCase()) === -1)) || (!cldr && ((locale.replace(/-/g, '_').toLowerCase() !== "en_us")))) { throw new IllegalLocaleError(); } thi...
javascript
{ "resource": "" }
q12362
timegm
train
function timegm(timegmt) { var year = timegmt[0]; var month = timegmt[1]; var day = timegmt[2]; var hour = timegmt[3]; var minute = timegmt[4]; var second = timegmt[5]; if(month < 1 || month > 12) { throw new IllegalMonthError(); } if(day < 1 || da...
javascript
{ "resource": "" }
q12363
Calendar
train
function Calendar(firstweekday) { this._firstweekday = typeof(firstweekday) === "undefined" ? 0 : firstweekday; if(firstweekday < 0 || firstweekday > 6) {
javascript
{ "resource": "" }
q12364
defaultClientIDHandler
train
function defaultClientIDHandler(args, context, info) { return get(args, [ 'clientID' ]) || get(context,
javascript
{ "resource": "" }
q12365
trimCanvasXY
train
function trimCanvasXY(xy) { if( xy.length === 0 ) return; var last = xy[xy.length-1], i, point; var c = 0; for( i = xy.length-2; i >= 0; i-- ) { point = xy[i]; if( Math.abs(last.x - point.x) === 0 && Math.abs(last.y - point.y) === 0 ) { xy.splice(i, 1);
javascript
{ "resource": "" }
q12366
train
function(backend, name, options) { options = _.extend({keyPath: 'id'}, options || {}); this.options = options;
javascript
{ "resource": "" }
q12367
resolverMiddleware
train
function resolverMiddleware (resolver) { return function (req, res, next) { try { const { source, args, context, info } = req const ctx = { req, res, next } const value = resolver.call(ctx, source, args, context, info) return Promise.resolve(value) .then(result => {
javascript
{ "resource": "" }
q12368
nextMiddleware
train
function nextMiddleware (factory, mw, info) { const { resolved, index, routes, middlewares, errorMiddleware, req, res, metrics } = info const local = { finished: false, timeout: null } // check if the request has already been resolved if (resolved) return // get ...
javascript
{ "resource": "" }
q12369
train
function (source, args, context, info) { // console.log(this.utils.getRootFieldDef(info, '_tableName')) let typeName = this.utils.getReturnTypeName(info) let db = this.globals.db.main
javascript
{ "resource": "" }
q12370
train
function() { var self = this; return Q.ninvoke(fs, 'readdir', path.join(this.backend.options.path, this.name)) .then(function(files) { return Q.all(files.map(function(f) {
javascript
{ "resource": "" }
q12371
train
function(file) { return path.join(this.backend.options.path,
javascript
{ "resource": "" }
q12372
filterStore
train
function filterStore(operation, store, args) { const filter = obj => { switch (operation) { case 'omit': return _.isFunction(args[0]) ? _.omitBy(obj, args[0]) : _.omit(obj, args); case 'pick': return _.isFunction(args[0]) ? _.pickBy(obj, args[0]) ...
javascript
{ "resource": "" }
q12373
defaultConflictResolution
train
function defaultConflictResolution(definition, name, type, tgt, src) { // TODO: Add support for type/field level conflict settings // TODO: Add support for extending types via extend key switch(type) { case 'type': const { query, mutation, subscription } = get(definition, [...
javascript
{ "resource": "" }
q12374
handleConflict
train
function handleConflict(definition, method, name, type, tgt, src) { const _method = method ? method : defaultConflictResolution; // allow the method to be a function that returns the new name // and type configuration if (typeof _method === 'function') { return _method(definition, name, type, tgt, s...
javascript
{ "resource": "" }
q12375
render
train
function render(context, xyPoints, map, canvasFeature) { ctx = context; if( canvasFeature.type === 'Point' ) { renderPoint(xyPoints, this.size); } else if( canvasFeature.type
javascript
{ "resource": "" }
q12376
intersects
train
function intersects(e) { if( !this.showing ) return; var dpp = this.getDegreesPerPx(e.latlng); var mpp = this.getMetersPerPx(e.latlng); var r = mpp * 5; // 5 px radius buffer; var center = { type : 'Point', coordinates : [e.latlng.lng, e.latlng.lat] }; var containerPoint = e....
javascript
{ "resource": "" }
q12377
processBody
train
function processBody(opts, body) { if (body === undefined) { return ''; } const handlers = Object.assign({}, serializers, opts.serializers); const headers = typeof opts.headers === 'object' ? opts.headers : {}; const contentType = Object.keys(headers).reduce((type, header) => { if (typeof type === 'st...
javascript
{ "resource": "" }
q12378
processData
train
function processData(res, data, options) { const handlers = Object.assign({}, deserializers, options.deserializers); const contentType = res.headers['content-type']; const types = typeof contentType === 'string' ? contentType.split(';') : []; // if there are no content types, return the data unmodified if (!...
javascript
{ "resource": "" }
q12379
mongoType
train
function mongoType( typeStr, options ) { const required = typeStr.match(/^(\S+)!$/); const list = typeStr.match(/^\[(\S+)]$/); if (required) { const innerType = required[1]; if (_.includes(SCALARS, innerType)) { options.required = true; } return mongoType(innerType); } else
javascript
{ "resource": "" }
q12380
getTypeInfo
train
function getTypeInfo (obj, info) { const constructorName = _.constructorName(obj) const _info = info || { type: null, name: null, isList: false, isNonNull: false } switch (constructorName) { case 'GraphQLNonNull': _info.isNonNull = true return getTypeInfo(obj.ofType, _info) ...
javascript
{ "resource": "" }
q12381
baseDef
train
function baseDef (info) { const { name, isList, isNonNull } = info const def = { type: isList ? [ name ] : name
javascript
{ "resource": "" }
q12382
resolveBuild
train
function resolveBuild(schema) { const build = _.get(schema, 'definition._build'); return
javascript
{ "resource": "" }
q12383
middleware
train
function middleware(definition, resolver, options) { const customExecution = options.factoryExecution !== false; const resolve = function(source, args, context, info) { // ensure that context is an object and extend it const ctx = _.isObjectLike(context) ? context : {}; Object.assign(ctx, definition.con...
javascript
{ "resource": "" }
q12384
defaultResolveUser
train
function defaultResolveUser(source, args, context, info) { return ( get(args, ['userID']) ||
javascript
{ "resource": "" }
q12385
resolverMiddleware
train
function resolverMiddleware (resolver) { return function (req, res, next) { try { const { source, args, context, info } = req const nonCircularReq = _.omit(req, [ 'context' ]) const ctx = _.assign({}, context, { req: nonCircularReq, res, next }) const value = resolver(source, args, ctx, in...
javascript
{ "resource": "" }
q12386
addTypeFunction
train
function addTypeFunction (typeName, funcName, func) { if (!stringValue(typeName)) { throw new Error('Invalid "typeName" argument, must be String') } else if (!_.isFunction(func) && !stringValue(func)) { throw new Error('Invalid
javascript
{ "resource": "" }
q12387
deleteDefaultResourceAt
train
function deleteDefaultResourceAt(baseDir, resourceName) { shell.ls(path.join(baseDir, 'res/drawable-*')) .forEach(function (drawableFolder) { var imagePath = path.join(drawableFolder, resourceName);
javascript
{ "resource": "" }
q12388
queryTargetScripts
train
function queryTargetScripts(targetDir) { var scripts = []; fs.readdirSync(targetDir).forEach(function (file) { if (!path.basename(file).toLowerCase().match(/.d.ts/g) &&
javascript
{ "resource": "" }
q12389
queryPluginVersion
train
function queryPluginVersion(pluginDir) { var pluginXml = path.join(pluginDir, 'plugin.xml');
javascript
{ "resource": "" }
q12390
setBanner
train
function setBanner() { if (grunt.config.get('app_plugins_mode_release')) { var moduleName = grunt.config.get('app_plugins_work_script_name') + '.js'; var version = grunt.config.get('app_plugins_work_version'); var src = path.join( grunt.config.get('app_plugins...
javascript
{ "resource": "" }
q12391
Api
train
function Api(platform, platformRootDir, events) { // 'platform' property is required as per PlatformApi spec this.platform = platform || 'ios'; this.root = platformRootDir || path.resolve(__dirname, '..'); this.events = events || ConsoleLogger.get(); // NOTE: trick to share one EventEmitter instanc...
javascript
{ "resource": "" }
q12392
parseTargetDevicePreference
train
function parseTargetDevicePreference(value) { if (!value) return null; var map = { 'universal': '"1,2"', 'handset': '"1"', 'tablet': '"2"'}; if (map[value.toLowerCase()]) { return map[value.toLowerCase()];
javascript
{ "resource": "" }
q12393
getDocDom
train
function getDocDom() { return jsdom.jsdom(fs.readFileSync(path.join(grunt.config.g
javascript
{ "resource": "" }
q12394
getExtension
train
function getExtension(file) { var ret; if (file) { var fileTypes = file.split('.'); var len = fileTypes.length; if (0 === len) {
javascript
{ "resource": "" }
q12395
getScriptElements
train
function getScriptElements($typeLazy) { var scripts; var src = $typeLazy.attr("src"); if ("js" === getExtension(src).toLowerCase()) { return $typeLazy; } else { src = path.join(grunt.config.get('tmpdir'), src); if (fs.existsSync(src)) {
javascript
{ "resource": "" }
q12396
prepareAppScriptsInfo
train
function prepareAppScriptsInfo(docDom) { // read index file, and getting target ts files. var appScripts = []; var $appScripts = $(docDom).find('script[type="lazy"]'); var findAppJs = false; $appScripts.each(function () { var $scripts = getScriptElements($(this)); ...
javascript
{ "resource": "" }
q12397
deployToSim
train
function deployToSim(appPath, target) { // Select target device for emulator. Default is 'iPhone-6' if (!target) { return require('./list-emulator-images').run() .then(function (emulators) { if (emulators.length > 0) { target = emulators[0]; } ...
javascript
{ "resource": "" }
q12398
prepareCssModulesInfo
train
function prepareCssModulesInfo(docDom) { var cssModule = { name: '' }, cssModulesInfo = []; $(docDom).find('link[rel="stylesheet"]') .filter(function () { if (grunt.config.get('lib_kind_fileter_enable')) { var type = path.join(grunt.config.get(...
javascript
{ "resource": "" }
q12399
lowerScriptsInfo
train
function lowerScriptsInfo(docDom) { // read index file, and getting target ts files. var $scripts = $(docDom).find('script[src]'); $scripts.each(function () {
javascript
{ "resource": "" }