create-typescript-app 2.26.4 → 2.26.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { indicatorsTemplatedBy } from "./readReadmeFootnotes.js";
|
|
2
2
|
const indicatorAfterAllContributors = /<!--\s*ALL-CONTRIBUTORS-LIST:END\s*-->/;
|
|
3
3
|
const indicatorAfterAllContributorsSpellCheck = /<!--\s*spellchecker:\s*enable\s*-->/;
|
|
4
4
|
async function readReadmeAdditional(getReadme) {
|
|
@@ -10,10 +10,16 @@ async function readReadmeAdditional(getReadme) {
|
|
|
10
10
|
if (!indexAfterContributors) {
|
|
11
11
|
return void 0;
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const indexOfFirstTemplatedBy = indicatorsTemplatedBy.reduce(
|
|
14
|
+
(smallest, indicator) => {
|
|
15
|
+
const indexOf = indicator.exec(readme)?.index;
|
|
16
|
+
return indexOf ? Math.min(smallest, indexOf) : smallest;
|
|
17
|
+
},
|
|
18
|
+
readme.length
|
|
19
|
+
);
|
|
14
20
|
return readme.slice(
|
|
15
21
|
indexAfterContributors.index + indexAfterContributors[0].length,
|
|
16
|
-
|
|
22
|
+
indexOfFirstTemplatedBy
|
|
17
23
|
).trim();
|
|
18
24
|
}
|
|
19
25
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const indicatorsTemplatedBy: RegExp[];
|
|
2
2
|
declare function readReadmeFootnotes(getReadme: () => Promise<string>): Promise<string | undefined>;
|
|
3
3
|
|
|
4
|
-
export {
|
|
4
|
+
export { indicatorsTemplatedBy, readReadmeFootnotes };
|
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
const
|
|
1
|
+
const indicatorsTemplatedBy = [
|
|
2
|
+
/> .* This package (?:is|was) (?:based|build|templated) (?:on|with)/,
|
|
3
|
+
/<!-- You can remove this notice/
|
|
4
|
+
];
|
|
2
5
|
async function readReadmeFootnotes(getReadme) {
|
|
3
6
|
const readme = await getReadme();
|
|
4
7
|
if (!readme) {
|
|
5
8
|
return void 0;
|
|
6
9
|
}
|
|
7
|
-
const
|
|
8
|
-
|
|
10
|
+
const indexOfLastTemplatedBy = indicatorsTemplatedBy.reduce(
|
|
11
|
+
(largest, indicator) => {
|
|
12
|
+
const indexOf = indicator.exec(readme)?.index;
|
|
13
|
+
return indexOf ? Math.max(largest, indexOf) : largest;
|
|
14
|
+
},
|
|
15
|
+
0
|
|
16
|
+
);
|
|
17
|
+
if (!indexOfLastTemplatedBy) {
|
|
9
18
|
return void 0;
|
|
10
19
|
}
|
|
11
|
-
const indexOfNextLine = readme.indexOf("\n",
|
|
20
|
+
const indexOfNextLine = readme.indexOf("\n", indexOfLastTemplatedBy);
|
|
12
21
|
return readme.slice(indexOfNextLine).trim() || void 0;
|
|
13
22
|
}
|
|
14
23
|
export {
|
|
15
|
-
|
|
24
|
+
indicatorsTemplatedBy,
|
|
16
25
|
readReadmeFootnotes
|
|
17
26
|
};
|