mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
fix(config): add object.entries polyfil
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
import { entries } from '../utils/helpers';
|
||||
|
||||
export class Config {
|
||||
|
||||
private m: Map<string, any>;
|
||||
|
||||
constructor(configObj: {[key: string]: any}) {
|
||||
this.m = new Map<string, any>(Object.entries(configObj));
|
||||
this.m = new Map<string, any>(entries(configObj));
|
||||
|
||||
}
|
||||
|
||||
get(key: string, fallback?: any): any {
|
||||
|
@ -41,6 +41,15 @@ export function pointerCoord(ev: any): {x: number, y: number} {
|
||||
}
|
||||
export type Side = 'start' | 'end';
|
||||
|
||||
export function entries(obj: {[s: string]: T}): [string, T][] {
|
||||
const ownProps = Object.keys( obj );
|
||||
let i = ownProps.length;
|
||||
const resArray = new Array(i);
|
||||
while (i--)
|
||||
resArray[i] = [ownProps[i], obj[ownProps[i]]];
|
||||
return resArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
* Given a side, return if it should be on the right
|
||||
|
Reference in New Issue
Block a user