@garfish/utils
Advanced tools
Comparing version 0.0.49 to 0.0.50
@@ -6,2 +6,2 @@ import { interfaces } from '@garfish/core'; | ||
}; | ||
export declare function getRenderNode(domGetter: interfaces.DomGetter): Element; | ||
export declare function getRenderNode(domGetter: interfaces.DomGetter): Promise<Element>; |
@@ -805,2 +805,27 @@ 'use strict'; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
} | ||
function createAppContainer(name) { | ||
@@ -819,15 +844,17 @@ // Create a temporary node, which is destroyed by the module itself | ||
function getRenderNode(domGetter) { | ||
assert(domGetter, `Invalid domGetter:\n ${domGetter}.`); | ||
let appWrapperNode = domGetter; | ||
if (typeof domGetter === 'string') { | ||
appWrapperNode = document.querySelector(domGetter); | ||
} | ||
else if (typeof domGetter === 'function') { | ||
appWrapperNode = domGetter(); | ||
} | ||
else if (typeof domGetter === 'object') { | ||
appWrapperNode = domGetter; | ||
} | ||
assert(appWrapperNode, `Invalid domGetter: ${domGetter}`); | ||
return appWrapperNode; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
assert(domGetter, `Invalid domGetter:\n ${domGetter}.`); | ||
let appWrapperNode = domGetter; | ||
if (typeof domGetter === 'string') { | ||
appWrapperNode = document.querySelector(domGetter); | ||
} | ||
else if (typeof domGetter === 'function') { | ||
appWrapperNode = yield domGetter(); | ||
} | ||
else if (typeof domGetter === 'object') { | ||
appWrapperNode = domGetter; | ||
} | ||
assert(appWrapperNode, `Invalid domGetter: ${domGetter}`); | ||
return appWrapperNode; | ||
}); | ||
} | ||
@@ -834,0 +861,0 @@ |
@@ -797,2 +797,27 @@ 'use strict'; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
} | ||
function createAppContainer(name) { | ||
@@ -811,15 +836,17 @@ // Create a temporary node, which is destroyed by the module itself | ||
function getRenderNode(domGetter) { | ||
assert(domGetter, `Invalid domGetter:\n ${domGetter}.`); | ||
let appWrapperNode = domGetter; | ||
if (typeof domGetter === 'string') { | ||
appWrapperNode = document.querySelector(domGetter); | ||
} | ||
else if (typeof domGetter === 'function') { | ||
appWrapperNode = domGetter(); | ||
} | ||
else if (typeof domGetter === 'object') { | ||
appWrapperNode = domGetter; | ||
} | ||
assert(appWrapperNode, `Invalid domGetter: ${domGetter}`); | ||
return appWrapperNode; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
assert(domGetter, `Invalid domGetter:\n ${domGetter}.`); | ||
let appWrapperNode = domGetter; | ||
if (typeof domGetter === 'string') { | ||
appWrapperNode = document.querySelector(domGetter); | ||
} | ||
else if (typeof domGetter === 'function') { | ||
appWrapperNode = yield domGetter(); | ||
} | ||
else if (typeof domGetter === 'object') { | ||
appWrapperNode = domGetter; | ||
} | ||
assert(appWrapperNode, `Invalid domGetter: ${domGetter}`); | ||
return appWrapperNode; | ||
}); | ||
} | ||
@@ -826,0 +853,0 @@ |
@@ -801,2 +801,27 @@ const objectToString = Object.prototype.toString; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
} | ||
function createAppContainer(name) { | ||
@@ -815,15 +840,17 @@ // Create a temporary node, which is destroyed by the module itself | ||
function getRenderNode(domGetter) { | ||
assert(domGetter, `Invalid domGetter:\n ${domGetter}.`); | ||
let appWrapperNode = domGetter; | ||
if (typeof domGetter === 'string') { | ||
appWrapperNode = document.querySelector(domGetter); | ||
} | ||
else if (typeof domGetter === 'function') { | ||
appWrapperNode = domGetter(); | ||
} | ||
else if (typeof domGetter === 'object') { | ||
appWrapperNode = domGetter; | ||
} | ||
assert(appWrapperNode, `Invalid domGetter: ${domGetter}`); | ||
return appWrapperNode; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
assert(domGetter, `Invalid domGetter:\n ${domGetter}.`); | ||
let appWrapperNode = domGetter; | ||
if (typeof domGetter === 'string') { | ||
appWrapperNode = document.querySelector(domGetter); | ||
} | ||
else if (typeof domGetter === 'function') { | ||
appWrapperNode = yield domGetter(); | ||
} | ||
else if (typeof domGetter === 'object') { | ||
appWrapperNode = domGetter; | ||
} | ||
assert(appWrapperNode, `Invalid domGetter: ${domGetter}`); | ||
return appWrapperNode; | ||
}); | ||
} | ||
@@ -830,0 +857,0 @@ |
@@ -801,2 +801,27 @@ const objectToString = Object.prototype.toString; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
} | ||
function createAppContainer(name) { | ||
@@ -815,15 +840,17 @@ // Create a temporary node, which is destroyed by the module itself | ||
function getRenderNode(domGetter) { | ||
assert(domGetter, `Invalid domGetter:\n ${domGetter}.`); | ||
let appWrapperNode = domGetter; | ||
if (typeof domGetter === 'string') { | ||
appWrapperNode = document.querySelector(domGetter); | ||
} | ||
else if (typeof domGetter === 'function') { | ||
appWrapperNode = domGetter(); | ||
} | ||
else if (typeof domGetter === 'object') { | ||
appWrapperNode = domGetter; | ||
} | ||
assert(appWrapperNode, `Invalid domGetter: ${domGetter}`); | ||
return appWrapperNode; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
assert(domGetter, `Invalid domGetter:\n ${domGetter}.`); | ||
let appWrapperNode = domGetter; | ||
if (typeof domGetter === 'string') { | ||
appWrapperNode = document.querySelector(domGetter); | ||
} | ||
else if (typeof domGetter === 'function') { | ||
appWrapperNode = yield domGetter(); | ||
} | ||
else if (typeof domGetter === 'object') { | ||
appWrapperNode = domGetter; | ||
} | ||
assert(appWrapperNode, `Invalid domGetter: ${domGetter}`); | ||
return appWrapperNode; | ||
}); | ||
} | ||
@@ -830,0 +857,0 @@ |
@@ -807,2 +807,27 @@ (function (global, factory) { | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
} | ||
function createAppContainer(name) { | ||
@@ -821,15 +846,17 @@ // Create a temporary node, which is destroyed by the module itself | ||
function getRenderNode(domGetter) { | ||
assert(domGetter, `Invalid domGetter:\n ${domGetter}.`); | ||
let appWrapperNode = domGetter; | ||
if (typeof domGetter === 'string') { | ||
appWrapperNode = document.querySelector(domGetter); | ||
} | ||
else if (typeof domGetter === 'function') { | ||
appWrapperNode = domGetter(); | ||
} | ||
else if (typeof domGetter === 'object') { | ||
appWrapperNode = domGetter; | ||
} | ||
assert(appWrapperNode, `Invalid domGetter: ${domGetter}`); | ||
return appWrapperNode; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
assert(domGetter, `Invalid domGetter:\n ${domGetter}.`); | ||
let appWrapperNode = domGetter; | ||
if (typeof domGetter === 'string') { | ||
appWrapperNode = document.querySelector(domGetter); | ||
} | ||
else if (typeof domGetter === 'function') { | ||
appWrapperNode = yield domGetter(); | ||
} | ||
else if (typeof domGetter === 'object') { | ||
appWrapperNode = domGetter; | ||
} | ||
assert(appWrapperNode, `Invalid domGetter: ${domGetter}`); | ||
return appWrapperNode; | ||
}); | ||
} | ||
@@ -836,0 +863,0 @@ |
{ | ||
"name": "@garfish/utils", | ||
"version": "0.0.49", | ||
"version": "0.0.50", | ||
"description": "utils module.", | ||
@@ -40,3 +40,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "a56f7b76601940ec3200482749a45e882c97171d" | ||
"gitHead": "d98c4fb7d8fda13c2623f4e23c75a027e0dc17a3" | ||
} |
237255
5395
24