1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-13 03:02:49 +00:00

updated bunch of file paths and changed the way posts are loaded

This commit is contained in:
2016-01-05 12:28:04 -06:00
parent 719ae331ae
commit c96a84d0ff
13249 changed files with 317868 additions and 2101398 deletions

30
node_modules/es5-ext/test/object/_iterate.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
'use strict';
module.exports = function (t, a) {
var o = { raz: 1, dwa: 2, trzy: 3 }
, o2 = {}, o3 = {}, arr, i = -1;
t = t('forEach');
t(o, function (value, name, self, index) {
o2[name] = value;
a(index, ++i, "Index");
a(self, o, "Self");
a(this, o3, "Scope");
}, o3);
a.deep(o2, o);
arr = [];
o2 = {};
i = -1;
t(o, function (value, name, self, index) {
arr.push(value);
o2[name] = value;
a(index, ++i, "Index");
a(self, o, "Self");
a(this, o3, "Scope");
}, o3, function (a, b) {
return o[b] - o[a];
});
a.deep(o2, o, "Sort by Values: Content");
a.deep(arr, [3, 2, 1], "Sort by Values: Order");
};

5
node_modules/es5-ext/test/object/assign/implement.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
'use strict';
var isImplemented = require('../../../object/assign/is-implemented');
module.exports = function (a) { a(isImplemented(), true); };

3
node_modules/es5-ext/test/object/assign/index.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./shim');

View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = function (t, a) { a(typeof t(), 'boolean'); };

11
node_modules/es5-ext/test/object/assign/shim.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
'use strict';
module.exports = function (t, a) {
var o1 = { a: 1, b: 2 }
, o2 = { b: 3, c: 4 };
a(t(o1, o2), o1, "Returns self");
a.deep(o1, { a: 1, b: 3, c: 4 }, "Single: content");
a.deep(t({}, o1, o2), { a: 1, b: 3, c: 4 }, "Multi argument");
};

13
node_modules/es5-ext/test/object/clear.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
'use strict';
var isEmpty = require('../../object/is-empty');
module.exports = function (t, a) {
var x = {};
a(t(x), x, "Empty: Returns same object");
a(isEmpty(x), true, "Empty: Not changed");
x.foo = 'raz';
x.bar = 'dwa';
a(t(x), x, "Same object");
a(isEmpty(x), true, "Emptied");
};

14
node_modules/es5-ext/test/object/compact.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
'use strict';
module.exports = function (t, a) {
var x = {}, y = {}, z;
z = t(x);
a.not(z, x, "Returns different object");
a.deep(z, {}, "Empty on empty");
x = { foo: 'bar', a: 0, b: false, c: '', d: '0', e: null, bar: y,
elo: undefined };
z = t(x);
a.deep(z, { foo: 'bar', a: 0, b: false, c: '', d: '0', bar: y },
"Cleared null values");
};

13
node_modules/es5-ext/test/object/compare.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
'use strict';
module.exports = function (t, a) {
var d = new Date();
a.ok(t(12, 3) > 0, "Numbers");
a.ok(t(2, 13) < 0, "Numbers #2");
a.ok(t("aaa", "aa") > 0, "Strings");
a.ok(t("aa", "ab") < 0, "Strings #2");
a(t("aa", "aa"), 0, "Strings same");
a(t(d, new Date(d.getTime())), 0, "Same date");
a.ok(t(d, new Date(d.getTime() + 1)) < 0, "Different date");
};

28
node_modules/es5-ext/test/object/copy-deep.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
'use strict';
var stringify = JSON.stringify;
module.exports = function (t, a) {
var o = { 1: 'raz', 2: 'dwa', 3: 'trzy' }
, no = t(o);
a.not(no, o, "Return different object");
a(stringify(no), stringify(o), "Match properties and values");
o = { foo: 'bar', raz: { dwa: 'dwa',
trzy: { cztery: 'pięć', 'sześć': 'siedem' }, osiem: {},
'dziewięć': function () { } },
'dziesięć': 10, "jedenaście": ['raz', ['dwa', 'trzy', { elo: "true" }]] };
o.raz.rec = o;
no = t(o);
a.not(o.raz, no.raz, "Deep");
a.not(o.raz.trzy, no.raz.trzy, "Deep #2");
a(stringify(o.raz.trzy), stringify(no.raz.trzy), "Deep content");
a(no.raz.rec, no, "Recursive");
a.not(o.raz.osiem, no.raz.osiem, "Empty object");
a(o.raz['dziewięć'], no.raz['dziewięć'], "Function");
a.not(o['jedenaście'], no['jedenaście']);
a.not(o['jedenaście'][1], no['jedenaście'][1]);
a.not(o['jedenaście'][1][2], no['jedenaście'][1][2]);
};

