@putout/operator-keyword
🐊Putout operator adds ability to check if whether Identifier is a keyword or not
Last updated 3 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/operator-keyword 
SYNC missed versions from official npm registry.

@putout/operator-keyword NPM version

????Putout operator adds ability to check whether Identifier is a keyword or not.

Install

npm i putout @putout/operator-keyword

API

import {operator} from 'putout';

const {
    isKeyword,
    isTSKeyword,
    isDeclarationKeyword,
    isModuleDeclarationKeyword,
    isConditionKeyword,
} = operator;

isKeyword('if');
// returns
true;

isKeyword('abc');
// returns
false;

isDeclarationKeyword('const');
// returns
true;

isModuleDeclarationKeyword('import');
// returns
true;

isConditionKeyword('if');
// returns
true;

isStatementKeyword('for');
// returns
true;

isTSKeyword('implements');
// returns
true;

isLegacyKeyword

A previous version of import attributes used the assert keyword instead of with. The assertion feature is now non-standard.

(c) MDN

import {operator} from 'putout';

const {isLegacyKeyword} = operator;

isLegacyKeyword('assert');
// returns
true;

License

MIT

Current Tags

  • 5.0.0                                ...           latest (2 months ago)

18 Versions

  • 5.0.0                                ...           2 months ago
  • 4.2.0                                ...           2 months ago
  • 4.1.0                                ...           3 months ago
  • 4.0.0                                ...           3 months ago
  • 3.0.0                                ...           4 months ago
  • 2.2.0                                ...           a year ago
  • 2.1.0                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.8.0                                ...           a year ago
  • 1.7.0                                ...           a year ago
  • 1.6.0                                ...           a year ago
  • 1.5.1                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (11)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |