Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 1.0.0-beta.3 to 1.0.0-beta.4

dist/validate/validate-union.d.ts

2

dist/index.test.js

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

isVerified: _1.validate.boolean(),
verifiedAt: _1.validate.union(_1.validate.date(), _1.validate.enum('never')),
joinedAt: _1.validate.date(),

@@ -26,2 +27,3 @@ favoriteDishes: _1.validate.array(_1.validate.string()),

isVerified: true,
verifiedAt: 'never',
joinedAt: new Date(),

@@ -28,0 +30,0 @@ favoriteDishes: ['Pho Bo', 'Sushi'],

@@ -8,2 +8,3 @@ export { validateArray as array } from './validate-array';

export { validateString as string } from './validate-string';
export { validateUnion as union } from './validate-union';
export declare type Validate<R> = (value: unknown) => R;

@@ -17,2 +17,4 @@ "use strict";

exports.string = validate_string_1.validateString;
var validate_union_1 = require("./validate-union");
exports.union = validate_union_1.validateUnion;
//# sourceMappingURL=validate.js.map

2

package.json
{
"name": "fefe",
"version": "1.0.0-beta.3",
"version": "1.0.0-beta.4",
"description": "Validate, sanitize and transform values with proper types.",

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

@@ -7,3 +7,3 @@ # fefe

Validate, sanitize and transform values with proper types and with zero dependencies.
Validate, sanitize and transform values with proper TypeScript types and with zero dependencies.

@@ -162,2 +162,6 @@ **🔎 Validation:** checks a value (example: check if value is string)<br/>

### `validate.union(validator1, validator2, ...)`
Returns a function `(value: unknown) => return1 | return2 | ...` that returns the return value of the first validator called with `value` that does not throw. The function throws if all validators throw.
### `transform.parseBoolean()`

@@ -164,0 +168,0 @@

@@ -16,2 +16,3 @@ import { expect } from 'chai'

isVerified: validate.boolean(),
verifiedAt: validate.union(validate.date(), validate.enum('never')),
joinedAt: validate.date(),

@@ -29,2 +30,3 @@ favoriteDishes: validate.array(validate.string()),

isVerified: true,
verifiedAt: 'never',
joinedAt: new Date(),

@@ -31,0 +33,0 @@ favoriteDishes: ['Pho Bo', 'Sushi'],

@@ -8,3 +8,4 @@ export { validateArray as array } from './validate-array'

export { validateString as string } from './validate-string'
export { validateUnion as union } from './validate-union'
export type Validate<R> = (value: unknown) => R

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc