@types/validate-npm-package-name
TypeScript icon, indicating that this package has built-in type declarations

4.0.2 • Public • Published

Installation

npm install --save @types/validate-npm-package-name

Summary

This package contains type definitions for validate-npm-package-name (https://github.com/npm/validate-npm-package-name).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/validate-npm-package-name.

index.d.ts

declare namespace validate {
    interface Results {
        validForNewPackages: boolean;
        validForOldPackages: boolean;
        errors?: string[] | undefined;
        warnings?: string[] | undefined;
    }

    interface ValidNames extends Results {
        validForNewPackages: true;
        validForOldPackages: true;
    }

    interface InvalidNames extends Results {
        validForNewPackages: false;
        validForOldPackages: false;
        errors: string[];
    }

    interface LegacyNames extends Results {
        validForNewPackages: false;
        validForOldPackages: true;
        warnings: string[];
    }
}

declare function validate(name: string): validate.ValidNames | validate.InvalidNames | validate.LegacyNames;

export = validate;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Florian Keller, and Piotr Błażejewicz.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/validate-npm-package-name

Weekly Downloads

35,218

Version

4.0.2

License

MIT

Unpacked Size

4.45 kB

Total Files

5

Last publish

Collaborators

  • types