19
node_modules/es5-ext/test/object/copy.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
'use strict';
var stringify = JSON.stringify;
module.exports = function (t, a) {
var o = { 1: 'raz', 2: 'dwa', 3: 'trzy' }
, no = t(o);
a.not(no, o, "Return different object");
a(stringify(no), stringify(o), "Match properties and values");
o = { foo: 'bar', raz: { dwa: 'dwa',
trzy: { cztery: 'pięć', 'sześć': 'siedem' }, osiem: {},
'dziewięć': function () { } }, 'dziesięć': 10 };
o.raz.rec = o;
no = t(o);
a(o.raz, no.raz, "Shallow");
};

11
node_modules/es5-ext/test/object/count.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
'use strict';
module.exports = function (t, a) {
a(t({}), 0, "Empty");
a(t({ raz: 1, dwa: null, trzy: undefined, cztery: 0 }), 4,
"Some properties");
a(t(Object.defineProperties({}, {
raz: { value: 'raz' },
dwa: { value: 'dwa', enumerable: true }
})), 1, "Some properties hidden");
};

22
node_modules/es5-ext/test/object/create.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
'use strict';
var setPrototypeOf = require('../../object/set-prototype-of')
, getPrototypeOf = Object.getPrototypeOf;
module.exports = function (t, a) {
var x = {}, obj;
a(getPrototypeOf(t(x)), x, "Normal object");
a(getPrototypeOf(t(null)),
(setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Null");
a.h1("Properties");
a.h2("Normal object");
a(getPrototypeOf(obj = t(x, { foo: { value: 'bar' } })), x, "Prototype");
a(obj.foo, 'bar', "Property");
a.h2("Null");
a(getPrototypeOf(obj = t(null, { foo: { value: 'bar2' } })),
(setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Prototype");
a(obj.foo, 'bar2', "Property");
};

View File

@@ -0,0 +1,12 @@
'use strict';
module.exports = function (t, a) {
a.throws(function () { t(undefined); }, TypeError, "Undefined");
a.throws(function () { t(null); }, TypeError, "Null");
a(t(2), 2, "Number");
a.throws(function () { t(-2); }, TypeError, "Negative");
a.throws(function () { t(2.34); }, TypeError, "Float");
a(t('23'), 23, "Numeric string");
a.throws(function () { t(NaN); }, TypeError, "NaN");
a.throws(function () { t(Infinity); }, TypeError, "Infinity");
};

View File

@@ -0,0 +1,12 @@
'use strict';
module.exports = function (t, a) {
a.throws(function () { t(undefined); }, TypeError, "Undefined");
a(t(null), 0, "Null");
a(t(2), 2, "Number");
a.throws(function () { t(-2); }, TypeError, "Negative");
a.throws(function () { t(2.34); }, TypeError, "Float");
a(t('23'), 23, "Numeric string");
a.throws(function () { t(NaN); }, TypeError, "NaN");
a.throws(function () { t(Infinity); }, TypeError, "Infinity");
};

12
node_modules/es5-ext/test/object/eq.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
'use strict';
module.exports = function (t, a) {
var o = {};
a(t(o, {}), false, "Different objects");
a(t(o, o), true, "Same objects");
a(t('1', '1'), true, "Same primitive");
a(t('1', 1), false, "Different primitive types");
a(t(NaN, NaN), true, "NaN");
a(t(0, 0), true, "0,0");
a(t(0, -0), true, "0,-0");
};

21
node_modules/es5-ext/test/object/every.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
'use strict';
var o = { 1: 1, 2: 2, 3: 3 };
module.exports = function (t, a) {
var o2 = {};
t(o, function (value, name) {
o2[name] = value;
return true;
});
a(JSON.stringify(o2), JSON.stringify(o), "Iterates");
a(t(o, function () {
return true;
}), true, "Succeeds");
a(t(o, function () {
return false;
}), false, "Fails");
};

6
node_modules/es5-ext/test/object/filter.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
'use strict';
module.exports = function (t, a) {
a.deep(t({ 1: 1, 2: 2, 3: 3, 4: 4 },
function (value) { return Boolean(value % 2); }), { 1: 1, 3: 3 });
};

23
node_modules/es5-ext/test/object/find-key.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
'use strict';
var o = { 1: 1, 2: 2, 3: 3 };
module.exports = function (t, a) {
var o2 = {}, i = 0;
t(o, function (value, name) {
o2[name] = value;
return false;
});
a(JSON.stringify(o2), JSON.stringify(o), "Iterates");
a(t(o, function () {
++i;
return true;
}), '1', "Finds");
a(i, 1, "Stops iteration after condition is met");
a(t(o, function () {
return false;
}), undefined, "Fails");
};

23
node_modules/es5-ext/test/object/find.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
'use strict';
var o = { 1: 1, 2: 2, 3: 3 };
module.exports = function (t, a) {
var o2 = {}, i = 0;
t(o, function (value, name) {
o2[name] = value;
return false;
});
a(JSON.stringify(o2), JSON.stringify(o), "Iterates");
a(t(o, function () {
++i;
return true;
}), 1, "Finds");
a(i, 1, "Stops iteration after condition is met");
a(t(o, function () {
return false;
}), undefined, "Fails");
};

13
node_modules/es5-ext/test/object/first-key.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
'use strict';
module.exports = function (t, a) {
var x = {}, y = Object.create(null);
a(t(x), null, "Normal: Empty");
a(t(y), null, "Null extension: Empty");
x.foo = 'raz';
x.bar = 343;
a(['foo', 'bar'].indexOf(t(x)) !== -1, true, "Normal");
y.elo = 'foo';
y.mar = 'wew';
a(['elo', 'mar'].indexOf(t(y)) !== -1, true, "Null extension");
};

6
node_modules/es5-ext/test/object/flatten.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
'use strict';
module.exports = function (t, a) {
a.deep(t({ a: { aa: 1, ab: 2 }, b: { ba: 3, bb: 4 } }),
{ aa: 1, ab: 2, ba: 3, bb: 4 });
};

10
node_modules/es5-ext/test/object/for-each.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
'use strict';
module.exports = function (t, a) {
var o = { raz: 1, dwa: 2, trzy: 3 }
, o2 = {};
a(t(o, function (value, name) {
o2[name] = value;
}), undefined, "Return");
a.deep(o2, o);
};

18
node_modules/es5-ext/test/object/get-property-names.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
'use strict';
module.exports = function (t, a) {
var o = { first: 1, second: 4 }, r1, r2;
o = Object.create(o, {
third: { value: null }
});
o.first = 2;
o = Object.create(o);
o.fourth = 3;
r1 = t(o);
r1.sort();
r2 = ['first', 'second', 'third', 'fourth']
.concat(Object.getOwnPropertyNames(Object.prototype));
r2.sort();
a.deep(r1, r2);
};

14
node_modules/es5-ext/test/object/is-array-like.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
'use strict';
module.exports = function (t, a) {
a(t([]), true, "Array");
a(t(""), true, "String");
a(t((function () { return arguments; }())), true, "Arguments");
a(t({ length: 0 }), true, "List object");
a(t(function () {}), false, "Function");
a(t({}), false, "Plain object");
a(t(/raz/), false, "Regexp");
a(t(), false, "No argument");
a(t(null), false, "Null");
a(t(undefined), false, "Undefined");
};

8
node_modules/es5-ext/test/object/is-callable.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
'use strict';
module.exports = function (t, a) {
a(t(function () {}), true, "Function");
a(t({}), false, "Object");
a(t(), false, "Undefined");
a(t(null), false, "Null");
};

46
node_modules/es5-ext/test/object/is-copy-deep.js generated vendored Normal file
View File

@@ -0,0 +1,46 @@
'use strict';
module.exports = function (t, a) {
var x, y;
a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same");
a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false,
"Different property value");
a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false,
"Property only in source");
a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false,
"Property only in target");
a(t("raz", "dwa"), false, "String: diff");
a(t("raz", "raz"), true, "String: same");
a(t("32", 32), false, "String & Number");
a(t([1, 'raz', true], [1, 'raz', true]), true, "Array: same");
a(t([1, 'raz', undefined], [1, 'raz']), false, "Array: diff");
a(t(['foo'], ['one']), false, "Array: One value comparision");
x = { foo: { bar: { mar: {} } } };
y = { foo: { bar: { mar: {} } } };
a(t(x, y), true, "Deep");
a(t({ foo: { bar: { mar: 'foo' } } }, { foo: { bar: { mar: {} } } }),
false, "Deep: false");
x = { foo: { bar: { mar: {} } } };
x.rec = { foo: x };
y = { foo: { bar: { mar: {} } } };
y.rec = { foo: x };
a(t(x, y), true, "Object: Infinite Recursion: Same #1");
x.rec.foo = y;
a(t(x, y), true, "Object: Infinite Recursion: Same #2");
x.rec.foo = x;
y.rec.foo = y;
a(t(x, y), true, "Object: Infinite Recursion: Same #3");
y.foo.bar.mar = 'raz';
a(t(x, y), false, "Object: Infinite Recursion: Diff");
};

18
node_modules/es5-ext/test/object/is-copy.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
'use strict';
module.exports = function (t, a) {
a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same");
a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false,
"Different property value");
a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false,
"Property only in source");
a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false,
"Property only in target");
a(t("raz", "dwa"), false, "String: diff");
a(t("raz", "raz"), true, "String: same");
a(t("32", 32), false, "String & Number");
a(t([1, 'raz', true], [1, 'raz', true]), true, "Array: same");
a(t([1, 'raz', undefined], [1, 'raz']), false, "Array: diff");
};

