123456789101112131415161718192021222324252627282930313233343536373839 |
- 'use strict';
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = extractValueFromUnaryExpression;
- function extractValueFromUnaryExpression(value) {
-
- var getValue = require('./index.js').default;
- var operator = value.operator,
- argument = value.argument;
- switch (operator) {
- case '-':
- return -getValue(argument);
- case '+':
- return +getValue(argument);
- case '!':
- return !getValue(argument);
- case '~':
- return ~getValue(argument);
- case 'delete':
-
- return true;
- case 'typeof':
- case 'void':
- default:
- return undefined;
- }
- }
|