@types/reserved-words
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

Installation

npm install --save @types/reserved-words

Summary

This package contains type definitions for reserved-words (https://github.com/zxqfox/reserved-words#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/reserved-words.

index.d.ts

export type Dialect =
    | "es3"
    | 3
    | "es5"
    | 5
    | "es2015"
    | 6
    | "es7"
    | 7
    | "es6"
    | "default"
    | "next";

export interface Keywords {
    [index: string]: {
        [index: string]: true;
    };
}

export const KEYWORDS: Keywords;

/**
 * Checks a word for being a reserved word and returns true if the provided
 * identifier string is a reserved word in some ECMAScript dialect.
 *
 * @param word word to check
 * @param dialect dialect or version
 * @param strict strict mode additionally checks whether word is a keyword or
 * future reserved word under strict mode.
 */
export function check(
    word: string,
    dialect?: Dialect,
    strict?: boolean,
): boolean;

Additional Details

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

Credits

These definitions were written by Spencer Miskoviak.

Dependents (9)

Package Sidebar

Install

npm i @types/reserved-words

Weekly Downloads

3,705

Version

0.1.4

License

MIT

Unpacked Size

4.01 kB

Total Files

5

Last publish

Collaborators

  • types