Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { regexStrict, regexRelaxed } from "./lib/regex";
import { patterns, type PatternDefinition } from "./lib/patterns";
import {
patterns,
resolveSource,
type PatternDefinition,
} from "./lib/patterns";

export interface DowaOptions {
/** 検知範囲を拡大するか (デフォルト: false) */
Expand Down Expand Up @@ -71,7 +75,7 @@ export function findMatches(
const results: DowaMatch[] = [];
for (const pattern of patterns) {
if (!pattern.strict && !relaxed) continue;
const re = new RegExp(pattern.source, "gu");
const re = new RegExp(resolveSource(pattern, relaxed), "gu");
for (const m of text.matchAll(re)) {
results.push({
text: m[0],
Expand Down
Loading
Loading