common-types
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -33,19 +33,4 @@ /** | ||
export declare type uri = string; | ||
export declare enum STAGE { | ||
prod = "prod", | ||
stage = "stage", | ||
test = "test", | ||
dev = "dev", | ||
production = "prod", | ||
staging = "stage", | ||
testing = "test", | ||
development = "dev", | ||
} | ||
export declare enum FirebaseEvent { | ||
value = "value", | ||
child_added = "child_added", | ||
child_moved = "child_moved", | ||
child_removed = "child_removed", | ||
child_changed = "child_changed", | ||
} | ||
export declare const STAGE_MAP: IDictionary<string>; | ||
export declare function STAGE(stage: string): string; | ||
export declare type AWSGatewayCallback<T = IAWSGatewayResponse> = (error: any, response: T) => void; | ||
@@ -52,0 +37,0 @@ export interface IAWSGatewayResponse { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var STAGE; | ||
(function (STAGE) { | ||
STAGE["prod"] = "prod"; | ||
STAGE["stage"] = "stage"; | ||
STAGE["test"] = "test"; | ||
STAGE["dev"] = "dev"; | ||
STAGE["production"] = "prod"; | ||
STAGE["staging"] = "stage"; | ||
STAGE["testing"] = "test"; | ||
STAGE["development"] = "dev"; | ||
})(STAGE = exports.STAGE || (exports.STAGE = {})); | ||
var FirebaseEvent; | ||
(function (FirebaseEvent) { | ||
FirebaseEvent["value"] = "value"; | ||
FirebaseEvent["child_added"] = "child_added"; | ||
FirebaseEvent["child_moved"] = "child_moved"; | ||
FirebaseEvent["child_removed"] = "child_removed"; | ||
FirebaseEvent["child_changed"] = "child_changed"; | ||
})(FirebaseEvent = exports.FirebaseEvent || (exports.FirebaseEvent = {})); | ||
exports.STAGE_MAP = { | ||
prod: "prod", | ||
stage: "stage", | ||
test: "test", | ||
dev: "dev", | ||
production: "prod", | ||
staging: "stage", | ||
testing: "test", | ||
development: "dev" | ||
}; | ||
function STAGE(stage) { | ||
if (new Set(Object.keys(exports.STAGE_MAP)).has(stage)) { | ||
return exports.STAGE_MAP[stage]; | ||
} | ||
else { | ||
console.warn(`An invalid stage was passed in: "${stage}"; will use "dev" as default`); | ||
return "dev"; | ||
} | ||
} | ||
exports.STAGE = STAGE; | ||
//# sourceMappingURL=common-types.js.map |
{ | ||
"name": "common-types", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Common types not included in Typescript", | ||
@@ -5,0 +5,0 @@ "main": "lib/common-types.js", |
@@ -38,19 +38,22 @@ // import chalk from "chalk"; | ||
export enum STAGE { | ||
prod = "prod", | ||
stage = "stage", | ||
test = "test", | ||
dev = "dev", | ||
production = prod, | ||
staging = stage, | ||
testing = test, | ||
development = dev | ||
} | ||
export const STAGE_MAP: IDictionary<string> = { | ||
prod: "prod", | ||
stage: "stage", | ||
test: "test", | ||
dev: "dev", | ||
production: "prod", | ||
staging: "stage", | ||
testing: "test", | ||
development: "dev" | ||
}; | ||
export enum FirebaseEvent { | ||
value = "value", | ||
child_added = "child_added", | ||
child_moved = "child_moved", | ||
child_removed = "child_removed", | ||
child_changed = "child_changed" | ||
export function STAGE(stage: string) { | ||
if (new Set(Object.keys(STAGE_MAP)).has(stage)) { | ||
return STAGE_MAP[stage]; | ||
} else { | ||
console.warn( | ||
`An invalid stage was passed in: "${stage}"; will use "dev" as default` | ||
); | ||
return "dev"; | ||
} | ||
} | ||
@@ -57,0 +60,0 @@ |
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
8691
208