mirror of
https://github.com/deployphp/action.git
synced 2025-06-29 20:54:14 +00:00
Add node_modules
This commit is contained in:
parent
e1f786311a
commit
554eb0b122
994 changed files with 195567 additions and 0 deletions
37
node_modules/yaml/browser/dist/compose/resolve-end.js
generated
vendored
Normal file
37
node_modules/yaml/browser/dist/compose/resolve-end.js
generated
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
function resolveEnd(end, offset, reqSpace, onError) {
|
||||
let comment = '';
|
||||
if (end) {
|
||||
let hasSpace = false;
|
||||
let sep = '';
|
||||
for (const token of end) {
|
||||
const { source, type } = token;
|
||||
switch (type) {
|
||||
case 'space':
|
||||
hasSpace = true;
|
||||
break;
|
||||
case 'comment': {
|
||||
if (reqSpace && !hasSpace)
|
||||
onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');
|
||||
const cb = source.substring(1) || ' ';
|
||||
if (!comment)
|
||||
comment = cb;
|
||||
else
|
||||
comment += sep + cb;
|
||||
sep = '';
|
||||
break;
|
||||
}
|
||||
case 'newline':
|
||||
if (comment)
|
||||
sep += source;
|
||||
hasSpace = true;
|
||||
break;
|
||||
default:
|
||||
onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${type} at node end`);
|
||||
}
|
||||
offset += source.length;
|
||||
}
|
||||
}
|
||||
return { comment, offset };
|
||||
}
|
||||
|
||||
export { resolveEnd };
|
Loading…
Add table
Add a link
Reference in a new issue