6
node_modules/es5-ext/test/object/is-empty.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
'use strict';
module.exports = function (t, a) {
a(t({}), true, "Empty");
a(t({ 1: 1 }), false, "Not empty");
};

15
node_modules/es5-ext/test/object/is-number-value.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
'use strict';
module.exports = function (t, a) {
a(t(undefined), false, "Undefined");
a(t(null), false, "Null");
a(t(0), true, "Zero");
a(t(NaN), false, "NaN");
a(t(Infinity), true, "Infinity");
a(t(12), true, "Number");
a(t(false), true, "Boolean");
a(t(new Date()), true, "Date");
a(t(new Number(2)), true, "Number object");
a(t('asdfaf'), false, "String");
a(t(''), true, "Empty String");
};

13
node_modules/es5-ext/test/object/is-object.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
'use strict';
module.exports = function (t, a) {
a(t('arar'), false, "String");
a(t(12), false, "Number");
a(t(true), false, "Boolean");
a(t(null), false, "Null");
a(t(new Date()), true, "Date");
a(t(new String('raz')), true, "String object");
a(t({}), true, "Plain object");
a(t(/a/), true, "Regular expression");
a(t(function () {}), true, "Function");
};

18
node_modules/es5-ext/test/object/is-plain-object.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
'use strict';
module.exports = function (t, a) {
a(t({}), true, "Empty {} is plain object");
a(t({ a: true }), true, "{} with property is plain object");
a(t({ prototype: 1, constructor: 2, __proto__: 3 }), true,
"{} with any property keys is plain object");
a(t(null), false, "Null is not plain object");
a(t('string'), false, "Primitive is not plain object");
a(t(function () {}), false, "Function is not plain object");
a(t(Object.create({})), false,
"Object whose prototype is not Object.prototype is not plain object");
a(t(Object.create(Object.prototype)), true,
"Object whose prototype is Object.prototype is plain object");
a(t(Object.create(null)), true,
"Object whose prototype is null is plain object");
a(t(Object.prototype), false, "Object.prototype");
};

