Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
optometrists
/
cache
/
cache
/
cache
/
cache
/
cache
/
cache
/
cache
/
.wp-cli
/
wp-content
/
plugins
/
woocommerce
/
packages
/
woocommerce-blocks
/
assets
/
js
/
base
/
utils
:
from-entries-polyfill.ts
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
/** * A polyfill for Object.fromEntries function. * * @param {Array<[string, unknown]>} array Array to be turned back to object * @return {Record< string, unknown >} the newly created object */ export const fromEntriesPolyfill = ( array: Array< [ string, unknown ] > ): Record< string, unknown > => array.reduce< Record< string, unknown > >( ( obj, [ key, val ] ) => { obj[ key ] = val; return obj; }, {} );