15270821319 4e5c5d37f9 初步设计数据库,注册登录 10 ماه پیش
..
dist 4e5c5d37f9 初步设计数据库,注册登录 10 ماه پیش
src 4e5c5d37f9 初步设计数据库,注册登录 10 ماه پیش
LICENSE 4e5c5d37f9 初步设计数据库,注册登录 10 ماه پیش
README.md 4e5c5d37f9 初步设计数据库,注册登录 10 ماه پیش
package.json 4e5c5d37f9 初步设计数据库,注册登录 10 ماه پیش

README.md

WithRequired type

This package defines the TypeScript utility type WithRequired. It transforms a type that has one or more optional fields into a type where those fields are required.

For example:

import { WithRequired } from '@apollo/utils.withrequired';

interface HasSomeOptionals {
    foo: number;
    bar?: string;
    baz?: boolean;
    quux?: string;
}

type MoreRequired = WithRequired<HasSomeOptions, 'bar' | 'baz'>;

The MoreRequired type is like HasSomeOptionals, but bar and baz are now required rather than optional. quux remains optional.