Use a single js namespace as parent for all other nopaque namespaces.

This commit is contained in:
Patrick Jentsch
2023-11-09 14:29:01 +01:00
parent e8fe67d290
commit e3166ca54c
45 changed files with 322 additions and 325 deletions

View File

@@ -1,6 +1,6 @@
var Requests = {};
nopaque.requests = {};
Requests.JSONfetch = (input, init={}) => {
nopaque.requests.JSONfetch = (input, init={}) => {
return new Promise((resolve, reject) => {
let fixedInit = {};
fixedInit.headers = {};
@@ -8,7 +8,7 @@ Requests.JSONfetch = (input, init={}) => {
if (init.hasOwnProperty('body')) {
fixedInit.headers['Content-Type'] = 'application/json';
}
fetch(input, Utils.mergeObjectsDeep(init, fixedInit))
fetch(input, nopaque.Utils.mergeObjectsDeep(init, fixedInit))
.then(
(response) => {
if (response.ok) {