Skip to content

Commit

Permalink
fix(const): fix const value and its name
Browse files Browse the repository at this point in the history
  • Loading branch information
Arylo committed Dec 11, 2018
1 parent 9aa35eb commit 691cd36
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ npm install node-env-manager
```javascript
const { ENV } = require("node-env-manager");

ENV.PROD // -> "production",
ENV.PROD // -> "prod",
ENV.PRODUCT // -> "product",
ENV.PRODUCTION // -> "production",
ENV.DEV // -> "dev",
ENV.DEVELOP // -> "develop",
Expand Down
16 changes: 9 additions & 7 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/** NODE_ENV 集合 */
export enum ENV {
/** 开发环境 */
PROD = "production",
/** 开发环境 */
PRODUCTION = "production",
/** 生产环境 */
DEV = "dev",
PROD = "prod",
/** 生产环境 */
DEVELOP = "develop",
PRODUCT = "product",
/** 生产环境 */
PRODUCTION = "production",
/** 开发环境 */
DEV = "dev",
/** 开发环境 */
DEVELOP = "develop",
/** 开发环境 */
DEVELOPMENT = "development",
/** 本地环境 */
LOCAL = "local",
Expand Down Expand Up @@ -104,7 +106,7 @@ export const isProd = () => {
return false;
}
env = env.trim().toLowerCase();
const envs: string[] = [ ENV.PROD, ENV.PRODUCTION ];
const envs: string[] = [ ENV.PROD, ENV.PRODUCT, ENV.PRODUCTION ];
return envs.indexOf(env) !== -1;
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-env-manager",
"version": "1.0.1",
"version": "1.0.2",
"description": "Operating on the NODE_ENV environmental variable",
"main": "dist/index.js",
"types": "lib/index.ts",
Expand Down

0 comments on commit 691cd36

Please sign in to comment.