commit
f6eda46d60
6 changed files with 72 additions and 30 deletions
|
@ -47,7 +47,7 @@ make.fonts = {
|
|||
}
|
||||
s += make.fonts.fontSize();
|
||||
s += " ";
|
||||
s += Make.fonts.fontFamily();
|
||||
s += make.fonts.fontFamily();
|
||||
return "'" + s + "'";
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,28 +3,70 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
make.mime = {
|
||||
type: function () {
|
||||
types: function () {
|
||||
return random.pick([
|
||||
make.mime.standard,
|
||||
make.mime.xml,
|
||||
make.mime.image,
|
||||
make.mime.media,
|
||||
make.mime.form
|
||||
]);
|
||||
},
|
||||
|
||||
standard: function () {
|
||||
return random.pick([
|
||||
"text/html",
|
||||
"text/html; charset=utf-8",
|
||||
"text/plain",
|
||||
"text/css",
|
||||
"text/javascript",
|
||||
"image/jpeg",
|
||||
"image/gif",
|
||||
"image/png",
|
||||
"application/rss+xml",
|
||||
"application/vnd.mozilla.xul+xml",
|
||||
"application/xhtml+xml",
|
||||
"foo/bar",
|
||||
"application/octet-stream",
|
||||
"application/x-shockwave-flash",
|
||||
"application/x-test",
|
||||
]);
|
||||
},
|
||||
|
||||
xml: function () {
|
||||
return random.pick([
|
||||
"application/xml",
|
||||
"text/xml",
|
||||
"application/xhtml+xml",
|
||||
"image/svg+xml",
|
||||
"application/vnd.mozilla.xul+xml",
|
||||
"application/rss+xml",
|
||||
"application/rdf+xml",
|
||||
"application/xslt+xml",
|
||||
]);
|
||||
},
|
||||
|
||||
image: function () {
|
||||
return random.pick([
|
||||
"image/jpeg",
|
||||
"image/gif",
|
||||
"image/png",
|
||||
"image/mng",
|
||||
"image/*",
|
||||
]);
|
||||
},
|
||||
|
||||
media: function () {
|
||||
return random.pick([
|
||||
"audio/mpeg",
|
||||
"audio/ogg",
|
||||
"audio/ogg; codecs=vorbis",
|
||||
"video/ogg",
|
||||
'video/ogg; codecs="theora,vorbis"',
|
||||
"video/ogg; codecs=\"theora, vorbis\"",
|
||||
"video/mp4",
|
||||
'video/mp4; codecs="avc1.42E01E,mp4a.40.2"'
|
||||
"video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\"",
|
||||
]);
|
||||
}
|
||||
},
|
||||
|
||||
form: function () {
|
||||
return random.pick([
|
||||
"application/x-www-form-urlencoded",
|
||||
"multipart/form-data",
|
||||
"text/plain"
|
||||
]);
|
||||
},
|
||||
};
|
||||
|
|
|
@ -39,7 +39,7 @@ make.network = {
|
|||
].join("\n");
|
||||
},
|
||||
PeerConnectionProtocols: function () {
|
||||
return ["turn", "turns", "stun", "stuns"]
|
||||
return ["turn", "turns", "stun", "stuns"];
|
||||
},
|
||||
randomIPv4: function () {
|
||||
return random.pick([random.number(255), make.numbers.number]) + "." +
|
||||
|
@ -48,15 +48,15 @@ make.network = {
|
|||
random.pick([random.number(255), make.numbers.number]);
|
||||
},
|
||||
randomIPv6: function () {
|
||||
return "[" + make.stringFromBlocks([":", function () {
|
||||
return make.strings.digitsHex(random.range(1, 4))
|
||||
}]) + "]"
|
||||
return "[" + make.strings.stringFromBlocks([":", function () {
|
||||
return make.strings.digitsHex(random.range(1, 4));
|
||||
}]) + "]";
|
||||
},
|
||||
goodHostnames: function () {
|
||||
return [
|
||||
"0.0.0.0",
|
||||
"127.0.0.1:8080",
|
||||
]
|
||||
];
|
||||
},
|
||||
badHostnames: function () {
|
||||
return [
|
||||
|
@ -71,7 +71,7 @@ make.network = {
|
|||
"::ffff:192.0.2.128",
|
||||
"2001:db8::1:2",
|
||||
"2001:db8::1:1:1:1:1"
|
||||
]
|
||||
];
|
||||
},
|
||||
randomBitmask: function (list) {
|
||||
if (list.length <= 1) {
|
||||
|
|
|
@ -44,13 +44,13 @@ make.numbers = {
|
|||
return Math.pow(2, random.number(65)) + random.number(3) - 1;
|
||||
},
|
||||
evenNumber: function (number) {
|
||||
return number % 2 == 1 ? ++number : number;
|
||||
return number % 2 === 1 ? ++number : number;
|
||||
},
|
||||
number: function () {
|
||||
let value = random.choose([
|
||||
[10, make.numbers.float],
|
||||
[10, [make.numbers.rangeNumber, make.numbers.tinyNumber]],
|
||||
[1, Make.numbers.unsignedNumber]
|
||||
[1, make.numbers.unsignedNumber]
|
||||
]);
|
||||
return random.chance(10) ? -value : value;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
make.strings = {
|
||||
toString: function (object) {
|
||||
return object ? object.toSource() : '' + object
|
||||
return object ? object.toSource() : '' + object;
|
||||
},
|
||||
string: function (maxlen) {
|
||||
let s = "";
|
||||
|
@ -15,7 +15,7 @@ make.strings = {
|
|||
|
||||
for (let i = 0; i < maxlen; i++) {
|
||||
//s += String.fromCodePoint(Random.pick(make.fonts.layoutCharCodes));
|
||||
s += "A"
|
||||
s += "A";
|
||||
}
|
||||
|
||||
return s;
|
||||
|
|
|
@ -120,13 +120,13 @@ make.text = {
|
|||
[0x1D17B, 0x1D18B],
|
||||
[0x1D1AA, 0x1D1AD],
|
||||
[0x1D242, 0x1D244]
|
||||
])
|
||||
]);
|
||||
},
|
||||
unicodeBMP: function () {
|
||||
return random.item([
|
||||
// BMP = Basic Multilingual Plane
|
||||
[0x0000, 0xFFFF]
|
||||
])
|
||||
]);
|
||||
},
|
||||
unicodeSMP: function () {
|
||||
return random.item([
|
||||
|
@ -136,20 +136,20 @@ make.text = {
|
|||
[0x1B000, 0x1BFFF],
|
||||
[0x1D000, 0x1DFFF],
|
||||
[0x1F000, 0x1FFFF]
|
||||
])
|
||||
]);
|
||||
},
|
||||
unicodeSIP: function () {
|
||||
return random.item([
|
||||
// SIP = Supplementary Ideographic Plane
|
||||
[0x20000, 0x2BFFF],
|
||||
[0x2F000, 0x2FFFF]
|
||||
])
|
||||
]);
|
||||
},
|
||||
unicodeSSP: function () {
|
||||
return random.item([
|
||||
// SSP = Supplementary Special-purpose Plane
|
||||
[0xE0000, 0xE0FFF]
|
||||
])
|
||||
]);
|
||||
},
|
||||
registeredFontFeatures: function () {
|
||||
return random.pick([
|
||||
|
@ -168,23 +168,23 @@ make.text = {
|
|||
'ss14', 'ss15', 'ss16', 'ss17', 'ss18', 'ss19', 'ss20', 'subs', 'sups',
|
||||
'swsh', 'titl', 'tjmo', 'tnam', 'tnum', 'trad', 'twid', 'unic', 'valt',
|
||||
'vatu', 'vert', 'vhal', 'vjmo', 'vkna', 'vkrn', 'vpal', 'vrt2', 'zero'
|
||||
])
|
||||
]);
|
||||
},
|
||||
assignmentOperator: function () {
|
||||
return random.pick([
|
||||
"=", "-=", "+=", "*=", "/="
|
||||
])
|
||||
]);
|
||||
},
|
||||
arithmeticOperator: function () {
|
||||
return random.pick([
|
||||
"%", "-", "+", "*", "/"
|
||||
])
|
||||
]);
|
||||
},
|
||||
currency: function () {
|
||||
return random.pick([
|
||||
// https://en.wikipedia.org/wiki/ISO_4217
|
||||
"USD", "USS", "USN", "EUR", "CHF", "GBP", "XAG", "XBA", "XBB", "XBC",
|
||||
"XBD", "XSU", "XTS", "XXX",
|
||||
])
|
||||
]);
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue