@putout/plugin-types 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,7 @@ const NAMES = {
10
10
  boolean: 'isBool',
11
11
  undefined: 'isUndefined',
12
12
  symbol: 'isSymbol',
13
+ bigint: 'isBigInt',
13
14
  };
14
15
 
15
16
  const GENERAL = 'typeof __a === "__b"';
@@ -21,6 +22,7 @@ const BODIES = {
21
22
  boolean: `typeof __a === 'boolean'`,
22
23
  undefined: `typeof __a === 'undefined'`,
23
24
  symbol: `typeof __a === 'symbol'`,
25
+ bigint: `typeof __a === 'bigint'`,
24
26
  };
25
27
 
26
28
  module.exports.report = () => `Use function to check type instead of 'typeof'`;
@@ -46,6 +48,7 @@ module.exports.replace = () => ({
46
48
  [BODIES.boolean]: 'isBool(__a)',
47
49
  [BODIES.undefined]: 'isUndefined(__a)',
48
50
  [BODIES.symbol]: 'isSymbol(__a)',
51
+ [BODIES.bigint]: 'isBigInt(__a)',
49
52
  });
50
53
 
51
54
  function isBind(path, name) {
@@ -9,5 +9,6 @@ module.exports.declare = () => ({
9
9
  isObject: `const isObject = (a) => a && typeof a === 'object'`,
10
10
  isUndefined: `const isUndefined = (a) => typeof a === 'undefined'`,
11
11
  isSymbol: `const isSymbol = (a) => typeof a === 'symbol'`,
12
+ isBigInt: `const isBigInt = (a) => typeof a === 'bigint'`,
12
13
  isNull: `const isNull = (a) => !a && typeof a === 'object'`,
13
14
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-types",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin adds ability to transform code related to types assertions",