helpders.js: Run prettier.

This commit is contained in:
Tom Limoncelli 2018-01-06 15:13:22 -05:00
parent a03c8f19e8
commit 2dd9049582

View file

@ -221,30 +221,30 @@ var TLSA = recordBuilder('TLSA', {
});
function isStringOrArray(x) {
return _.isString(x) || _.isArray(x);
return _.isString(x) || _.isArray(x);
}
// TXT(name,target, recordModifiers...)
var TXT = recordBuilder("TXT", {
args: [["name", _.isString], ["target", isStringOrArray]],
transform: function(record, args, modifiers) {
record.name = args.name;
// Store the strings twice:
// .target is the first string
// .txtstrings is the individual strings.
// NOTE: If there are more than 1 string, providers should only access
// .txtstrings, thus it doesn't matter what we store in .target.
// However, by storing the first string there, it improves backwards
// compatibility when the len(array) == 1 and (intentionally) breaks
// broken providers early in the integration tests.
if (_.isString(args.target)) {
record.target = args.target;
record.txtstrings = [args.target];
} else {
record.target = args.target[0]
record.txtstrings = args.target;
}
}
var TXT = recordBuilder('TXT', {
args: [['name', _.isString], ['target', isStringOrArray]],
transform: function(record, args, modifiers) {
record.name = args.name;
// Store the strings twice:
// .target is the first string
// .txtstrings is the individual strings.
// NOTE: If there are more than 1 string, providers should only access
// .txtstrings, thus it doesn't matter what we store in .target.
// However, by storing the first string there, it improves backwards
// compatibility when the len(array) == 1 and (intentionally) breaks
// broken providers early in the integration tests.
if (_.isString(args.target)) {
record.target = args.target;
record.txtstrings = [args.target];
} else {
record.target = args.target[0];
record.txtstrings = args.target;
}
},
});
// MX(name,priority,target, recordModifiers...)
@ -604,9 +604,9 @@ function SPF_BUILDER(value) {
// Split a DKIM string if it is >254 bytes.
function DKIM(arr) {
chunkSize = 255;
var R = [];
for (var i = 0, len = arr.length; i < len; i += chunkSize)
R.push(arr.slice(i, i + chunkSize));
return R;
chunkSize = 255;
var R = [];
for (var i = 0, len = arr.length; i < len; i += chunkSize)
R.push(arr.slice(i, i + chunkSize));
return R;
}