Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gucciogucci/contented

Package Overview
Dependencies
Maintainers
4
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gucciogucci/contented - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

19

dist/combineIntoObject.d.ts
import { ContentedError } from './ContentedError';
import { ErrorType, ExpectedType, NonFatalErrorType, Type } from './Type';
export declare function combineIntoObject<E extends ContentedError, O extends Record<string, Type<unknown, E>>>(obj: O): Type<ObjectOf<O>, ErrorTypeInObject<O>>;
declare type ObjectOf<O extends ObjectOfTypes> = IsWithoutNonFatalErrors<O> extends true ? ExpectedTypeInObject<O> : ExpectedTypeInObject<O> | [ExpectedTypeInObject<O>, NonFatalErrorTypesInObject<O>[]];
export declare function combineIntoObject<E extends ContentedError, O extends Record<string, Type<unknown, E>>>(obj: O): Type<ObjectOf<O>, { [K in keyof O]: ErrorType<O[K]>; }[keyof O]>;
declare type ObjectOf<O extends ObjectOfTypes> = IsWithoutNonFatalErrors<O> extends true ? ExpandRecursively<ExpectedTypeInObject<O>> : ExpandRecursively<ExpectedTypeInObject<O>> | [ExpandRecursively<ExpectedTypeInObject<O>>, NonFatalErrorTypesInObject<O>[]];
declare type IsWithoutNonFatalErrors<O extends ObjectOfTypes> = NonFatalErrorTypesInObject<O> extends never ? true : false;

@@ -9,9 +9,14 @@ declare type NonFatalErrorTypesInObject<O extends ObjectOfTypes> = {

}[keyof O];
declare type ExpectedTypeInObject<O extends ObjectOfTypes> = {
declare type ExpectedTypeInObject<O extends ObjectOfTypes> = EnforceOptionality<{
[K in keyof O]: ExpectedType<O[K]>;
};
declare type ErrorTypeInObject<O extends ObjectOfTypes> = {
[K in keyof O]: ErrorType<O[K]>;
}>;
declare type ObjectOfTypes = Record<string, Type<unknown, unknown>>;
declare type EnforceOptionality<T> = Optional<T, OptionalKeys<T>>;
declare type Optional<T, K extends keyof T> = Omit<T, K> & Partial<T>;
declare type OptionalKeys<O extends {}> = {
[K in keyof O]-?: [O[K] & undefined] extends [never] ? never : K;
}[keyof O];
declare type ObjectOfTypes = Record<string, Type<unknown, unknown>>;
declare type ExpandRecursively<T> = T extends object ? T extends infer O ? {
[K in keyof O]: ExpandRecursively<O[K]>;
} : never : T;
export {};

@@ -35,1 +35,2 @@ "use strict";

exports.combineIntoObject = combineIntoObject;
// See also: https://stackoverflow.com/a/63990350

@@ -1,2 +0,2 @@

import { ExpectedType, Type } from "./Type";
import { ExpectedType, Type } from './Type';
export declare type Infer<T> = [T] extends [Type<infer A, any>] ? ExpectedType<A> : never;
{
"name": "@gucciogucci/contented",
"description": "A library to coerce values at run-time.",
"version": "1.2.0",
"version": "1.2.1",
"author": "Gucci <npm@gucci.com>",

@@ -6,0 +6,0 @@ "license": "LGPL-3.0-only",

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