@websolutespa/bom-core 0.6.2 → 0.6.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @websolutespa/bom-core
2
2
 
3
+ ## 0.6.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Added: isReservedCollectionDescription
8
+
3
9
  ## 0.6.2
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -479,6 +479,7 @@ declare function getClassNames(...props: Array<IClassName>): string;
479
479
  declare function getCollectionDescription(text: string): ICollectionDescription;
480
480
  declare function camelToSnakeCase(text: string): string;
481
481
  declare function isValidCollectionDescription(description: ICollectionDescription): boolean;
482
+ declare function isReservedCollectionDescription(description: ICollectionDescription): boolean;
482
483
  declare function toDisplayName(text: string): string;
483
484
  declare function toPluralName(text: string): string;
484
485
  declare function toTitleCase(text: string): string;
@@ -625,4 +626,4 @@ declare function asServerProps(props: any): any;
625
626
  declare function awaitAll(array: any, callback: (item: any, index: number) => Promise<any>): Promise<any[]>;
626
627
  declare function merge(target: any, source: any): any;
627
628
 
628
- export { FetchError, FetchRequestOptions, FetchService, FindParams, FindWhereParams, IAnchor, ICategorized, ICategory, ICategoryItem, IClassName, IClassNameCollection, IClassNameValue, ICollectionDescription, IConfig, IContextBaseParams, IContextParams, IDecoratedNav, IEntity, IEquatable, ILabel, ILayout, ILocale, ILocalizable, ILocalized, ILocalizedString, IMarket, IMedia, IMediaType, IMemoryStore, IMenu, IMenuBase, IMenuCategory, IMenuCustom, IMenuGroup, IMenuItem, IMenuLink, IMenuPage, IMenuRoute, INamedEntity, IOption, IOverride, IPackages, IPage, IPageRelation, IPageRelationResult, IPageResult, IPageUnresolvedRelation, IPaginationResult, IPartial, IPrettify, IQuerable, IRedirect, IRoute, IRouteCanonical, IRouteLink, IRouteParams, ISchema, ISerializedCollection, ISerializedStore, IServerSideContext, IServerSideSplatContext, IStaticContext, IStore, ITemplate, ITitledEntity, IUndecoratedMenu, IUndecoratedMenuBase, IUndecoratedMenuCategory, IUndecoratedMenuCustom, IUndecoratedMenuGroup, IUndecoratedMenuItem, IUndecoratedMenuLink, IUndecoratedMenuPage, IUndecoratedNav, Json, JsonService, LiteralUnion, Logger, LoggerLevel, NextApiRequestCookies, Operator, PageProps, Pagination, PreviewData, QueryParams, RedirectReason, RouteStrategy, SchemaType, ServerSidePropsContext, StateValue, StaticPropsContext, ValueOf, Where, WhereAndOr, WhereBase, WhereField, asCategoryId, asEquatable, asServerProps, awaitAll, camelToSnakeCase, cloneItem, collectRoutes, consoleWarn, defaultLocale, defaultMarket, eachCategorized, eachMarketLocale, enumToList, getCategorySegments, getCategorySegmentsByCategory, getClassNames, getCollectionDescription, getEnv, getIsDevelopment, getIsProduction, getParentCategoriesById, getRootCategory, getRouteHref, httpDelete, httpFetch, httpGet, httpPatch, httpPost, httpPut, isArray, isBrowser, isCategory, isDevelopment, isEntity, isEquatable, isLocalizedString, isNotNullString, isObject, isProduction, isRelation, isStage, isUndecoratedMenuItem, isUndecoratedMenuPage, isUndecoratedNav, isUnresolvedRelation, isValidCollectionDescription, localize, localizeItem, localizeValue, localizedToString, merge, pascalCaseToCamelCase, pascalCaseToCharCase, pascalCaseToKebabCase, pascalCaseToSnakeCase, qsDeserialize, qsDeserializeRaw, qsSerialize, qsSerializeRaw, resolveMediaType, textToSlug, toCamelCase, toCharCase, toDisplayName, toFindParams, toKebabCase, toPascalCase, toPluralName, toSnakeCase, toTitleCase, toValidCollectionName, unknownCaseToPascalCase, withSchema };
629
+ export { FetchError, FetchRequestOptions, FetchService, FindParams, FindWhereParams, IAnchor, ICategorized, ICategory, ICategoryItem, IClassName, IClassNameCollection, IClassNameValue, ICollectionDescription, IConfig, IContextBaseParams, IContextParams, IDecoratedNav, IEntity, IEquatable, ILabel, ILayout, ILocale, ILocalizable, ILocalized, ILocalizedString, IMarket, IMedia, IMediaType, IMemoryStore, IMenu, IMenuBase, IMenuCategory, IMenuCustom, IMenuGroup, IMenuItem, IMenuLink, IMenuPage, IMenuRoute, INamedEntity, IOption, IOverride, IPackages, IPage, IPageRelation, IPageRelationResult, IPageResult, IPageUnresolvedRelation, IPaginationResult, IPartial, IPrettify, IQuerable, IRedirect, IRoute, IRouteCanonical, IRouteLink, IRouteParams, ISchema, ISerializedCollection, ISerializedStore, IServerSideContext, IServerSideSplatContext, IStaticContext, IStore, ITemplate, ITitledEntity, IUndecoratedMenu, IUndecoratedMenuBase, IUndecoratedMenuCategory, IUndecoratedMenuCustom, IUndecoratedMenuGroup, IUndecoratedMenuItem, IUndecoratedMenuLink, IUndecoratedMenuPage, IUndecoratedNav, Json, JsonService, LiteralUnion, Logger, LoggerLevel, NextApiRequestCookies, Operator, PageProps, Pagination, PreviewData, QueryParams, RedirectReason, RouteStrategy, SchemaType, ServerSidePropsContext, StateValue, StaticPropsContext, ValueOf, Where, WhereAndOr, WhereBase, WhereField, asCategoryId, asEquatable, asServerProps, awaitAll, camelToSnakeCase, cloneItem, collectRoutes, consoleWarn, defaultLocale, defaultMarket, eachCategorized, eachMarketLocale, enumToList, getCategorySegments, getCategorySegmentsByCategory, getClassNames, getCollectionDescription, getEnv, getIsDevelopment, getIsProduction, getParentCategoriesById, getRootCategory, getRouteHref, httpDelete, httpFetch, httpGet, httpPatch, httpPost, httpPut, isArray, isBrowser, isCategory, isDevelopment, isEntity, isEquatable, isLocalizedString, isNotNullString, isObject, isProduction, isRelation, isReservedCollectionDescription, isStage, isUndecoratedMenuItem, isUndecoratedMenuPage, isUndecoratedNav, isUnresolvedRelation, isValidCollectionDescription, localize, localizeItem, localizeValue, localizedToString, merge, pascalCaseToCamelCase, pascalCaseToCharCase, pascalCaseToKebabCase, pascalCaseToSnakeCase, qsDeserialize, qsDeserializeRaw, qsSerialize, qsSerializeRaw, resolveMediaType, textToSlug, toCamelCase, toCharCase, toDisplayName, toFindParams, toKebabCase, toPascalCase, toPluralName, toSnakeCase, toTitleCase, toValidCollectionName, unknownCaseToPascalCase, withSchema };
package/dist/index.js CHANGED
@@ -75,6 +75,7 @@ __export(src_exports, {
75
75
  isObject: () => isObject,
76
76
  isProduction: () => isProduction,
77
77
  isRelation: () => isRelation,
78
+ isReservedCollectionDescription: () => isReservedCollectionDescription,
78
79
  isStage: () => isStage,
79
80
  isUndecoratedMenuItem: () => isUndecoratedMenuItem,
80
81
  isUndecoratedMenuPage: () => isUndecoratedMenuPage,
@@ -242,6 +243,18 @@ function camelToSnakeCase(text) {
242
243
  function isValidCollectionDescription(description) {
243
244
  return description.singularName !== description.pluralName;
244
245
  }
246
+ function isReservedCollectionDescription(description) {
247
+ return [
248
+ "category",
249
+ "label",
250
+ "locale",
251
+ "market",
252
+ "menu",
253
+ "redirect",
254
+ "route",
255
+ "template"
256
+ ].includes(description.singularName);
257
+ }
245
258
  function toDisplayName(text) {
246
259
  return toTitleCase(text).replace(/\s/g, "");
247
260
  }
@@ -1125,6 +1138,7 @@ var RedirectReason = /* @__PURE__ */ ((RedirectReason2) => {
1125
1138
  isObject,
1126
1139
  isProduction,
1127
1140
  isRelation,
1141
+ isReservedCollectionDescription,
1128
1142
  isStage,
1129
1143
  isUndecoratedMenuItem,
1130
1144
  isUndecoratedMenuPage,
package/dist/index.mjs CHANGED
@@ -129,6 +129,18 @@ function camelToSnakeCase(text) {
129
129
  function isValidCollectionDescription(description) {
130
130
  return description.singularName !== description.pluralName;
131
131
  }
132
+ function isReservedCollectionDescription(description) {
133
+ return [
134
+ "category",
135
+ "label",
136
+ "locale",
137
+ "market",
138
+ "menu",
139
+ "redirect",
140
+ "route",
141
+ "template"
142
+ ].includes(description.singularName);
143
+ }
132
144
  function toDisplayName(text) {
133
145
  return toTitleCase(text).replace(/\s/g, "");
134
146
  }
@@ -1011,6 +1023,7 @@ export {
1011
1023
  isObject,
1012
1024
  isProduction,
1013
1025
  isRelation,
1026
+ isReservedCollectionDescription,
1014
1027
  isStage,
1015
1028
  isUndecoratedMenuItem,
1016
1029
  isUndecoratedMenuPage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/bom-core",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Core module of the BOM Repository",
5
5
  "keywords": [
6
6
  "bom",