( ref: CategoryRefInput, context: PluginUrlContext, )
| 61 | type CategoryRefInput = Omit<CategoryRef, 'weight'> & { weight?: number }; |
| 62 | |
| 63 | export function expandCategoryRefs( |
| 64 | ref: CategoryRefInput, |
| 65 | context: PluginUrlContext, |
| 66 | ): CategoryRef[] { |
| 67 | return Array.from({ length: context.urlCount }, (_, i) => ({ |
| 68 | ...ref, |
| 69 | slug: shouldExpandForUrls(context.urlCount) |
| 70 | ? addIndex(ref.slug, i) |
| 71 | : ref.slug, |
| 72 | weight: resolveUrlWeight(context.weights, i, ref.weight), |
| 73 | })); |
| 74 | } |
no test coverage detected