jsf.js_next_gen
Version:
A next generation typescript reimplementation of jsf.js
45 lines • 2.28 kB
JavaScript
/*! Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
;
var _a, _b, _c;
Object.defineProperty(exports, "__esModule", { value: true });
exports.myfaces = exports.faces = void 0;
/**
* faces.js init layer which provides as per spec the proper
* window namespace if it does not exist already
*
* The idea is that we use a small shim on top of
* the implementation to provide the window namespace.
* The implementation itself is in a protected namespace
* which will be bound by the build system
*
* The documentation nevertheless targets the _api file, which
* hosts the full api
*/
if (!window.faces) {
//we lazily load the code to prevent ram bloat
const faces = require("./_api").faces;
window['faces'] = (_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : faces;
}
if (!((_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.ab)) {
const myfaces = require("./_api").myfaces;
//namespace might be extended is not exclusively reserved so we merge
window["myfaces"] = (_c = window === null || window === void 0 ? void 0 : window.myfaces) !== null && _c !== void 0 ? _c : {};
Object.keys(myfaces).forEach(key => { var _a, _b; return window.myfaces[key] = (_b = (_a = window.myfaces) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : myfaces[key]; });
}
exports.faces = window.faces;
exports.myfaces = window.myfaces;
//# sourceMappingURL=faces.js.map