mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-10-09 05:17:07 +08:00
helpders.js: Run prettier.
This commit is contained in:
parent
a03c8f19e8
commit
2dd9049582
1 changed files with 26 additions and 26 deletions
|
@ -221,30 +221,30 @@ var TLSA = recordBuilder('TLSA', {
|
||||||
});
|
});
|
||||||
|
|
||||||
function isStringOrArray(x) {
|
function isStringOrArray(x) {
|
||||||
return _.isString(x) || _.isArray(x);
|
return _.isString(x) || _.isArray(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TXT(name,target, recordModifiers...)
|
// TXT(name,target, recordModifiers...)
|
||||||
var TXT = recordBuilder("TXT", {
|
var TXT = recordBuilder('TXT', {
|
||||||
args: [["name", _.isString], ["target", isStringOrArray]],
|
args: [['name', _.isString], ['target', isStringOrArray]],
|
||||||
transform: function(record, args, modifiers) {
|
transform: function(record, args, modifiers) {
|
||||||
record.name = args.name;
|
record.name = args.name;
|
||||||
// Store the strings twice:
|
// Store the strings twice:
|
||||||
// .target is the first string
|
// .target is the first string
|
||||||
// .txtstrings is the individual strings.
|
// .txtstrings is the individual strings.
|
||||||
// NOTE: If there are more than 1 string, providers should only access
|
// NOTE: If there are more than 1 string, providers should only access
|
||||||
// .txtstrings, thus it doesn't matter what we store in .target.
|
// .txtstrings, thus it doesn't matter what we store in .target.
|
||||||
// However, by storing the first string there, it improves backwards
|
// However, by storing the first string there, it improves backwards
|
||||||
// compatibility when the len(array) == 1 and (intentionally) breaks
|
// compatibility when the len(array) == 1 and (intentionally) breaks
|
||||||
// broken providers early in the integration tests.
|
// broken providers early in the integration tests.
|
||||||
if (_.isString(args.target)) {
|
if (_.isString(args.target)) {
|
||||||
record.target = args.target;
|
record.target = args.target;
|
||||||
record.txtstrings = [args.target];
|
record.txtstrings = [args.target];
|
||||||
} else {
|
} else {
|
||||||
record.target = args.target[0]
|
record.target = args.target[0];
|
||||||
record.txtstrings = args.target;
|
record.txtstrings = args.target;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// MX(name,priority,target, recordModifiers...)
|
// MX(name,priority,target, recordModifiers...)
|
||||||
|
@ -604,9 +604,9 @@ function SPF_BUILDER(value) {
|
||||||
|
|
||||||
// Split a DKIM string if it is >254 bytes.
|
// Split a DKIM string if it is >254 bytes.
|
||||||
function DKIM(arr) {
|
function DKIM(arr) {
|
||||||
chunkSize = 255;
|
chunkSize = 255;
|
||||||
var R = [];
|
var R = [];
|
||||||
for (var i = 0, len = arr.length; i < len; i += chunkSize)
|
for (var i = 0, len = arr.length; i < len; i += chunkSize)
|
||||||
R.push(arr.slice(i, i + chunkSize));
|
R.push(arr.slice(i, i + chunkSize));
|
||||||
return R;
|
return R;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue