Comparing version 1.16.0 to 1.17.0
@@ -6,3 +6,4 @@ export declare enum Stage { | ||
} | ||
export declare const stage: string; | ||
export declare const isOfStage: import("type-fns").AssessWithAssure<string | number | symbol, Stage>; | ||
export declare const stage: Stage; | ||
export declare const serviceClientStage: Stage; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.serviceClientStage = exports.stage = exports.Stage = void 0; | ||
exports.serviceClientStage = exports.stage = exports.isOfStage = exports.Stage = void 0; | ||
const error_fns_1 = require("@ehmpathy/error-fns"); | ||
const type_fns_1 = require("type-fns"); | ||
var Stage; | ||
@@ -10,3 +12,16 @@ (function (Stage) { | ||
})(Stage || (exports.Stage = Stage = {})); | ||
exports.isOfStage = (0, type_fns_1.createIsOfEnum)(Stage); | ||
/** | ||
* verify that the server is on UTC timezone | ||
* | ||
* why? | ||
* - non UTC timezone usage causes problems and takes a while to track down | ||
* - by failing fast if the server our code runs in is not in UTC, we avoid these issues | ||
* => | ||
* - create a pit of success | ||
*/ | ||
const TIMEZONE = process.env.TZ; | ||
if (TIMEZONE !== 'UTC') | ||
throw new error_fns_1.UnexpectedCodePathError('env.TZ is not set to UTC. this can cause issues. please set the env var', { found: TIMEZONE, desire: 'UTC' }); | ||
/** | ||
* this allows us to infer what the stage should be in environments that do not have STAGE specified | ||
@@ -36,2 +51,4 @@ * - e.g., when running locally | ||
throw new Error('process.env.STAGE must be defined'); | ||
if (!(0, exports.isOfStage)(stage)) | ||
throw new Error(`invalid stage defined '${stage}'`); | ||
return { stage }; | ||
@@ -38,0 +55,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"description": "A set of types, type checks, and type guards for simpler, safer, and easier to read code.", | ||
"version": "1.16.0", | ||
"version": "1.17.0", | ||
"repository": "ehmpathy/type-fns", | ||
@@ -20,2 +20,3 @@ "homepage": "https://github.com/ehmpathy/type-fns", | ||
"bugs": "https://github.com/ehmpathy/type-fns/issues", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
@@ -39,3 +40,2 @@ "engines": { | ||
"test:types": "tsc -p ./tsconfig.build.json --noEmit", | ||
"prepublish": "npm run build", | ||
"test:format:prettier": "prettier --parser typescript --check 'src/**/*.ts' --config ./prettier.config.js", | ||
@@ -46,4 +46,4 @@ "test:format": "npm run test:format:prettier", | ||
"test:lint": "npm run test:lint:eslint && npm run test:lint:deps", | ||
"test:unit": "jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests", | ||
"test:integration": "jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests", | ||
"test:unit": "jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')", | ||
"test:integration": "jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')", | ||
"test:acceptance:locally": "npm run build && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests", | ||
@@ -53,9 +53,16 @@ "test": "npm run test:commits && npm run test:types && npm run test:format && npm run test:lint && npm run test:unit && npm run test:integration && npm run test:acceptance:locally", | ||
"prepush": "npm run test && npm run build", | ||
"prepublish": "npm run build", | ||
"preversion": "npm run prepush", | ||
"postversion": "git push origin HEAD --tags --no-verify" | ||
"postversion": "git push origin HEAD --tags --no-verify", | ||
"postinstall": "[ -d .git ] && npx husky install || exit 0" | ||
}, | ||
"dependencies": { | ||
"@ehmpathy/error-fns": "1.0.2", | ||
"type-fns": "1.16.0", | ||
"uuid": "9.0.0" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "13.1.0", | ||
"@commitlint/cli": "19.3.0", | ||
"@commitlint/config-conventional": "13.1.0", | ||
"@trivago/prettier-plugin-sort-imports": "2.0.4", | ||
"@trivago/prettier-plugin-sort-imports": "4.3.0", | ||
"@tsconfig/node-lts-strictest": "18.12.1", | ||
@@ -68,4 +75,4 @@ "@types/jest": "29.2.4", | ||
"cz-conventional-changelog": "3.3.0", | ||
"declapract": "0.11.2", | ||
"declapract-typescript-ehmpathy": "0.23.7", | ||
"declapract": "0.11.5", | ||
"declapract-typescript-ehmpathy": "0.33.6", | ||
"depcheck": "1.4.3", | ||
@@ -77,7 +84,7 @@ "eslint": "8.56.0", | ||
"eslint-plugin-prettier": "4.2.1", | ||
"husky": "7.0.2", | ||
"husky": "8.0.3", | ||
"jest": "29.3.1", | ||
"prettier": "2.8.1", | ||
"test-fns": "1.3.0", | ||
"ts-jest": "29.0.3", | ||
"ts-jest": "29.1.3", | ||
"ts-node": "10.9.2", | ||
@@ -91,6 +98,3 @@ "typescript": "5.4.5", | ||
} | ||
}, | ||
"dependencies": { | ||
"@ehmpathy/error-fns": "1.0.2" | ||
} | ||
} |
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances 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
80599
3
117
1131
1
4
+ Addedtype-fns@1.16.0
+ Addeduuid@9.0.0
+ Addedtype-fns@1.16.0(transitive)
+ Addeduuid@9.0.0(transitive)