Skip to content

Commit

Permalink
Better demo hack
Browse files Browse the repository at this point in the history
  • Loading branch information
slevithan committed Nov 3, 2024
1 parent bc74540 commit 6c54702
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
11 changes: 3 additions & 8 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,10 @@ <h2>Try it</h2>
</details>
</main>

<!-- Only available if running locally -->
<!-- Hack to make it work on GitHub Pages where `dist/` isn't checked in; use the latest release's copy -->
<script src="https://cdn.jsdelivr.net/npm/oniguruma-to-es/dist/index.min.js"></script>
<!-- If running in development, replace with local copy -->
<script src="../dist/index.min.js"></script>
<script>
// Hack to make it work on GitHub Pages, where `dist/` isn't checked in; use the last published
// release's copy
if (typeof OnigurumaToES === 'undefined') {
document.write('<script src="https://cdn.jsdelivr.net/npm/oniguruma-to-es/dist/index.min.js"><\/script>');
}
</script>
<script src="./demo.js"></script>
<script>
// For testing in the console
Expand Down
5 changes: 1 addition & 4 deletions spec/match-char-class-range.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ describe('CharacterClassRange', () => {
expect('d').not.toFindMatch(r`[a-c-z]`);
});

it('should throw for range with range', () => {
expect(() => compile(r`[a-0-9]`)).toThrow();
});

it('should throw for range with set', () => {
expect(() => compile(r`[a-\w]`)).toThrow();
expect(() => compile(r`[\w-a]`)).toThrow();
Expand All @@ -70,5 +66,6 @@ describe('CharacterClassRange', () => {
it('should throw for reversed ranges', () => {
expect(() => compile(r`[z-a]`)).toThrow();
expect(() => compile(r`[\u{1}-\0]`)).toThrow();
expect(() => compile(r`[a-0-9]`)).toThrow();
});
});

0 comments on commit 6c54702

Please sign in to comment.