Removed .js from all imports to smooth ts migration
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import resolve, { toString, traverse, map } from '../resolve.js';
|
||||
import constant from './constant.js';
|
||||
import resolve, { toString, traverse, map } from '../resolve';
|
||||
import constant from './constant';
|
||||
|
||||
const not = {
|
||||
create({right}) {
|
||||
create({ right }) {
|
||||
return {
|
||||
parseType: 'not',
|
||||
right,
|
||||
}
|
||||
},
|
||||
resolve(fn, node, scope, context){
|
||||
const {result: right} = resolve(fn, node.right, scope, context);
|
||||
if (right.parseType !== 'constant'){
|
||||
resolve(fn, node, scope, context) {
|
||||
const { result: right } = resolve(fn, node.right, scope, context);
|
||||
if (right.parseType !== 'constant') {
|
||||
return {
|
||||
result: not.create({
|
||||
right: right,
|
||||
@@ -25,16 +25,16 @@ const not = {
|
||||
context,
|
||||
};
|
||||
},
|
||||
toString(node){
|
||||
toString(node) {
|
||||
return `!${toString(node.right)}`;
|
||||
},
|
||||
traverse(node, fn){
|
||||
traverse(node, fn) {
|
||||
fn(node);
|
||||
traverse(node.right, fn);
|
||||
},
|
||||
map(node, fn){
|
||||
map(node, fn) {
|
||||
const resultingNode = fn(node);
|
||||
if (resultingNode === node){
|
||||
if (resultingNode === node) {
|
||||
node.right = map(node.right, fn);
|
||||
}
|
||||
return resultingNode;
|
||||
|
||||
Reference in New Issue
Block a user