12
node_modules/es5-ext/test/object/is.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
'use strict';
module.exports = function (t, a) {
var o = {};
a(t(o, {}), false, "Different objects");
a(t(o, o), true, "Same objects");
a(t('1', '1'), true, "Same primitive");
a(t('1', 1), false, "Different primitive types");
a(t(NaN, NaN), true, "NaN");
a(t(0, 0), true, "0,0");
a(t(0, -0), false, "0,-0");
};

12
node_modules/es5-ext/test/object/key-of.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
'use strict';
module.exports = function (t, a) {
var x = {}, y = {}
, o = { foo: 'bar', raz: x, trzy: 'cztery', five: '6' };
a(t(o, 'bar'), 'foo', "First property");
a(t(o, 6), null, "Primitive that's not there");
a(t(o, x), 'raz', "Object");
a(t(o, y), null, "Object that's not there");
a(t(o, '6'), 'five', "Last property");
};

5
node_modules/es5-ext/test/object/keys/implement.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
'use strict';
var isImplemented = require('../../../object/keys/is-implemented');
module.exports = function (a) { a(isImplemented(), true); };

3
node_modules/es5-ext/test/object/keys/index.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./shim');

View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = function (t, a) { a(typeof t(), 'boolean'); };

8
node_modules/es5-ext/test/object/keys/shim.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
'use strict';
module.exports = function (t, a) {
a.deep(t({ foo: 'bar' }), ['foo'], "Object");
a.deep(t('raz'), ['0', '1', '2'], "Primitive");
a.throws(function () { t(); }, TypeError, "Undefined");
a.throws(function () { t(null); }, TypeError, "Undefined");
};

