@epistemology-factory/crocks-web
Advanced tools
Comparing version 0.2.10 to 0.3.0
{ | ||
"name": "@epistemology-factory/crocks-web", | ||
"version": "0.2.10", | ||
"version": "0.3.0", | ||
"description": "Functions to help write web applications with crocks", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -5,3 +5,3 @@ "use strict"; | ||
const { ERROR_TYPES } = require("../../../../web/lambda/errors"); | ||
const { ERROR_TYPES } = require("../../../../web/errors"); | ||
@@ -22,6 +22,2 @@ // anError = (String) -> Matcher | ||
const anInvalidEnvVarError = (name) => anEnvVarError(ERROR_TYPES.INVALID_ENV_VAR, name) | ||
const aMissingEnvVarError = (name) => anEnvVarError(ERROR_TYPES.MISSING_ENV_VAR, name) | ||
const anInvalidContentTypeError = (contentType) => | ||
@@ -33,2 +29,16 @@ allOf( | ||
const anInvalidEnvVarError = (name) => anEnvVarError(ERROR_TYPES.INVALID_ENV_VAR, name) | ||
const anInvalidStateError = (reason) => | ||
allOf( | ||
anError(ERROR_TYPES.INVALID_STATE), | ||
hasProperty("reason", reason) | ||
) | ||
const aMissingEnvVarError = (name) => anEnvVarError(ERROR_TYPES.MISSING_ENV_VAR, name) | ||
const aMissingPropError = (prop) => anInvalidStateError(`Missing prop '${prop}'`) | ||
const aMissingPathError = (path) => aMissingPropError(path.join(".")) | ||
const aValidationError = (failures) => | ||
@@ -44,4 +54,7 @@ allOf( | ||
anInvalidEnvVarError, | ||
anInvalidStateError, | ||
aMissingEnvVarError, | ||
aMissingPropError, | ||
aMissingPathError, | ||
aValidationError | ||
} |
@@ -6,4 +6,6 @@ "use strict"; | ||
...require("./constraints"), | ||
...require("./json"), | ||
...require("./object"), | ||
...require("./strings"), | ||
...require("./object") | ||
...require("./validator") | ||
}; |
@@ -15,3 +15,3 @@ "use strict"; | ||
const { LOG_LEVELS, LOG_LEVEL_STRINGS } = require("../../logging/logger"); | ||
const { invalidEnvVar } = require("./errors"); | ||
const { invalidEnvVar } = require("../errors"); | ||
@@ -18,0 +18,0 @@ // getLogger :: (Integer -> Integer -> String -> a -> a) -> Object -> Result Object Assign |
@@ -18,3 +18,3 @@ "use strict"; | ||
const { isSchemaValid, isDefinedFailure } = require("../../validation/validators"); | ||
const { validationError } = require("./errors"); | ||
const { validationError } = require("../errors"); | ||
@@ -21,0 +21,0 @@ // toArray :: a -> [ a ] |
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
31715
878