@platform/util.is
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -1,15 +0,11 @@ | ||
declare class Flags { | ||
readonly nodeEnv: string; | ||
readonly browser: boolean; | ||
readonly dev: boolean; | ||
readonly prod: boolean; | ||
readonly test: boolean; | ||
toObject(): { | ||
nodeEnv: string; | ||
browser: boolean; | ||
dev: boolean; | ||
prod: boolean; | ||
}; | ||
} | ||
export declare const is: Flags; | ||
export {}; | ||
export declare type IFlags = { | ||
nodeEnv: 'development' | 'production' | 'browser' | string; | ||
browser: boolean; | ||
dev: boolean; | ||
prod: boolean; | ||
test: boolean; | ||
}; | ||
export declare type IIs = IFlags & { | ||
toObject: () => IFlags; | ||
}; | ||
export declare const is: IIs; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Flags = (function () { | ||
function Flags() { | ||
var Is = (function () { | ||
function Is() { | ||
} | ||
Object.defineProperty(Flags.prototype, "nodeEnv", { | ||
Object.defineProperty(Is.prototype, "nodeEnv", { | ||
get: function () { | ||
@@ -13,3 +13,3 @@ return this.browser ? 'browser' : process.env.NODE_ENV || 'development'; | ||
}); | ||
Object.defineProperty(Flags.prototype, "browser", { | ||
Object.defineProperty(Is.prototype, "browser", { | ||
get: function () { | ||
@@ -21,3 +21,3 @@ return typeof window !== 'undefined'; | ||
}); | ||
Object.defineProperty(Flags.prototype, "dev", { | ||
Object.defineProperty(Is.prototype, "dev", { | ||
get: function () { | ||
@@ -32,3 +32,3 @@ var env = this.nodeEnv; | ||
}); | ||
Object.defineProperty(Flags.prototype, "prod", { | ||
Object.defineProperty(Is.prototype, "prod", { | ||
get: function () { | ||
@@ -40,3 +40,3 @@ return !this.dev; | ||
}); | ||
Object.defineProperty(Flags.prototype, "test", { | ||
Object.defineProperty(Is.prototype, "test", { | ||
get: function () { | ||
@@ -48,3 +48,3 @@ return this.nodeEnv === 'test'; | ||
}); | ||
Flags.prototype.toObject = function () { | ||
Is.prototype.toObject = function () { | ||
return { | ||
@@ -55,6 +55,7 @@ nodeEnv: this.nodeEnv, | ||
prod: this.prod, | ||
test: this.test, | ||
}; | ||
}; | ||
return Flags; | ||
return Is; | ||
}()); | ||
exports.is = new Flags(); | ||
exports.is = new Is(); |
{ | ||
"name": "@platform/util.is", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Environment flags.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3852
121