@c-time/frelio-data-json-generator 2.3.0 → 2.4.0
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.
- package/dist/cli.js +6 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +4 -282
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/preview/index.d.ts +39 -0
- package/dist/preview/index.js +506 -0
- package/dist/preview/index.js.map +1 -0
- package/dist/types-CKkhMZAh.d.ts +285 -0
- package/package.json +9 -5
package/dist/cli.js
CHANGED
|
@@ -956,7 +956,7 @@ async function processListRecipes(contentTypeId, recipes, targets, context) {
|
|
|
956
956
|
}
|
|
957
957
|
return outputs;
|
|
958
958
|
}
|
|
959
|
-
async function
|
|
959
|
+
async function buildListPageData(contentTypeId, recipe, context) {
|
|
960
960
|
let contents = context.contentsByType.get(contentTypeId) ?? [];
|
|
961
961
|
contents = applyFilters(contents, recipe.filters);
|
|
962
962
|
contents = applySort(contents, recipe.sort);
|
|
@@ -967,6 +967,10 @@ async function processListWithoutPagination(contentTypeId, recipe, context) {
|
|
|
967
967
|
contents = contents.slice(0, recipe.limit);
|
|
968
968
|
}
|
|
969
969
|
const items = await processListItems(contents, recipe, context);
|
|
970
|
+
return { items, totalCount: items.length };
|
|
971
|
+
}
|
|
972
|
+
async function processListWithoutPagination(contentTypeId, recipe, context) {
|
|
973
|
+
const { items, totalCount } = await buildListPageData(contentTypeId, recipe, context);
|
|
970
974
|
const outputPath = sanitizePath(recipe.outputPath);
|
|
971
975
|
const pathError = validateOutputPath(outputPath);
|
|
972
976
|
if (pathError) {
|
|
@@ -986,7 +990,7 @@ async function processListWithoutPagination(contentTypeId, recipe, context) {
|
|
|
986
990
|
outputFile: toHtmlOutputPath(outputPath),
|
|
987
991
|
data: {
|
|
988
992
|
items,
|
|
989
|
-
totalCount
|
|
993
|
+
totalCount
|
|
990
994
|
}
|
|
991
995
|
};
|
|
992
996
|
return {
|