@brandonlukas/luminar 0.2.1 → 0.2.3

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/bin/luminar.mjs CHANGED
@@ -3,7 +3,30 @@ import { readFileSync, writeFileSync, existsSync } from 'node:fs'
3
3
  import { resolve, dirname } from 'node:path'
4
4
  import { fileURLToPath } from 'node:url'
5
5
  import { spawn } from 'node:child_process'
6
- import { parseCsv } from '../dist/lib/csv-parser.js'
6
+
7
+ // Inline CSV parser to avoid module resolution issues
8
+ function parseCsv(text) {
9
+ const lines = text.split(/\r?\n/).filter(Boolean)
10
+ const rows = []
11
+ let skippedHeader = false
12
+
13
+ for (const line of lines) {
14
+ const parts = line.split(/[,\s]+/).filter(Boolean)
15
+ if (parts.length < 4) continue
16
+
17
+ const [x, y, dx, dy] = parts.map(Number)
18
+ if ([x, y, dx, dy].some((n) => Number.isNaN(n))) {
19
+ if (!skippedHeader && rows.length === 0) {
20
+ skippedHeader = true
21
+ console.log('skipping header line:', line.substring(0, 60))
22
+ }
23
+ continue
24
+ }
25
+ rows.push({ x, y, dx, dy })
26
+ }
27
+
28
+ return rows
29
+ }
7
30
 
8
31
  const __filename = fileURLToPath(import.meta.url)
9
32
  const __dirname = dirname(__filename)