7
node_modules/es5-ext/test/object/map-keys.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
'use strict';
module.exports = function (t, a) {
a.deep(t({ 1: 1, 2: 2, 3: 3 }, function (key, value) {
return 'x' + (key + value);
}), { x11: 1, x22: 2, x33: 3 });
};

9
node_modules/es5-ext/test/object/map.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
'use strict';
module.exports = function (t, a) {
var obj = { 1: 1, 2: 2, 3: 3 };
a.deep(t(obj, function (value, key, context) {
a(context, obj, "Context argument");
return (value + 1) + key;
}), { 1: '21', 2: '32', 3: '43' });
};

67
node_modules/es5-ext/test/object/mixin-prototypes.js generated vendored Normal file
View File

@@ -0,0 +1,67 @@
'use strict';
module.exports = function (t, a) {
var o, o1, o2, x, y = {}, z = {};
o = { inherited: true, visible: 23 };
o1 = Object.create(o);
o1.visible = z;
o1.nonremovable = 'raz';
Object.defineProperty(o1, 'hidden', { value: 'hidden' });
o2 = Object.defineProperties({}, { nonremovable: { value: y } });
o2.other = 'other';
try { t(o2, o1); } catch (ignore) {}
a(o2.visible, z, "Enumerable");
a(o1.hidden, 'hidden', "Not Enumerable");
a(o2.propertyIsEnumerable('visible'), true, "Enumerable is enumerable");
a(o2.propertyIsEnumerable('hidden'), false,
"Not enumerable is not enumerable");
a(o2.inherited, true, "Extend deep");
a(o2.nonremovable, y, "Do not overwrite non configurable");
a(o2.other, 'other', "Own kept");
x = {};
t(x, o2);
try { t(x, o1); } catch (ignore) {}
a(x.visible, z, "Enumerable");
a(x.hidden, 'hidden', "Not Enumerable");
a(x.propertyIsEnumerable('visible'), true, "Enumerable is enumerable");
a(x.propertyIsEnumerable('hidden'), false,
"Not enumerable is not enumerable");
a(x.inherited, true, "Extend deep");
a(x.nonremovable, y, "Ignored non configurable");
a(x.other, 'other', "Other");
x.visible = 3;
a(x.visible, 3, "Writable is writable");
x = {};
t(x, o1);
a.throws(function () {
x.hidden = 3;
}, "Not writable is not writable");
x = {};
t(x, o1);
delete x.visible;
a.ok(!x.hasOwnProperty('visible'), "Configurable is configurable");
x = {};
t(x, o1);
a.throws(function () {
delete x.hidden;
}, "Not configurable is not configurable");
x = Object.defineProperty({}, 'foo',
{ configurable: false, writable: true, enumerable: false, value: 'bar' });
try { t(x, { foo: 'lorem' }); } catch (ignore) {}
a(x.foo, 'bar', "Writable, not enumerable");
};

69
node_modules/es5-ext/test/object/mixin.js generated vendored Normal file
View File

