
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@molejs/global-helper
Advanced tools
``` /** * 获取BSGlobal中值 */ getBSGlobal(key: string, defaultV?: any) { return BSGlobal[key] || defaultV; }, /** * 获取租户信息 */ getTenantInfo(key?: string) { return this.getBSGlobal(key || 'tenantInfo'); }, /** * 获取用户信息 */
/**
* 获取BSGlobal中值
*/
getBSGlobal(key: string, defaultV?: any) {
return BSGlobal[key] || defaultV;
},
/**
* 获取租户信息
*/
getTenantInfo(key?: string) {
return this.getBSGlobal(key || 'tenantInfo');
},
/**
* 获取用户信息
*/
getUserInfo(key?: string): any {
return this.getBSGlobal(key || 'loginUserInfo');
},
/**
* 获取用户Id
*/
getUserId() {
const user = this.getUserInfo()
return user.Id || user.UserId || user.id;
},
/**
* 用户租户Id
*/
getTenantId() {
const tenant = this.getTenantInfo();
return tenant.Id || tenant.tenant_id || tenant.tenantId;
},
/**
* 获取环境标识
*/
getEnv() {
const env = this.getBSGlobal('env');
return {
get isProduction() {
return /production/ig.test(env);
},
get isDevelopment() {
return /development/ig.test(env) || /develop/ig.test(env);
},
get isTesting() {
return /test/ig.test(env)
}
};
},
// 获取协议
getProtocol() {
return window.location.protocol;
},
FAQs
``` /** * 获取BSGlobal中值 */ getBSGlobal(key: string, defaultV?: any) { return BSGlobal[key] || defaultV; }, /** * 获取租户信息 */ getTenantInfo(key?: string) { return this.getBSGlobal(key || 'tenantInfo'); }, /** * 获取用户信息 */
The npm package @molejs/global-helper receives a total of 0 weekly downloads. As such, @molejs/global-helper popularity was classified as not popular.
We found that @molejs/global-helper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.