Created
August 29, 2018 12:22
-
-
Save tiennou/8adabb4cf5398a83108ccc506e23da7a to your computer and use it in GitHub Desktop.
dnscontrol multi-dom aliasing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ALLDOM = function(/* [[base, tld, …] | [dn, …], …], definer */) { | |
var args = Array.prototype.slice.call(arguments) | |
var defined = args.shift() | |
var definer = args.shift() | |
defined.forEach(function(tlds) { | |
var base = null | |
if (Array.isArray(tlds) && tlds.length > 1) { | |
base = tlds.shift() | |
} else { | |
tlds = [tlds] | |
} | |
tlds.map(function(tld) { return [base, tld].filter(function(v) { return v; }).join('.') }).forEach(definer) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment