From aeeb0676f6af940e8639f64e27781443694ca05e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20B=C3=B6hm?= <188768+fb55@users.noreply.github.com> Date: Mon, 23 May 2022 10:57:43 +0100 Subject: [PATCH] fix: Fix ESM --- src/compile.ts | 6 +++--- src/index.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compile.ts b/src/compile.ts index d7d37e31..1232eedb 100644 --- a/src/compile.ts +++ b/src/compile.ts @@ -1,4 +1,4 @@ -import { trueFunc, falseFunc } from "boolbase"; +import boolbase from "boolbase"; /** * Returns a function that checks if an elements index matches the given rule @@ -34,13 +34,13 @@ export function compile( * * `b < 0` here as we subtracted 1 from `b` above. */ - if (b < 0 && a <= 0) return falseFunc; + if (b < 0 && a <= 0) return boolbase.falseFunc; // When `a` is in the range -1..1, it matches any element (so only `b` is checked). if (a === -1) return (index) => index <= b; if (a === 0) return (index) => index === b; // When `b <= 0` and `a === 1`, they match any element. - if (a === 1) return b < 0 ? trueFunc : (index) => index >= b; + if (a === 1) return b < 0 ? boolbase.trueFunc : (index) => index >= b; /* * Otherwise, modulo can be used to check if there is a match. diff --git a/src/index.ts b/src/index.ts index 2494e25e..5b348949 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ -import { parse } from "./parse"; -import { compile, generate } from "./compile"; +import { parse } from "./parse.js"; +import { compile, generate } from "./compile.js"; export { parse, compile, generate };