Removed .js from all imports to smooth ts migration

This commit is contained in:
ThaumRystra
2023-09-28 21:27:05 +02:00
parent 97790264d3
commit ece4a9391a
485 changed files with 1844 additions and 1843 deletions

View File

@@ -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;