forked from public/fvtt-cthulhu-eternal
Initial import with skill sheet working
This commit is contained in:
3
node_modules/comment-parser/es6/stringifier/index.d.ts
generated
vendored
Normal file
3
node_modules/comment-parser/es6/stringifier/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { Block } from '../primitives.js';
|
||||
export type Stringifier = (block: Block) => string;
|
||||
export default function getStringifier(): Stringifier;
|
17
node_modules/comment-parser/es6/stringifier/index.js
generated
vendored
Normal file
17
node_modules/comment-parser/es6/stringifier/index.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
function join(tokens) {
|
||||
return (tokens.start +
|
||||
tokens.delimiter +
|
||||
tokens.postDelimiter +
|
||||
tokens.tag +
|
||||
tokens.postTag +
|
||||
tokens.type +
|
||||
tokens.postType +
|
||||
tokens.name +
|
||||
tokens.postName +
|
||||
tokens.description +
|
||||
tokens.end +
|
||||
tokens.lineEnd);
|
||||
}
|
||||
export default function getStringifier() {
|
||||
return (block) => block.source.map(({ tokens }) => join(tokens)).join('\n');
|
||||
}
|
2
node_modules/comment-parser/es6/stringifier/inspect.d.ts
generated
vendored
Normal file
2
node_modules/comment-parser/es6/stringifier/inspect.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import { Block } from '../primitives.js';
|
||||
export default function inspect({ source }: Block): string;
|
44
node_modules/comment-parser/es6/stringifier/inspect.js
generated
vendored
Normal file
44
node_modules/comment-parser/es6/stringifier/inspect.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
import { isSpace } from '../util.js';
|
||||
const zeroWidth = {
|
||||
line: 0,
|
||||
start: 0,
|
||||
delimiter: 0,
|
||||
postDelimiter: 0,
|
||||
tag: 0,
|
||||
postTag: 0,
|
||||
name: 0,
|
||||
postName: 0,
|
||||
type: 0,
|
||||
postType: 0,
|
||||
description: 0,
|
||||
end: 0,
|
||||
lineEnd: 0,
|
||||
};
|
||||
const headers = { lineEnd: 'CR' };
|
||||
const fields = Object.keys(zeroWidth);
|
||||
const repr = (x) => (isSpace(x) ? `{${x.length}}` : x);
|
||||
const frame = (line) => '|' + line.join('|') + '|';
|
||||
const align = (width, tokens) => Object.keys(tokens).map((k) => repr(tokens[k]).padEnd(width[k]));
|
||||
export default function inspect({ source }) {
|
||||
var _a, _b;
|
||||
if (source.length === 0)
|
||||
return '';
|
||||
const width = Object.assign({}, zeroWidth);
|
||||
for (const f of fields)
|
||||
width[f] = ((_a = headers[f]) !== null && _a !== void 0 ? _a : f).length;
|
||||
for (const { number, tokens } of source) {
|
||||
width.line = Math.max(width.line, number.toString().length);
|
||||
for (const k in tokens)
|
||||
width[k] = Math.max(width[k], repr(tokens[k]).length);
|
||||
}
|
||||
const lines = [[], []];
|
||||
for (const f of fields)
|
||||
lines[0].push(((_b = headers[f]) !== null && _b !== void 0 ? _b : f).padEnd(width[f]));
|
||||
for (const f of fields)
|
||||
lines[1].push('-'.padEnd(width[f], '-'));
|
||||
for (const { number, tokens } of source) {
|
||||
const line = number.toString().padStart(width.line);
|
||||
lines.push([line, ...align(width, tokens)]);
|
||||
}
|
||||
return lines.map(frame).join('\n');
|
||||
}
|
Reference in New Issue
Block a user