Merge pull request #1298 from nkymut/fixtesterror

Fix test error #1297
This commit is contained in:
Jade (Rose) Rowland 2025-02-28 10:01:20 -05:00 committed by GitHub
commit 690b8648a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,10 +1,9 @@
const ALLOW_MANY = ['by', 'url', 'genre', 'license'];
import { defaultCode } from './user_pattern_utils.mjs';
export function getMetadata(raw_code) {
if (raw_code == null) {
console.error('could not extract metadata from missing pattern code');
raw_code = defaultCode;
raw_code = '';
}
const comment_regexp = /\/\*([\s\S]*?)\*\/|\/\/(.*)$/gm;
const comments = [...raw_code.matchAll(comment_regexp)].map((c) => (c[1] || c[2] || '').trim());