Socket
Socket
Sign inDemoInstall

@types/country-list

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/country-list

TypeScript definitions for country-list


Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/country-list

Summary

This package contains type definitions for country-list (https://github.com/fannarsh/country-list).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/country-list.

index.d.ts

export interface Country {
    code: string;
    name: string;
}

/**
 * Expects an array of code and country name pairs to add to the list. Doesn't return anything.
 */
export function overwrite(countries: Country[]): void;

/**
 * Expects a two-digit country code. Returns the name for that country. If not found, it returns undefined.
 */
export function getName(code: string): string | undefined;

/**
 * Expects the English country name. Returns the code for that country. If not found, it returns undefined.
 */
export function getCode(name: string): string | undefined;

/**
 * Returns an array of all country names.
 */
export function getNames(): string[];

/**
 * Returns an array of all country codes.
 */
export function getCodes(): string[];

/**
 * Returns a key-value object of all countries using the name as key.
 */
export function getNameList(): { [name: string]: string };

/**
 * Returns a key-value object of all countries using the code as key.
 */
export function getCodeList(): { [code: string]: string };

/**
 * Returns an array of all country information, in the same format as it gets imported.
 */
export function getData(): Country[];

Additional Details

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

Credits

These definitions were written by Kyle Roach, and Adam Binford.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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