@@ -0,0 +1,69 @@
'use strict';
module.exports = function (t, a) {
var o, o1, o2, x, y = {}, z = {};
o = { inherited: true };
o1 = Object.create(o);
o1.visible = z;
o1.nonremovable = 'raz';
Object.defineProperty(o1, 'hidden', { value: 'hidden' });
o2 = Object.defineProperties({}, { nonremovable: { value: y } });
o2.other = 'other';
try { t(o2, o1); } catch (ignore) {}
a(o2.visible, z, "Enumerable");
a(o1.hidden, 'hidden', "Not Enumerable");
a(o2.propertyIsEnumerable('visible'), true, "Enumerable is enumerable");
a(o2.propertyIsEnumerable('hidden'), false,
"Not enumerable is not enumerable");
a(o2.hasOwnProperty('inherited'), false, "Extend only own");
a(o2.inherited, undefined, "Extend ony own: value");
a(o2.nonremovable, y, "Do not overwrite non configurable");
a(o2.other, 'other', "Own kept");
x = {};
t(x, o2);
try { t(x, o1); } catch (ignore) {}
a(x.visible, z, "Enumerable");
a(x.hidden, 'hidden', "Not Enumerable");
a(x.propertyIsEnumerable('visible'), true, "Enumerable is enumerable");
a(x.propertyIsEnumerable('hidden'), false,
"Not enumerable is not enumerable");
a(x.hasOwnProperty('inherited'), false, "Extend only own");
a(x.inherited, undefined, "Extend ony own: value");
a(x.nonremovable, y, "Ignored non configurable");
a(x.other, 'other', "Other");
x.visible = 3;
a(x.visible, 3, "Writable is writable");
x = {};
t(x, o1);
a.throws(function () {
x.hidden = 3;
}, "Not writable is not writable");
x = {};
t(x, o1);
delete x.visible;
a.ok(!x.hasOwnProperty('visible'), "Configurable is configurable");
x = {};
t(x, o1);
a.throws(function () {
delete x.hidden;
}, "Not configurable is not configurable");
x = Object.defineProperty({}, 'foo',
{ configurable: false, writable: true, enumerable: false, value: 'bar' });
try { t(x, { foo: 'lorem' }); } catch (ignore) {}
a(x.foo, 'bar', "Writable, not enumerable");
};

32
node_modules/es5-ext/test/object/normalize-options.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
'use strict';
var create = Object.create, defineProperty = Object.defineProperty;
module.exports = function (t, a) {
var x = { foo: 'raz', bar: 'dwa' }, y;
y = t(x);
a.not(y, x, "Returns copy");
a.deep(y, x, "Plain");
x = { raz: 'one', dwa: 'two' };
defineProperty(x, 'get', {
configurable: true,
enumerable: true,
get: function () { return this.dwa; }
});
x = create(x);
x.trzy = 'three';
x.cztery = 'four';
x = create(x);
x.dwa = 'two!';
x.trzy = 'three!';
x.piec = 'five';
x.szesc = 'six';
a.deep(t(x), { raz: 'one', dwa: 'two!', trzy: 'three!', cztery: 'four',
piec: 'five', szesc: 'six', get: 'two!' }, "Deep object");
a.deep(t({ marko: 'raz', raz: 'foo' }, x, { szesc: 'elo', siedem: 'bibg' }),
{ marko: 'raz', raz: 'one', dwa: 'two!', trzy: 'three!', cztery: 'four',
piec: 'five', szesc: 'elo', siedem: 'bibg', get: 'two!' }, "Multiple options");
};

15
node_modules/es5-ext/test/object/primitive-set.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
'use strict';
var getPropertyNames = require('../../object/get-property-names')
, isPlainObject = require('../../object/is-plain-object');
module.exports = function (t, a) {
var x = t();
a(isPlainObject(x), true, "Plain object");
a.deep(getPropertyNames(x), [], "No properties");
x.foo = 'bar';
a.deep(getPropertyNames(x), ['foo'], "Extensible");
a.deep(t('raz', 'dwa', 3), { raz: true, dwa: true, 3: true },
"Arguments handling");
};

15
node_modules/es5-ext/test/object/safe-traverse.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
'use strict';
module.exports = function (t, a) {
var obj = { foo: { bar: { lorem: 12 } } };
a(t(obj), obj, "No props");
a(t(obj, 'foo'), obj.foo, "One");
a(t(obj, 'raz'), undefined, "One: Fail");
a(t(obj, 'foo', 'bar'), obj.foo.bar, "Two");
a(t(obj, 'dsd', 'raz'), undefined, "Two: Fail #1");
a(t(obj, 'foo', 'raz'), undefined, "Two: Fail #2");
a(t(obj, 'foo', 'bar', 'lorem'), obj.foo.bar.lorem, "Three");
a(t(obj, 'dsd', 'raz', 'fef'), undefined, "Three: Fail #1");
a(t(obj, 'foo', 'raz', 'asdf'), undefined, "Three: Fail #2");
a(t(obj, 'foo', 'bar', 'asd'), undefined, "Three: Fail #3");
};

