Skip to content

Commit

Permalink
feat: build for release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 9, 2022
1 parent da47898 commit ee7ace6
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 89 deletions.
2 changes: 1 addition & 1 deletion build.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"owner":"technote-space","repo":"toc-generator","sha":"94282e36fd4982909a60cec7b5e82790f25f9a1b","ref":"refs/tags/test/v4.2.3.3551245126","tagName":"test/v4.2.3.3551245126","branch":"gh-actions","tags":["test/v4.2.3.3551245126","test/v4.2.3","test/v4.2","test/v4"],"updated_at":"2022-11-25T23:31:18.984Z"}
{"owner":"technote-space","repo":"toc-generator","sha":"FETCH_HEAD","ref":"refs/heads/master","tagName":"test/v4.2.3","branch":"gh-actions","tags":["test/v4.2.3","test/v4.2","test/v4"],"updated_at":"2022-12-09T15:14:05.711Z"}
13 changes: 12 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ function getDefaultExportFromCjs (x) {
function getAugmentedNamespace(n) {
var f = n.default;
if (typeof f == "function") {
var a = function () {
var a = function a () {
if (this instanceof a) {
var args = [null];
args.push.apply(args, arguments);
var Ctor = Function.bind.apply(f, args);
return new Ctor();
}
return f.apply(this, arguments);
};
a.prototype = f.prototype;
Expand Down Expand Up @@ -116276,6 +116282,7 @@ const OPENING_COMMENT = '<!-- START doctoc generated TOC please keep comment her
const CLOSING_COMMENT = '<!-- END doctoc generated TOC please keep comment here to allow auto update -->';
const CHECK_OPENING_COMMENT = '<!-- START doctoc ';
const CHECK_CLOSING_COMMENT = '<!-- END doctoc ';
const CHECK_SKIP_COMMENT = '<!-- DOCTOC SKIP ';
const DEFAULT_TITLE = '**Table of Contents** *generated with [DocToc](https://github.com/technote-space/doctoc)*';
const MARKDOWN_EXTENSIONS = ['.md', '.markdown'];
const IGNORED_DIRS = ['.', '..', '.git', 'node_modules'];
Expand Down Expand Up @@ -116457,6 +116464,7 @@ const getTargetComments = (checkComments, defaultComments) => {
};
const matchesStart = (checkOpeningComments) => (line) => getTargetComments(checkOpeningComments ?? [], CHECK_OPENING_COMMENT).some(comment => new RegExp(comment).test(line));
const matchesEnd = (checkClosingComments) => (line) => getTargetComments(checkClosingComments ?? [], CHECK_CLOSING_COMMENT).some(comment => new RegExp(comment).test(line));
const matchesSkip = (checkSkipComments) => (line) => getTargetComments(checkSkipComments ?? [], CHECK_SKIP_COMMENT).some(comment => new RegExp(comment).test(line));
const addAnchor = (mode, moduleName, header) => {
return {
...header,
Expand Down Expand Up @@ -116571,6 +116579,9 @@ const getResult = (result) => ({
});
const transform$2 = (content, options = {}) => {
const lines = content.split('\n');
if (lines.some(matchesSkip(options.checkSkipComments))) {
return getResult({ transformed: false, reason: 'skipped' });
}
const info = updateSection.parse(lines, matchesStart(options.checkOpeningComments), matchesEnd(options.checkClosingComments));
const startSection = getStartSection(lines, info, matchesEnd(options.checkClosingComments));
const extractedOptions = extractParams(startSection.join(' '));
Expand Down
Loading

0 comments on commit ee7ace6

Please sign in to comment.