Skip to content

Commit

Permalink
fmt helpers.js (StackExchange#3048)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlimoncelli authored Jul 10, 2024
1 parent 8fa1a8d commit d160b82
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions pkg/js/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1936,20 +1936,17 @@ var DISABLE_REPEATED_DOMAIN_CHECK = { skip_fqdn_check: 'true' };
// Go.

function rawrecordBuilder(type) {

return function () {

// Copy the raw args:
var rawArgs = [];
for (var i = 0; i < arguments.length; i++) {
rawArgs.push(arguments[i]);
}

return function (d) {

var record = {
type: type,
};
var record = {
type: type,
};

// Process the args: Functions are executed, objects are assumed to
// be meta and stored, strings are assumed to be args and are
Expand All @@ -1964,13 +1961,13 @@ function rawrecordBuilder(type) {
for (var i = 0; i < rawArgs.length; i++) {
var r = rawArgs[i];
if (_.isFunction(r)) {
r(record);
r(record);
} else if (_.isObject(r)) {
processedMetas.push(r);
processedMetas.push(r);
} else {
processedArgs.push(r);
processedArgs.push(r);
}
};
}
// Store the processed args.
record.args = processedArgs;
record.metas = processedMetas;
Expand Down

0 comments on commit d160b82

Please sign in to comment.