rategame-shared 1.1.489 → 1.1.490

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.
@@ -7,5 +7,8 @@ export type RatingTextPart = {
7
7
  isTag: boolean;
8
8
  startOffset: number;
9
9
  };
10
+ export declare function normalizeRatingTag(display: string): string;
11
+ export declare function toStoredRatingTag(tag: string): string;
12
+ export declare function getRatingTagPath(tag: string): string;
10
13
  export declare function extractRatingTags(text: string): ExtractedRatingTag[];
11
14
  export declare function parseRatingTextWithTags(text: string): RatingTextPart[];
@@ -1,10 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseRatingTextWithTags = exports.extractRatingTags = void 0;
3
+ exports.parseRatingTextWithTags = exports.extractRatingTags = exports.getRatingTagPath = exports.toStoredRatingTag = exports.normalizeRatingTag = void 0;
4
4
  const RATING_TAG_PATTERN = /(?:^|\s)(#[\p{L}\p{N}]+)/gu;
5
5
  function normalizeRatingTag(display) {
6
6
  return display.normalize("NFKC").toLowerCase();
7
7
  }
8
+ exports.normalizeRatingTag = normalizeRatingTag;
9
+ function toStoredRatingTag(tag) {
10
+ const withHash = tag.startsWith("#") ? tag : `#${tag}`;
11
+ return normalizeRatingTag(withHash);
12
+ }
13
+ exports.toStoredRatingTag = toStoredRatingTag;
14
+ function getRatingTagPath(tag) {
15
+ return `/ratings/tag/${encodeURIComponent(toStoredRatingTag(tag).slice(1))}`;
16
+ }
17
+ exports.getRatingTagPath = getRatingTagPath;
8
18
  function getRatingTagMatches(text) {
9
19
  const matches = [];
10
20
  const regex = new RegExp(RATING_TAG_PATTERN.source, RATING_TAG_PATTERN.flags);
@@ -850,6 +850,7 @@ export declare const searchRatingSchema: import("zod").ZodObject<{
850
850
  seasonGroup: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodLiteral<"combined">, import("zod").ZodLiteral<"regularSeason">, import("zod").ZodLiteral<"playoffs">]>>;
851
851
  teamIds: import("zod").ZodOptional<import("zod").ZodString>;
852
852
  multiTeamSearch: import("zod").ZodOptional<import("zod").ZodString>;
853
+ tag: import("zod").ZodOptional<import("zod").ZodString>;
853
854
  }, "strip", import("zod").ZodTypeAny, {
854
855
  offset?: string | undefined;
855
856
  round?: string | undefined;
@@ -880,6 +881,7 @@ export declare const searchRatingSchema: import("zod").ZodObject<{
880
881
  division?: string | undefined;
881
882
  teamIds?: string | undefined;
882
883
  multiTeamSearch?: string | undefined;
884
+ tag?: string | undefined;
883
885
  }, {
884
886
  offset?: string | undefined;
885
887
  round?: string | undefined;
@@ -910,6 +912,7 @@ export declare const searchRatingSchema: import("zod").ZodObject<{
910
912
  division?: string | undefined;
911
913
  teamIds?: string | undefined;
912
914
  multiTeamSearch?: string | undefined;
915
+ tag?: string | undefined;
913
916
  }>;
914
917
  export declare const ratingLikeSchema: import("zod").ZodObject<{
915
918
  ratingId: import("zod").ZodString;
@@ -139,6 +139,7 @@ exports.searchRatingSchema = (0, zod_1.object)({
139
139
  seasonGroup: sharedTypes_1.seasonGroupingSchema.optional(),
140
140
  teamIds: (0, zod_1.string)().optional(),
141
141
  multiTeamSearch: (0, zod_1.string)().optional(),
142
+ tag: (0, zod_1.string)().optional(),
142
143
  });
143
144
  exports.ratingLikeSchema = (0, zod_1.object)({
144
145
  ratingId: (0, zod_1.string)(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rategame-shared",
3
- "version": "1.1.489",
3
+ "version": "1.1.490",
4
4
  "description": "This package contains shared resources for the Rate Game project.",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",