laplace-api 1.4.5 → 1.4.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "laplace-api",
3
- "version": "1.4.5",
3
+ "version": "1.4.7",
4
4
  "description": "Client library for Laplace API for the US stock market and BIST (Istanbul stock market) fundamental financial data.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,5 +1,6 @@
1
1
  import { Client } from './client';
2
2
  import { Region, Locale } from './collections';
3
+ import { LaplaceHTTPError } from './errors';
3
4
 
4
5
  export enum AssetType {
5
6
  Stock = 'stock',
@@ -170,11 +171,11 @@ export class StockClient extends Client {
170
171
  });
171
172
  }
172
173
 
173
- async validateCustomHistoricalPriceDate(date: string) {
174
+ validateCustomHistoricalPriceDate(date: string) {
174
175
  const pattern = /^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?$/;
175
176
  const matched = date.match(pattern);
176
177
  if (!matched) {
177
- throw new Error("Invalid date format, allowed formats: YYYY-MM-DD, YYYY-MM-DD HH:MM:SS");
178
+ throw new LaplaceHTTPError(400, "Invalid date format, allowed formats: YYYY-MM-DD, YYYY-MM-DD HH:MM:SS");
178
179
  }
179
180
  }
180
181