@samoa-house-lib/shl-types 1.9.0 → 1.9.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/types.ts +4 -2
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.9.0",
2
+ "version": "1.9.1",
3
3
  "name": "@samoa-house-lib/shl-types",
4
4
  "description": "Shared Types & Constants",
5
5
  "main": "src/index.ts",
package/src/types.ts CHANGED
@@ -22,12 +22,14 @@ export type Condition = z.infer<typeof conditionSchema>
22
22
  export type SearchParameter = z.infer<typeof searchParameterSchema>
23
23
 
24
24
  export const shlIdSchema = z.string().min(3).brand("SamoaHouseLibraryID")
25
- export const searchableTitleSchema = z.string().toLowerCase()
25
+ export const searchableTitleSchema = z.string()
26
26
  .transform((title) => {
27
27
  title
28
+ .toLowerCase()
28
29
  .replace("_", " ")
29
30
  .replace(" & ", " and ")
30
- .replace(/[^a-zA-Z0-9 ]/g, "") // Remove special characters
31
+ .replace(/[^a-z0-9 ]/g, "") // Remove special characters
32
+ .trim()
31
33
  })
32
34
 
33
35
  export const nameSchema = z.string().transform((val) => {