4 function isNothing(subject) {
5 return (typeof subject === 'undefined') || (subject === null);
9 function isObject(subject) {
10 return (typeof subject === 'object') && (subject !== null);
14 function toArray(sequence) {
15 if (Array.isArray(sequence)) return sequence;
16 else if (isNothing(sequence)) return [];
22 function extend(target, source) {
23 var index, length, key, sourceKeys;
26 sourceKeys = Object.keys(source);
28 for (index = 0, length = sourceKeys.length; index < length; index += 1) {
29 key = sourceKeys[index];
30 target[key] = source[key];
38 function repeat(string, count) {
39 var result = '', cycle;
41 for (cycle = 0; cycle < count; cycle += 1) {
49 function isNegativeZero(number) {
50 return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
54 module.exports.isNothing = isNothing;
55 module.exports.isObject = isObject;
56 module.exports.toArray = toArray;
57 module.exports.repeat = repeat;
58 module.exports.isNegativeZero = isNegativeZero;
59 module.exports.extend = extend;