mirror of
https://github.com/vale981/apollo-server
synced 2025-03-06 02:01:40 -05:00
Add Object.entries polyfill
This commit is contained in:
parent
2369b06be2
commit
fec517d06c
3 changed files with 8 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
import './polyfills/Object.values';
|
||||
import './polyfills/Object.entries';
|
||||
|
||||
require('util.promisify').shim();
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
if (!global.Object.entries) {
|
||||
global.Object.entries = function(object: any) {
|
||||
return Object.keys(object).map(key => [key, object[key]] as [string, any]);
|
||||
};
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
if (!global.Object.values) {
|
||||
global.Object.values = function(o: any) {
|
||||
return Object.keys(o).map(key => o[key]);
|
||||
global.Object.values = function(object: any) {
|
||||
return Object.keys(object).map(key => object[key]);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue