mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 04:28:30 +00:00
fallback
This commit is contained in:
parent
470a345296
commit
8867a843ac
@ -1,6 +1,10 @@
|
|||||||
const ALLOW_MANY = ['by', 'url', 'genre', 'license'];
|
const ALLOW_MANY = ['by', 'url', 'genre', 'license'];
|
||||||
|
|
||||||
export function getMetadata(raw_code) {
|
export function getMetadata(raw_code) {
|
||||||
|
if (raw_code == null) {
|
||||||
|
console.error('saved pattern is empty or corrupted')
|
||||||
|
raw_code = '';
|
||||||
|
}
|
||||||
const comment_regexp = /\/\*([\s\S]*?)\*\/|\/\/(.*)$/gm;
|
const comment_regexp = /\/\*([\s\S]*?)\*\/|\/\/(.*)$/gm;
|
||||||
const comments = [...raw_code.matchAll(comment_regexp)].map((c) => (c[1] || c[2] || '').trim());
|
const comments = [...raw_code.matchAll(comment_regexp)].map((c) => (c[1] || c[2] || '').trim());
|
||||||
const tags = {};
|
const tags = {};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user