This commit is contained in:
Boki 2025-06-11 10:35:15 -04:00
parent d85cd58acd
commit 597c6efc9b
91 changed files with 2224 additions and 1400 deletions

View file

@ -1,33 +1,33 @@
{
"name": "@stock-bot/data-frame",
"version": "1.0.0",
"description": "DataFrame library for time series data manipulation",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"scripts": {
"build": "tsc",
"test": "bun test",
"clean": "rimraf dist"
},
"dependencies": {
"@stock-bot/logger": "*",
"@stock-bot/utils": "*"
},
"devDependencies": {
"@types/node": "^20.11.0",
"typescript": "^5.3.0",
"bun-types": "^1.2.15"
},
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"files": [
"dist",
"README.md"
]
}
{
"name": "@stock-bot/data-frame",
"version": "1.0.0",
"description": "DataFrame library for time series data manipulation",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"scripts": {
"build": "tsc",
"test": "bun test",
"clean": "rimraf dist"
},
"dependencies": {
"@stock-bot/logger": "*",
"@stock-bot/utils": "*"
},
"devDependencies": {
"@types/node": "^20.11.0",
"typescript": "^5.3.0",
"bun-types": "^1.2.15"
},
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"files": [
"dist",
"README.md"
]
}

View file

@ -35,7 +35,7 @@ export class DataFrame {
}
private inferColumns(): string[] {
if (this.data.length === 0) return [];
if (this.data.length === 0) {return [];}
const columns = new Set<string>();
for (const row of this.data) {
@ -46,7 +46,7 @@ export class DataFrame {
}
private validateAndCleanData(): void {
if (this.data.length === 0) return;
if (this.data.length === 0) {return;}
// Ensure all rows have the same columns
for (let i = 0; i < this.data.length; i++) {
@ -224,7 +224,7 @@ export class DataFrame {
const aVal = a[column];
const bVal = b[column];
if (aVal === bVal) return 0;
if (aVal === bVal) {return 0;}
const comparison = aVal > bVal ? 1 : -1;
return ascending ? comparison : -comparison;

View file

@ -1,13 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*"],
"references": [
{ "path": "../types" },
{ "path": "../logger" },
{ "path": "../utils" }
]
}
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*"],
"references": [{ "path": "../types" }, { "path": "../logger" }, { "path": "../utils" }]
}