25
node_modules/es5-ext/test/object/serialize.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
'use strict';
module.exports = function (t, a) {
var fn = function (raz, dwa) { return raz + dwa; };
a(t(), 'undefined', "Undefined");
a(t(null), 'null', "Null");
a(t(null), 'null', "Null");
a(t('raz'), '"raz"', "String");
a(t('raz"ddwa\ntrzy'), '"raz\\"ddwa\\ntrzy"', "String with escape");
a(t(false), 'false', "Booelean");
a(t(fn), String(fn), "Function");
a(t(/raz-dwa/g), '/raz-dwa/g', "RegExp");
a(t(new Date(1234567)), 'new Date(1234567)', "Date");
a(t([]), '[]', "Empty array");
a(t([undefined, false, null, 'raz"ddwa\ntrzy', fn, /raz/g, new Date(1234567), ['foo']]),
'[undefined,false,null,"raz\\"ddwa\\ntrzy",' + String(fn) +
',/raz/g,new Date(1234567),["foo"]]', "Rich Array");
a(t({}), '{}', "Empty object");
a(t({ raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', piec: fn, szesc: /raz/g,
siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } }),
'{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy","piec":' + String(fn) +
',"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' +
'"dziewiec":{"foo":"bar","dwa":343}}', "Rich object");
};

View File

@@ -0,0 +1,6 @@
'use strict';
var create = require('../../../object/create')
, isImplemented = require('../../../object/set-prototype-of/is-implemented');
module.exports = function (a) { a(isImplemented(create), true); };

View File

@@ -0,0 +1,23 @@
'use strict';
var create = require('../../../object/create')
, getPrototypeOf = Object.getPrototypeOf;
module.exports = function (t, a) {
var x = {}, y = {};
if (t === null) return;
a(t(x, y), x, "Return self object");
a(getPrototypeOf(x), y, "Object");
a.throws(function () { t(x); }, TypeError, "Undefined");
a.throws(function () { t('foo'); }, TypeError, "Primitive");
a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null");
x = create(null);
a.h1("Change null prototype");
a(t(x, y), x, "Result");
a(getPrototypeOf(x), y, "Prototype");
a.h1("Set null prototype");
a(t(y, null), y, "Result");
a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype");
};

View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = function (t, a) { a(typeof t(), 'boolean'); };

View File

@@ -0,0 +1,23 @@
'use strict';
var create = require('../../../object/create')
, getPrototypeOf = Object.getPrototypeOf;
module.exports = function (t, a) {
var x = {}, y = {};
if (t === null) return;
a(t(x, y), x, "Return self object");
a(getPrototypeOf(x), y, "Object");
a.throws(function () { t(x); }, TypeError, "Undefined");
a.throws(function () { t('foo'); }, TypeError, "Primitive");
a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null");
x = create(null);
a.h1("Change null prototype");
a(t(x, y), x, "Result");
a(getPrototypeOf(x), y, "Prototype");
a.h1("Set null prototype");
a(t(y, null), y, "Result");
a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype");
};

23
node_modules/es5-ext/test/object/some.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
'use strict';
var o = { 1: 1, 2: 2, 3: 3 };
module.exports = function (t, a) {
var o2 = {}, i = 0;
t(o, function (value, name) {
o2[name] = value;
return false;
});
a(JSON.stringify(o2), JSON.stringify(o), "Iterates");
a(t(o, function () {
++i;
return true;
}), true, "Succeeds");
a(i, 1, "Stops iteration after condition is met");
a(t(o, function () {
return false;
}), false, "Fails");
};

15
node_modules/es5-ext/test/object/to-array.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
'use strict';
module.exports = function (t, a) {
var o = { 1: 1, 2: 2, 3: 3 }, o1 = {}
, o2 = t(o, function (value, name, self) {
a(self, o, "Self");
a(this, o1, "Scope");
return value + Number(name);
}, o1);
a.deep(o2, [2, 4, 6]);
t(o).sort().forEach(function (item) {
a.deep(item, [item[0], o[item[0]]], "Default");
});
};

24
node_modules/es5-ext/test/object/unserialize.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
'use strict';
module.exports = function (t, a) {
var fn = function (raz, dwa) { return raz + dwa; };
a(t('undefined'), undefined, "Undefined");
a(t('null'), null, "Null");
a(t('"raz"'), 'raz', "String");
a(t('"raz\\"ddwa\\ntrzy"'), 'raz"ddwa\ntrzy', "String with escape");
a(t('false'), false, "Booelean");
a(String(t(String(fn))), String(fn), "Function");
a.deep(t('/raz-dwa/g'), /raz-dwa/g, "RegExp");
a.deep(t('new Date(1234567)'), new Date(1234567), "Date");
a.deep(t('[]'), [], "Empty array");
a.deep(t('[undefined,false,null,"raz\\"ddwa\\ntrzy",/raz/g,new Date(1234567),["foo"]]'),
[undefined, false, null, 'raz"ddwa\ntrzy', /raz/g, new Date(1234567), ['foo']], "Rich Array");
a.deep(t('{}'), {}, "Empty object");
a.deep(t('{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy",' +
'"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' +
'"dziewiec":{"foo":"bar","dwa":343}}'),
{ raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', szesc: /raz/g,
siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } },
"Rich object");
};

