refactor(): small changes

This commit is contained in:
Daniel Sogl
2019-01-26 20:20:55 +01:00
parent 184986f06b
commit 92140cd2db
9 changed files with 59 additions and 119 deletions
+3 -2
View File
@@ -7,7 +7,9 @@ export function get(element: Element | Window, path: string) {
const paths: string[] = path.split('.');
let obj: any = element;
for (let i = 0; i < paths.length; i++) {
if (!obj) { return null; }
if (!obj) {
return null;
}
obj = obj[paths[i]];
}
return obj;
@@ -17,7 +19,6 @@ export function get(element: Element | Window, path: string) {
* @private
*/
export function getPromise(callback: Function = () => {}): Promise<any> {
const tryNativePromise = () => {
if (window.Promise) {
return new Promise<any>((resolve, reject) => {