Skip to content

Commit

Permalink
fix: use system path separators
Browse files Browse the repository at this point in the history
  • Loading branch information
mlrawlings committed Dec 19, 2024
1 parent e91d2e7 commit 3183224
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/translator-interop/src/feature-detection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { types as t } from "@marko/compiler";
import { getTagDef } from "@marko/compiler/babel-utils";
import { taglibs as taglibs6 } from "@marko/runtime-tags/translator";
import { taglibs as taglibs5 } from "marko/translator";
import { sep } from "path";

import { buildAggregateError } from "./build-aggregate-error";

Expand Down Expand Up @@ -30,8 +31,8 @@ export function isTagsAPI(path: t.NodePath) {

if (file.opts.filename) {
const filename = file.opts.filename;
const tagsIndex = filename.lastIndexOf("/tags/");
const componentsIndex = filename.lastIndexOf("/components/");
const tagsIndex = filename.lastIndexOf(sep + "tags" + sep);
const componentsIndex = filename.lastIndexOf(sep + "components" + sep);
if (tagsIndex > componentsIndex) {
forceTags = true;
}
Expand Down

0 comments on commit 3183224

Please sign in to comment.