Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
529 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.default = isType;
|
---|
| 7 |
|
---|
| 8 | var _definitions = require("../definitions");
|
---|
| 9 |
|
---|
| 10 | function isType(nodeType, targetType) {
|
---|
| 11 | if (nodeType === targetType) return true;
|
---|
| 12 | if (_definitions.ALIAS_KEYS[targetType]) return false;
|
---|
| 13 | const aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType];
|
---|
| 14 |
|
---|
| 15 | if (aliases) {
|
---|
| 16 | if (aliases[0] === nodeType) return true;
|
---|
| 17 |
|
---|
| 18 | for (const alias of aliases) {
|
---|
| 19 | if (nodeType === alias) return true;
|
---|
| 20 | }
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | return false;
|
---|
| 24 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.