modular-core
Version:
JavaScript application modular support
22 lines • 1.97 kB
JavaScript
/*!
* Copyright (c) 2021 han_feng@foxmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
* OR OTHER DEALINGS IN THE SOFTWARE.
*/
import{template}from"lodash";var LogInfo=function(){function t(t,e,n){void 0===e&&(e="error"),this.code=t,this.level=e,this.data=n}return t.prototype.getMessage=function(){var e=t.CODES[this.code];return e?e(this.data):"未知异常"},t.prototype.toString=function(){return"["+this.code+"] "+this.getMessage()},t.CODES={E00:template("重复初始化 Modular 对象"),E01:template("模块名称未定义 ${JSON.stringify(m)}"),E02:template("模块名称重复 ${JSON.stringify(m1)}, ${JSON.stringify(m2)}"),E03:template("“${m1.name}”依赖的模块“${m2}”解析失败"),E04:template("“${m1.name}”依赖的模块“${m2}”不存在"),E05:template("模块“${m.name}”声明了重复的 extensionPoint “${ep}”"),E06:template("模块“${m.name}”引用了不存在的 extensionPoint “${ep}”")},t}();export default LogInfo;