9
node_modules/es5-ext/test/object/valid-callable.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
'use strict';
module.exports = function (t, a) {
var f = function () {};
a(t(f), f, "Function");
a.throws(function () {
t({});
}, "Not Function");
};

15
node_modules/es5-ext/test/object/valid-object.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
'use strict';
module.exports = function (t, a) {
var x;
a.throws(function () { t(0); }, TypeError, "0");
a.throws(function () { t(false); }, TypeError, "false");
a.throws(function () { t(''); }, TypeError, "''");
a(t(x = {}), x, "Object");
a(t(x = function () {}), x, "Function");
a(t(x = new String('raz')), x, "String object"); //jslint: ignore
a(t(x = new Date()), x, "Date");
a.throws(function () { t(); }, TypeError, "Undefined");
a.throws(function () { t(null); }, TypeError, "null");
};

19
node_modules/es5-ext/test/object/valid-value.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
'use strict';
var numIsNaN = require('../../number/is-nan');
module.exports = function (t, a) {
var x;
a(t(0), 0, "0");
a(t(false), false, "false");
a(t(''), '', "''");
a(numIsNaN(t(NaN)), true, "NaN");
a(t(x = {}), x, "{}");
a.throws(function () {
t();
}, "Undefined");
a.throws(function () {
t(null);
}, "null");
};

View File

@@ -0,0 +1,15 @@
'use strict';
module.exports = function (t, a) {
var x;
a.throws(function () { t(0); }, TypeError, "0");
a.throws(function () { t(false); }, TypeError, "false");
a.throws(function () { t(''); }, TypeError, "String");
a.throws(function () { t({}); }, TypeError, "Plain Object");
a.throws(function () { t(function () {}); }, TypeError, "Function");
a(t(x = new String('raz')), x, "String object"); //jslint: ignore
a(t(x = { length: 1 }), x, "Array like");
a.throws(function () { t(); }, TypeError, "Undefined");
a.throws(function () { t(null); }, TypeError, "null");
};

View File

@@ -0,0 +1,15 @@
'use strict';
module.exports = function (t, a) {
var x;
a.throws(function () { t(0); }, TypeError, "0");
a.throws(function () { t(false); }, TypeError, "false");
a(t(''), '', "''");
a.throws(function () { t({}); }, TypeError, "Plain Object");
a.throws(function () { t(function () {}); }, TypeError, "Function");
a(t(x = new String('raz')), x, "String object"); //jslint: ignore
a(t(x = { length: 1 }), x, "Array like");
a.throws(function () { t(); }, TypeError, "Undefined");
a.throws(function () { t(null); }, TypeError, "null");
};

View File

@@ -0,0 +1,16 @@
'use strict';
module.exports = function (t, a) {
var x;
a.throws(function () { t(); }, TypeError, "Undefined");
a.throws(function () { t(null); }, TypeError, "Null");
a(t(0), "0");
a(t(false), "false");
a(t(''), "");
a(t({}), String({}), "Object");
a(t(x = function () {}), String(x), "Function");
a(t(x = new String('raz')), String(x), "String object"); //jslint: ignore
a(t(x = new Date()), String(x), "Date");
a.throws(function () { t(Object.create(null)); }, TypeError, "Null prototype object");
};

View File

@@ -0,0 +1,16 @@
'use strict';
module.exports = function (t, a) {
var x;
a(t(), 'undefined', "Undefined");
a(t(null), 'null', "Null");
a(t(0), "0");
a(t(false), "false");
a(t(''), "");
a(t({}), String({}), "Object");
a(t(x = function () {}), String(x), "Function");
a(t(x = new String('raz')), String(x), "String object"); //jslint: ignore
a(t(x = new Date()), String(x), "Date");
a.throws(function () { t(Object.create(null)); }, TypeError, "Null prototype object");
};