Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and astrobot-houston committed Jun 14, 2024
1 parent ba2b14c commit 6b541ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions packages/astro/src/core/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,11 @@ function isPublicRoute(file: URL, config: AstroConfig): boolean {

// Normalize the file directory path by removing the pagesDir prefix if it exists,
// otherwise remove the rootDir prefix.
const normalizedDir = fileDir.startsWith(pagesDir) ? fileDir.slice(pagesDir.length) : fileDir.slice(rootDir.length);
const normalizedDir = fileDir.startsWith(pagesDir)
? fileDir.slice(pagesDir.length)
: fileDir.slice(rootDir.length);

const parts = normalizedDir
.replace(pagesDir.toString(), '')
.split('/')
.slice(1);
const parts = normalizedDir.replace(pagesDir.toString(), '').split('/').slice(1);

for (const part of parts) {
if (part.startsWith('_')) return false;
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/underscore-in-folder-name.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';
import testAdapter from './test-adapter.js';
import { loadFixture } from './test-utils.js';

describe('Projects with a underscore in the folder name', () => {
let fixture;
Expand Down

0 comments on commit 6b541ec

Please sign in to comment.