const createLog = function (args) { const text = _.toArray(args); text.unshift(APP.NAME_CONSOLE); return text; }
this._request(url, function (error, json) { if (error) return callback(error, json); let data = _.flatten(_.toArray(json.rsp.tags)); return callback(error, data); });
_.toArray(arguments) .map(function(arg) { arg = arg.stack || arg; var name = arg.name || '[ ❌ ERROR ❌ ]'; var log = name.yellow + ' ' + arg.red; return log; })
this._request(url, function (error, json) { if (error) return callback(error, json); let data = { "id": json.rsp.course.id, "title": json.rsp.course.title, "versions": _.flatten(_.toArray(json.rsp.course.versions[1])), "registrations": _.toInteger(json.rsp.course.registrations), "size": _.toInteger(json.rsp.course.size), "tags": _.flatten(_.toArray(json.rsp.course.tags)), "learningStandard": json.rsp.course.learningStandard, "createDate": json.rsp.course.createDate } return callback(error, data); });
function _getColumn(type, jsType) { return function (name) { if (reservedWords[String(name).toLowerCase()]) { console.warn("WARNING! '%s' is a reserved word in CQL!", name); } var statement = { grouping: "column", type: type, jsType: jsType, name: name, options: (jsType !== "PRIMARY_KEY" ? _.toArray(arguments).slice(1) : _.toArray(arguments)) }; this._statements.push(statement); return this; }; }
function error() { console.error(_.toArray(arguments).join(' ').red); }
function _getWith(type) { return function (options) { var statement = { grouping: "with", type: type, value: options, args: _.toArray(arguments) }; this._statements.push(statement); return this; }; }
_.toArray(arguments) .map(function(arg) { if(typeof arg === 'object') { // turn the object to a string so we // can log all the properties and color it var string = JSON.stringify(arg, null, 2); return tag + ' ' + string.cyan; } else { return tag + ' ' + arg.cyan; } })
this._request(url, function (error, json) { if (error) return callback(error, json); let data = []; let courseList = toArray(json.rsp.courselist.course); courseList.forEach(function (course) { data.push({ "id": course.id, "title": course.title, "registrations": _.toInteger(course.registrations), "size": _.toInteger(course.size), "tags": _.flatten(_.toArray(course.tags)), "learningStandard": course.learningStandard, "createDate": course.createDate }); }); return callback(error, data); });
function warn() { console.warning(_.toArray(arguments).join(' ').orange); }
function success() { console.log(_.toArray(arguments).join(' ').green); }
function info() { console.info(colors.blue(_.toArray(arguments).join(' '))); }
this._request(url, function (error, json) { if (error) return callback(error, json); let data = _.flatten(_.toArray(json.rsp.tags)); return callback(error, data); });
function _getAlter(type) { return function () { var statement = { grouping: "alter", type: type, options: _.toArray(arguments) }; this._statements.push(statement); return this; }; }
this._request(url, function (error, json) { if (error) return callback(error, json); let data = _.flatten(_.toArray(json.rsp.tags)); return callback(error, data); });