@dynamatix/gb-schemas 1.2.46 → 1.2.48

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.
@@ -17,8 +17,8 @@ class Pound extends mongoose.SchemaType {
17
17
  if (typeof val !== 'string') {
18
18
  throw new mongoose.Error.CastError('Pound', val, this.path, new Error('Pound value must be a string or number'));
19
19
  }
20
- // Remove any existing £ symbol and commas for processing
21
- let cleaned = val.replace(/£|,/g, '');
20
+ // Remove commas for numeric validation
21
+ const cleaned = val.replace(/,/g, '');
22
22
  // Check if the cleaned value is a valid number
23
23
  if (isNaN(Number(cleaned))) {
24
24
  throw new mongoose.Error.CastError('Pound', val, this.path, new Error(`${val} is not a valid currency value`));
@@ -31,8 +31,8 @@ class Pound extends mongoose.SchemaType {
31
31
  minimumFractionDigits: 2,
32
32
  maximumFractionDigits: 2
33
33
  });
34
- // Add the £ symbol at the beginning
35
- return `£${formattedValue}`;
34
+ // Return without symbol prefixed
35
+ return `${formattedValue}`;
36
36
  }
37
37
  }
38
38
  // Register the custom type globally with Mongoose
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "1.2.46",
3
+ "version": "1.2.48",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",