mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 13:42:20 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
11
web/node_modules/object.entries/test/.eslintrc
generated
vendored
Normal file
11
web/node_modules/object.entries/test/.eslintrc
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"rules": {
|
||||
"array-bracket-newline": 0,
|
||||
"max-lines-per-function": 0,
|
||||
"max-nested-callbacks": [2, 3],
|
||||
"max-statements": [2, 12],
|
||||
"max-statements-per-line": [2, { "max": 3 }],
|
||||
"no-invalid-this": [1],
|
||||
"object-curly-newline": 0,
|
||||
}
|
||||
}
|
20
web/node_modules/object.entries/test/implementation.js
generated
vendored
Normal file
20
web/node_modules/object.entries/test/implementation.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
'use strict';
|
||||
|
||||
var implementation = require('../implementation');
|
||||
var callBind = require('call-bind');
|
||||
var test = require('tape');
|
||||
var hasStrictMode = require('has-strict-mode')();
|
||||
var runTests = require('./tests');
|
||||
|
||||
test('as a function', function (t) {
|
||||
t.test('bad array/this value', { skip: !hasStrictMode }, function (st) {
|
||||
/* eslint no-useless-call: 0 */
|
||||
st['throws'](function () { implementation.call(undefined); }, TypeError, 'undefined is not an object');
|
||||
st['throws'](function () { implementation.call(null); }, TypeError, 'null is not an object');
|
||||
st.end();
|
||||
});
|
||||
|
||||
runTests(callBind(implementation, Object), t);
|
||||
|
||||
t.end();
|
||||
});
|
17
web/node_modules/object.entries/test/index.js
generated
vendored
Normal file
17
web/node_modules/object.entries/test/index.js
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
'use strict';
|
||||
|
||||
var entries = require('../');
|
||||
var test = require('tape');
|
||||
var runTests = require('./tests');
|
||||
|
||||
test('as a function', function (t) {
|
||||
t.test('bad array/this value', function (st) {
|
||||
st['throws'](function () { entries(undefined); }, TypeError, 'undefined is not an object');
|
||||
st['throws'](function () { entries(null); }, TypeError, 'null is not an object');
|
||||
st.end();
|
||||
});
|
||||
|
||||
runTests(entries, t);
|
||||
|
||||
t.end();
|
||||
});
|
35
web/node_modules/object.entries/test/shimmed.js
generated
vendored
Normal file
35
web/node_modules/object.entries/test/shimmed.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
require('../auto');
|
||||
|
||||
var test = require('tape');
|
||||
var defineProperties = require('define-properties');
|
||||
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
var functionsHaveNames = require('functions-have-names');
|
||||
|
||||
var runTests = require('./tests');
|
||||
|
||||
test('shimmed', function (t) {
|
||||
t.equal(Object.entries.length, 1, 'Object.entries has a length of 1');
|
||||
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
|
||||
st.equal(Object.entries.name, 'entries', 'Object.entries has name "entries"');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
|
||||
et.equal(false, isEnumerable.call(Object, 'entries'), 'Object.entries is not enumerable');
|
||||
et.end();
|
||||
});
|
||||
|
||||
var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
|
||||
|
||||
t.test('bad object value', { skip: !supportsStrictMode }, function (st) {
|
||||
st['throws'](function () { return Object.entries(undefined); }, TypeError, 'undefined is not an object');
|
||||
st['throws'](function () { return Object.entries(null); }, TypeError, 'null is not an object');
|
||||
st.end();
|
||||
});
|
||||
|
||||
runTests(Object.entries, t);
|
||||
|
||||
t.end();
|
||||
});
|
82
web/node_modules/object.entries/test/tests.js
generated
vendored
Normal file
82
web/node_modules/object.entries/test/tests.js
generated
vendored
Normal file
|
@ -0,0 +1,82 @@
|
|||
'use strict';
|
||||
|
||||
var keys = require('object-keys');
|
||||
var map = require('array.prototype.map');
|
||||
var define = require('define-properties');
|
||||
|
||||
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
|
||||
|
||||
module.exports = function (entries, t) {
|
||||
var a = {};
|
||||
var b = {};
|
||||
var c = {};
|
||||
var obj = { a: a, b: b, c: c };
|
||||
|
||||
t.deepEqual(entries(obj), [['a', a], ['b', b], ['c', c]], 'basic support');
|
||||
t.deepEqual(entries({ a: a, b: a, c: c }), [['a', a], ['b', a], ['c', c]], 'duplicate entries are included');
|
||||
|
||||
t.test('entries are in the same order as keys', function (st) {
|
||||
var object = { a: a, b: b };
|
||||
object[0] = 3;
|
||||
object.c = c;
|
||||
object[1] = 4;
|
||||
delete object[0];
|
||||
var objKeys = keys(object);
|
||||
var objEntries = map(objKeys, function (key) {
|
||||
return [key, object[key]];
|
||||
});
|
||||
st.deepEqual(entries(object), objEntries, 'entries match key order');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('non-enumerable properties are omitted', { skip: !Object.defineProperty }, function (st) {
|
||||
var object = { a: a, b: b };
|
||||
Object.defineProperty(object, 'c', { enumerable: false, value: c });
|
||||
st.deepEqual(entries(object), [['a', a], ['b', b]], 'non-enumerable property‘s value is omitted');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('inherited properties are omitted', function (st) {
|
||||
var F = function G() {};
|
||||
F.prototype.a = a;
|
||||
var f = new F();
|
||||
f.b = b;
|
||||
st.deepEqual(entries(f), [['b', b]], 'only own properties are included');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('Symbol properties are omitted', { skip: !hasSymbols }, function (st) {
|
||||
var object = { a: a, b: b, c: c };
|
||||
var enumSym = Symbol('enum');
|
||||
var nonEnumSym = Symbol('non enum');
|
||||
object[enumSym] = enumSym;
|
||||
object.d = enumSym;
|
||||
Object.defineProperty(object, nonEnumSym, { enumerable: false, value: nonEnumSym });
|
||||
st.deepEqual(entries(object), [['a', a], ['b', b], ['c', c], ['d', enumSym]], 'symbol properties are omitted');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('not-yet-visited keys deleted on [[Get]] must not show up in output', { skip: !define.supportsDescriptors }, function (st) {
|
||||
var o = { a: 1, b: 2, c: 3 };
|
||||
Object.defineProperty(o, 'a', {
|
||||
get: function () {
|
||||
delete this.b;
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
st.deepEqual(entries(o), [['a', 1], ['c', 3]], 'when "b" is deleted prior to being visited, it should not show up');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('not-yet-visited keys made non-enumerable on [[Get]] must not show up in output', { skip: !define.supportsDescriptors }, function (st) {
|
||||
var o = { a: 'A', b: 'B' };
|
||||
Object.defineProperty(o, 'a', {
|
||||
get: function () {
|
||||
Object.defineProperty(o, 'b', { enumerable: false });
|
||||
return 'A';
|
||||
}
|
||||
});
|
||||
st.deepEqual(entries(o), [['a', 'A']], 'when "b" is made non-enumerable prior to being visited, it should not show up');
|
||||
st.end();
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue