@discomedia/utils 1.0.5 → 1.0.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/README.md +95 -3
- package/dist/index-frontend.cjs +16027 -0
- package/dist/index-frontend.cjs.map +1 -0
- package/dist/index-frontend.mjs +16023 -0
- package/dist/index-frontend.mjs.map +1 -0
- package/dist/index.cjs +1188 -921
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1190 -921
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +8 -2
- package/dist/test.js +835 -731
- package/dist/test.js.map +1 -1
- package/dist/types/alpaca-market-data-api.d.ts +3 -15
- package/dist/types/alpaca-market-data-api.d.ts.map +1 -1
- package/dist/types/alpaca-trading-api.d.ts +3 -6
- package/dist/types/alpaca-trading-api.d.ts.map +1 -1
- package/dist/types/index-frontend.d.ts +15 -0
- package/dist/types/index-frontend.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -28
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/market-time.d.ts +187 -117
- package/dist/types/market-time.d.ts.map +1 -1
- package/dist/types/old-test.d.ts +2 -0
- package/dist/types/old-test.d.ts.map +1 -0
- package/dist/types/testing/market-time-refactor-test.d.ts +1 -0
- package/dist/types/testing/market-time-refactor-test.d.ts.map +1 -0
- package/dist/types-frontend/alpaca-market-data-api.d.ts +372 -0
- package/dist/types-frontend/alpaca-market-data-api.d.ts.map +1 -0
- package/dist/types-frontend/alpaca-trading-api.d.ts +315 -0
- package/dist/types-frontend/alpaca-trading-api.d.ts.map +1 -0
- package/dist/types-frontend/format-tools.d.ts +46 -0
- package/dist/types-frontend/format-tools.d.ts.map +1 -0
- package/dist/types-frontend/index-frontend.d.ts +15 -0
- package/dist/types-frontend/index-frontend.d.ts.map +1 -0
- package/dist/types-frontend/index.d.ts +125 -0
- package/dist/types-frontend/index.d.ts.map +1 -0
- package/dist/types-frontend/json-tools.d.ts +33 -0
- package/dist/types-frontend/json-tools.d.ts.map +1 -0
- package/dist/types-frontend/llm-config.d.ts +36 -0
- package/dist/types-frontend/llm-config.d.ts.map +1 -0
- package/dist/types-frontend/llm-deepseek.d.ts +12 -0
- package/dist/types-frontend/llm-deepseek.d.ts.map +1 -0
- package/dist/types-frontend/llm-images.d.ts +49 -0
- package/dist/types-frontend/llm-images.d.ts.map +1 -0
- package/dist/types-frontend/llm-openai.d.ts +64 -0
- package/dist/types-frontend/llm-openai.d.ts.map +1 -0
- package/dist/types-frontend/llm-utils.d.ts +16 -0
- package/dist/types-frontend/llm-utils.d.ts.map +1 -0
- package/dist/types-frontend/logging.d.ts +12 -0
- package/dist/types-frontend/logging.d.ts.map +1 -0
- package/dist/types-frontend/market-hours.d.ts +24 -0
- package/dist/types-frontend/market-hours.d.ts.map +1 -0
- package/dist/types-frontend/market-time.d.ts +254 -0
- package/dist/types-frontend/market-time.d.ts.map +1 -0
- package/dist/types-frontend/misc-utils.d.ts +49 -0
- package/dist/types-frontend/misc-utils.d.ts.map +1 -0
- package/dist/types-frontend/old-test.d.ts +2 -0
- package/dist/types-frontend/old-test.d.ts.map +1 -0
- package/dist/types-frontend/polygon-indices.d.ts +85 -0
- package/dist/types-frontend/polygon-indices.d.ts.map +1 -0
- package/dist/types-frontend/polygon.d.ts +126 -0
- package/dist/types-frontend/polygon.d.ts.map +1 -0
- package/dist/types-frontend/technical-analysis.d.ts +90 -0
- package/dist/types-frontend/technical-analysis.d.ts.map +1 -0
- package/dist/types-frontend/test.d.ts +2 -0
- package/dist/types-frontend/test.d.ts.map +1 -0
- package/dist/types-frontend/testing/market-time-refactor-test.d.ts +1 -0
- package/dist/types-frontend/testing/market-time-refactor-test.d.ts.map +1 -0
- package/dist/types-frontend/types/alpaca-types.d.ts +962 -0
- package/dist/types-frontend/types/alpaca-types.d.ts.map +1 -0
- package/dist/types-frontend/types/index.d.ts +7 -0
- package/dist/types-frontend/types/index.d.ts.map +1 -0
- package/dist/types-frontend/types/llm-types.d.ts +82 -0
- package/dist/types-frontend/types/llm-types.d.ts.map +1 -0
- package/dist/types-frontend/types/logging-types.d.ts +10 -0
- package/dist/types-frontend/types/logging-types.d.ts.map +1 -0
- package/dist/types-frontend/types/market-time-types.d.ts +59 -0
- package/dist/types-frontend/types/market-time-types.d.ts.map +1 -0
- package/dist/types-frontend/types/polygon-indices-types.d.ts +190 -0
- package/dist/types-frontend/types/polygon-indices-types.d.ts.map +1 -0
- package/dist/types-frontend/types/polygon-types.d.ts +204 -0
- package/dist/types-frontend/types/polygon-types.d.ts.map +1 -0
- package/dist/types-frontend/types/ta-types.d.ts +89 -0
- package/dist/types-frontend/types/ta-types.d.ts.map +1 -0
- package/package.json +8 -2
- package/dist/types/time-utils.d.ts +0 -17
- package/dist/types/time-utils.d.ts.map +0 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**********************************************************************************
|
|
2
|
+
* Polygon.io calls
|
|
3
|
+
**********************************************************************************/
|
|
4
|
+
import { PolygonQuote, PolygonPriceData, PolygonGroupedDailyResponse, PolygonTickerInfo, PolygonDailyOpenClose, PolygonTradesResponse } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Fetches general information about a stock ticker.
|
|
7
|
+
* @param {string} symbol - The stock ticker symbol to fetch information for.
|
|
8
|
+
* @param {Object} [options] - Optional parameters.
|
|
9
|
+
* @param {string} [options.apiKey] - The API key to use for the request.
|
|
10
|
+
* @returns {Promise<PolygonTickerInfo | null>} The ticker information or null if not found.
|
|
11
|
+
*/
|
|
12
|
+
export declare const fetchTickerInfo: (symbol: string, options?: {
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
}) => Promise<PolygonTickerInfo | null>;
|
|
15
|
+
/**
|
|
16
|
+
* Fetches the last trade for a given stock ticker.
|
|
17
|
+
* @param {string} symbol - The stock ticker symbol to fetch the last trade for.
|
|
18
|
+
* @param {Object} [options] - Optional parameters.
|
|
19
|
+
* @param {string} [options.apiKey] - The API key to use for the request.
|
|
20
|
+
* @returns {Promise<PolygonQuote>} The last trade information.
|
|
21
|
+
*/
|
|
22
|
+
export declare const fetchLastTrade: (symbol: string, options?: {
|
|
23
|
+
apiKey?: string;
|
|
24
|
+
}) => Promise<PolygonQuote>;
|
|
25
|
+
/**
|
|
26
|
+
* Fetches price data for a given stock ticker.
|
|
27
|
+
* @param {Object} params - The parameters for fetching price data.
|
|
28
|
+
* @param {string} params.ticker - The stock ticker symbol.
|
|
29
|
+
* @param {number} params.start - The start timestamp for fetching price data.
|
|
30
|
+
* @param {number} [params.end] - The end timestamp for fetching price data.
|
|
31
|
+
* @param {number} params.multiplier - The multiplier for the price data.
|
|
32
|
+
* @param {string} params.timespan - The timespan for the price data.
|
|
33
|
+
* @param {number} [params.limit] - The maximum number of price data points to fetch.
|
|
34
|
+
* @param {Object} [options] - Optional parameters.
|
|
35
|
+
* @param {string} [options.apiKey] - The API key to use for the request.
|
|
36
|
+
* @returns {Promise<PolygonPriceData[]>} The fetched price data.
|
|
37
|
+
*/
|
|
38
|
+
export declare const fetchPrices: (params: {
|
|
39
|
+
ticker: string;
|
|
40
|
+
start: number;
|
|
41
|
+
end?: number;
|
|
42
|
+
multiplier: number;
|
|
43
|
+
timespan: string;
|
|
44
|
+
limit?: number;
|
|
45
|
+
}, options?: {
|
|
46
|
+
apiKey?: string;
|
|
47
|
+
}) => Promise<PolygonPriceData[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Analyzes the price data for a given stock.
|
|
50
|
+
* @param {PolygonPriceData[]} priceData - The price data to analyze.
|
|
51
|
+
* @returns {string} The analysis report.
|
|
52
|
+
*/
|
|
53
|
+
export declare function analysePolygonPriceData(priceData: PolygonPriceData[]): string;
|
|
54
|
+
/**
|
|
55
|
+
* Fetches grouped daily price data for a specific date.
|
|
56
|
+
* @param {string} date - The date to fetch grouped daily data for.
|
|
57
|
+
* @param {Object} [options] - Optional parameters.
|
|
58
|
+
* @param {string} [options.apiKey] - The API key to use for the request.
|
|
59
|
+
* @param {boolean} [options.adjusted] - Whether to adjust the data.
|
|
60
|
+
* @param {boolean} [options.includeOTC] - Whether to include OTC data.
|
|
61
|
+
* @returns {Promise<PolygonGroupedDailyResponse>} The grouped daily response.
|
|
62
|
+
*/
|
|
63
|
+
export declare const fetchGroupedDaily: (date: string, options?: {
|
|
64
|
+
apiKey?: string;
|
|
65
|
+
adjusted?: boolean;
|
|
66
|
+
includeOTC?: boolean;
|
|
67
|
+
}) => Promise<PolygonGroupedDailyResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Formats the price data into a readable string.
|
|
70
|
+
* @param {PolygonPriceData[]} priceData - The price data to format.
|
|
71
|
+
* @returns {string} The formatted price data.
|
|
72
|
+
*/
|
|
73
|
+
export declare function formatPriceData(priceData: PolygonPriceData[]): string;
|
|
74
|
+
export declare const fetchDailyOpenClose: (
|
|
75
|
+
/**
|
|
76
|
+
* Fetches the daily open and close data for a given stock ticker.
|
|
77
|
+
* @param {string} symbol - The stock ticker symbol to fetch data for.
|
|
78
|
+
* @param {Date} [date=new Date()] - The date to fetch data for.
|
|
79
|
+
* @param {Object} [options] - Optional parameters.
|
|
80
|
+
* @param {string} [options.apiKey] - The API key to use for the request.
|
|
81
|
+
* @param {boolean} [options.adjusted] - Whether to adjust the data.
|
|
82
|
+
* @returns {Promise<PolygonDailyOpenClose>} The daily open and close data.
|
|
83
|
+
*/
|
|
84
|
+
symbol: string, date?: Date, options?: {
|
|
85
|
+
apiKey?: string;
|
|
86
|
+
adjusted?: boolean;
|
|
87
|
+
}) => Promise<PolygonDailyOpenClose>;
|
|
88
|
+
/**
|
|
89
|
+
* Gets the previous close price for a given stock ticker.
|
|
90
|
+
* @param {string} symbol - The stock ticker symbol to fetch the previous close for.
|
|
91
|
+
* @param {Date} [referenceDate] - The reference date to use for fetching the previous close.
|
|
92
|
+
* @returns {Promise<{ close: number; date: Date }>} The previous close price and date.
|
|
93
|
+
*/
|
|
94
|
+
export declare function getPreviousClose(symbol: string, referenceDate?: Date, options?: {
|
|
95
|
+
apiKey?: string;
|
|
96
|
+
}): Promise<{
|
|
97
|
+
close: number;
|
|
98
|
+
date: Date;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Fetches trade data for a given stock ticker.
|
|
102
|
+
* @param {string} symbol - The stock ticker symbol to fetch trades for.
|
|
103
|
+
* @param {Object} [options] - Optional parameters.
|
|
104
|
+
* @param {string} [options.apiKey] - The API key to use for the request.
|
|
105
|
+
* @param {string | number} [options.timestamp] - The timestamp for fetching trades.
|
|
106
|
+
* @param {string | number} [options.timestampgt] - Greater than timestamp for fetching trades.
|
|
107
|
+
* @param {string | number} [options.timestampgte] - Greater than or equal to timestamp for fetching trades.
|
|
108
|
+
* @param {string | number} [options.timestamplt] - Less than timestamp for fetching trades.
|
|
109
|
+
* @param {string | number} [options.timestamplte] - Less than or equal to timestamp for fetching trades.
|
|
110
|
+
* @param {'asc' | 'desc'} [options.order] - The order of the trades.
|
|
111
|
+
* @param {number} [options.limit] - The maximum number of trades to fetch.
|
|
112
|
+
* @param {string} [options.sort] - The sort order for the trades.
|
|
113
|
+
* @returns {Promise<PolygonTradesResponse>} The fetched trades response.
|
|
114
|
+
*/
|
|
115
|
+
export declare const fetchTrades: (symbol: string, options?: {
|
|
116
|
+
apiKey?: string;
|
|
117
|
+
timestamp?: string | number;
|
|
118
|
+
timestampgt?: string | number;
|
|
119
|
+
timestampgte?: string | number;
|
|
120
|
+
timestamplt?: string | number;
|
|
121
|
+
timestamplte?: string | number;
|
|
122
|
+
order?: "asc" | "desc";
|
|
123
|
+
limit?: number;
|
|
124
|
+
sort?: string;
|
|
125
|
+
}) => Promise<PolygonTradesResponse>;
|
|
126
|
+
//# sourceMappingURL=polygon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../src/polygon.ts"],"names":[],"mappings":"AAAA;;oFAEoF;AAGpF,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,2BAA2B,EAE3B,iBAAiB,EACjB,qBAAqB,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ACR,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,KACA,OAAO,CAAC,qBAAqB,CAsB/B,CAAC;AAIF;;;;;GAKG;AAEH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,IAAI,EACpB,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5B,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAUxC;AAED;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,WAAW,GACtB,QAAQ,MAAM,EACd,UAAU;IACR,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,KACA,OAAO,CAAC,qBAAqB,CAuD/B,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { PolygonPriceData } from './types';
|
|
2
|
+
import { BollingerBandsData, BollingerBandsParams } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Calculates Bollinger Bands for a given set of price data.
|
|
5
|
+
* Bollinger Bands consist of a middle band (SMA) and two outer bands
|
|
6
|
+
* that are standard deviations away from the middle band.
|
|
7
|
+
*
|
|
8
|
+
* @param priceData - An array of price data objects containing closing prices.
|
|
9
|
+
* @param params - An object containing optional parameters for the calculation.
|
|
10
|
+
* @param params.period - The number of periods to use for the SMA (default is 20).
|
|
11
|
+
* @param params.standardDeviations - The number of standard deviations for the outer bands (default is 2).
|
|
12
|
+
* @returns An array of BollingerBandsData objects containing the calculated bands.
|
|
13
|
+
*/
|
|
14
|
+
export declare function calculateBollingerBands(priceData: PolygonPriceData[], { period, standardDeviations }?: BollingerBandsParams): BollingerBandsData[];
|
|
15
|
+
import { EMAParams } from './types';
|
|
16
|
+
/**
|
|
17
|
+
* Calculates the Exponential Moving Average (EMA) for a given set of price data.
|
|
18
|
+
* The EMA gives more weight to recent prices, making it more responsive to new information.
|
|
19
|
+
*
|
|
20
|
+
* @param priceData - An array of price data objects containing closing prices.
|
|
21
|
+
* @param params - An object containing optional parameters for the calculation.
|
|
22
|
+
* @param params.period - The number of periods to use for the EMA (default is 20).
|
|
23
|
+
* @param params.period2 - An optional second period for a second EMA (default is 9).
|
|
24
|
+
* @returns An array of EMAData objects containing the calculated EMA values.
|
|
25
|
+
*/
|
|
26
|
+
export declare function calculateEMA(priceData: PolygonPriceData[], { period, period2 }?: EMAParams): EMAData[];
|
|
27
|
+
import { FibonacciData, FibonacciParams } from './types';
|
|
28
|
+
/**
|
|
29
|
+
* Calculates Fibonacci retracement and extension levels based on price data.
|
|
30
|
+
* Fibonacci levels are used to identify potential support and resistance levels.
|
|
31
|
+
*
|
|
32
|
+
* @param priceData - An array of price data objects containing high and low prices.
|
|
33
|
+
* @param params - An object containing optional parameters for the calculation.
|
|
34
|
+
* @param params.lookbackPeriod - The number of periods to look back for swing high/low (default is 20).
|
|
35
|
+
* @param params.retracementLevels - An array of retracement levels to calculate (default is [0.236, 0.382, 0.5, 0.618, 0.786]).
|
|
36
|
+
* @param params.extensionLevels - An array of extension levels to calculate (default is [1.272, 1.618, 2.618]).
|
|
37
|
+
* @param params.reverseDirection - A boolean indicating if the trend is reversed (default is false).
|
|
38
|
+
* @returns An array of FibonacciData objects containing the calculated levels.
|
|
39
|
+
*/
|
|
40
|
+
export declare function calculateFibonacciLevels(priceData: PolygonPriceData[], { lookbackPeriod, retracementLevels, extensionLevels, reverseDirection, }?: FibonacciParams): FibonacciData[];
|
|
41
|
+
import { MACDData, MACDParams, EMAData } from './types';
|
|
42
|
+
/**
|
|
43
|
+
* Calculates the Moving Average Convergence Divergence (MACD) for a given set of price data.
|
|
44
|
+
* MACD is a trend-following momentum indicator that shows the relationship between two EMAs.
|
|
45
|
+
*
|
|
46
|
+
* @param priceData - An array of price data objects containing closing prices.
|
|
47
|
+
* @param params - An object containing optional parameters for the calculation.
|
|
48
|
+
* @param params.shortPeriod - The short EMA period (default is 12).
|
|
49
|
+
* @param params.longPeriod - The long EMA period (default is 26).
|
|
50
|
+
* @param params.signalPeriod - The signal line period (default is 9).
|
|
51
|
+
* @returns An array of MACDData objects containing the calculated MACD values.
|
|
52
|
+
*/
|
|
53
|
+
export declare function calculateMACD(priceData: PolygonPriceData[], { shortPeriod, longPeriod, signalPeriod }?: MACDParams): MACDData[];
|
|
54
|
+
import { RSIData, RSIParams } from './types';
|
|
55
|
+
/**
|
|
56
|
+
* Calculates the Relative Strength Index (RSI) for a given set of price data.
|
|
57
|
+
* RSI is a momentum oscillator that measures the speed and change of price movements.
|
|
58
|
+
*
|
|
59
|
+
* @param priceData - An array of price data objects containing closing prices.
|
|
60
|
+
* @param params - An object containing optional parameters for the calculation.
|
|
61
|
+
* @param params.period - The number of periods to use for the RSI (default is 14).
|
|
62
|
+
* @returns An array of RSIData objects containing the calculated RSI values.
|
|
63
|
+
*/
|
|
64
|
+
export declare function calculateRSI(priceData: PolygonPriceData[], { period }?: RSIParams): RSIData[];
|
|
65
|
+
import { StochData, StochasticParams } from './types';
|
|
66
|
+
/**
|
|
67
|
+
* Calculates the Stochastic Oscillator for a given set of price data.
|
|
68
|
+
* The Stochastic Oscillator compares a particular closing price of a security to a range of its prices over a certain period of time.
|
|
69
|
+
*
|
|
70
|
+
* @param priceData - An array of price data objects containing high, low, and closing prices.
|
|
71
|
+
* @param params - An object containing optional parameters for the calculation.
|
|
72
|
+
* @param params.lookbackPeriod - The number of periods to look back for the calculation of %K (default is 5).
|
|
73
|
+
* @param params.signalPeriod - The number of periods for the %D signal line (default is 3).
|
|
74
|
+
* @param params.smoothingFactor - The smoothing factor for %K (default is 3).
|
|
75
|
+
* @returns An array of StochData objects containing the calculated %K and %D values.
|
|
76
|
+
*/
|
|
77
|
+
export declare function calculateStochasticOscillator(priceData: PolygonPriceData[], { lookbackPeriod, signalPeriod, smoothingFactor }?: StochasticParams): StochData[];
|
|
78
|
+
import { SupportResistanceData, SupportResistanceParams } from './types';
|
|
79
|
+
/**
|
|
80
|
+
* Calculates support and resistance levels based on price data.
|
|
81
|
+
* Support and resistance levels are price levels at which a stock tends to stop and reverse.
|
|
82
|
+
*
|
|
83
|
+
* @param priceData - An array of price data objects containing high, low, and closing prices.
|
|
84
|
+
* @param params - An object containing optional parameters for the calculation.
|
|
85
|
+
* @param params.maxLevels - The maximum number of support/resistance levels to return (default is 5).
|
|
86
|
+
* @param params.lookbackPeriod - The number of periods to look back for pivot points (default is 10).
|
|
87
|
+
* @returns An array of SupportResistanceData objects containing the calculated levels.
|
|
88
|
+
*/
|
|
89
|
+
export declare function calculateSupportAndResistance(priceData: PolygonPriceData[], { maxLevels, lookbackPeriod }?: SupportResistanceParams): SupportResistanceData[];
|
|
90
|
+
//# sourceMappingURL=technical-analysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"technical-analysis.d.ts","sourceRoot":"","sources":["../../src/technical-analysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGnE;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,gBAAgB,EAAE,EAC7B,EAAE,MAAW,EAAE,kBAAsB,EAAE,GAAE,oBAAyB,GACjE,kBAAkB,EAAE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3C,SAAS,EAAE,gBAAgB,EAAE,EAC7B,EAAE,SAAa,EAAE,cAAmB,EAAE,GAAE,uBAA4B,GACnE,qBAAqB,EAAE,CA8GzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=market-time-refactor-test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"market-time-refactor-test.d.ts","sourceRoot":"","sources":["../../../src/testing/market-time-refactor-test.ts"],"names":[],"mappings":""}
|