commit
690b8648a8
1 changed files with 1 additions and 2 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue