Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
76e777a3ac | |||
165cd3737e | |||
2f11d1ba0f | |||
33692ff417 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@pushrocks/smartenv",
|
||||
"version": "5.0.1",
|
||||
"version": "5.0.3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pushrocks/smartenv",
|
||||
"version": "5.0.1",
|
||||
"version": "5.0.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": "^3.1.7"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartenv",
|
||||
"version": "5.0.1",
|
||||
"version": "5.0.3",
|
||||
"description": "store things about your environment and let them travel across modules",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartenv',
|
||||
version: '5.0.3',
|
||||
description: 'store things about your environment and let them travel across modules'
|
||||
}
|
@ -28,7 +28,7 @@ export class Smartenv {
|
||||
|
||||
public async getSafeNodeModule<T = any>(moduleNameArg: string): Promise<T> {
|
||||
if (!this.isNode) {
|
||||
console.error('You tried to load a node module in a wrong context');
|
||||
console.error(`You tried to load a node module in a wrong context: ${moduleNameArg}`);
|
||||
return;
|
||||
}
|
||||
// tslint:disable-next-line: function-constructor
|
||||
@ -65,10 +65,10 @@ export class Smartenv {
|
||||
}
|
||||
|
||||
public get runtimeEnv() {
|
||||
if (typeof window !== 'undefined') {
|
||||
return 'browser';
|
||||
} else if (typeof process !== 'undefined') {
|
||||
if (typeof process !== 'undefined') {
|
||||
return 'node';
|
||||
} else {
|
||||
return 'browser';
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user