🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

fefe

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fefe - npm Package Compare versions

Comparing version

to
3.1.0

dist/discriminated-union.d.ts

1

dist/index.d.ts

@@ -8,2 +8,3 @@ export * from './errors';

export * from './date';
export * from './discriminated-union';
export * from './enumerate';

@@ -10,0 +11,0 @@ export * from './map-object-keys';

@@ -20,2 +20,3 @@ "use strict";

__exportStar(require("./date"), exports);
__exportStar(require("./discriminated-union"), exports);
__exportStar(require("./enumerate"), exports);

@@ -22,0 +23,0 @@ __exportStar(require("./map-object-keys"), exports);

2

package.json
{
"name": "fefe",
"version": "3.0.0",
"version": "3.1.0",
"description": "Validate, sanitize and transform values with proper types.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -223,2 +223,12 @@ # fefe

### `discriminatedUnion(key, definition, options?): Validator<ObjectResult<D>>`
Returns a validator that returns `value` if:
* it is an object and
* the `value[key]` is a key of `definition`
* `value` (without `key`) passes the validation as specified in `definition[key]`.
Otherwise it returns an error. A new object is returned that has the results of the validator functions as values.
Options: see `object()`.
### `enumerate(value1, value2, ...): Validator<value1 | value2 | ...>`

@@ -225,0 +235,0 @@

Sorry, the diff of this file is not supported yet