/
buuded
/
app-web-project
Обзор
Документация
Войти
/
buuded
/
app-web-project
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
node_modules/object.fromentries/test/tests.js
17 строк
584 B
buuded
first-commit
27 янв 2025, 10:32
27 янв 2025, 10:32
9efc400
Код
Авторство
О чём код?
'use strict'; module.exports = function (fromEntries, t) { var a = {}; var b = {}; var c = {}; var entries = [['a', a], ['b', b], ['c', c]]; var obj = { a: a, b: b, c: c }; t.deepEqual(fromEntries(entries), obj, 'entries -> obj'); t['throws'](function () { fromEntries(); }, 'entries throws on absent iterable'); t['throws'](function () { fromEntries(undefined); }, 'entries throws on undefined'); t['throws'](function () { fromEntries(null); }, 'entries throws on null'); t.deepEqual(fromEntries([['foo', 1], ['foo', 2]]), { foo: 2 }, 'works with a duplicate key'); };