/
githubmirror
/
amphtml
Обзор
Документация
Войти
/
githubmirror
/
amphtml
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/polyfills/object-values.js
24 строки
572 B
Kristofer Baxter
♻️ Remove Notice from JS and Markdown (#35717)
19 авг 2021, 21:21
Не верифицирован
19 авг 2021, 21:21
f564b7e
Код
Авторство
О чём код?
/** * Implements `Object.values` API. * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Object/values. * * @param {!Object} target * @return {!Array<*>} */ export function values(target) { return Object.keys(target).map((k) => target[k]); } /** * Sets the Object.values polyfill if it does not exist. * @param {!Window} win */ export function install(win) { if (!win.Object.values) { win.Object.defineProperty(win.Object, 'values', { configurable: true, writable: true, value: values, }); } }