JSPM

@apollo/utils.withrequired

2.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1285008
  • Score
    100M100P100Q201998F
  • License MIT

TypeScript utility type WithRequired

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@apollo/utils.withrequired) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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.