Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fn/bga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const bga_def = base_def
const m = s.match(/([A-Z]+)(\d+)/)
if (!m) return s
const Y = ALPHABET.indexOf(m[1]!)
const X = Number.parseInt(m[2]!) - 1
const X = Number.parseInt(m[2]!, 10) - 1
return Y * a.grid!.x + X + 1
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/fn/sot23.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const sot23_3 = (parameters: z.infer<typeof sot23_def>) => {
}
const silkscreenRefText: SilkscreenRef = silkscreenRef(
0,
Number.parseInt(parameters.h),
Number.parseFloat(parameters.h),
0.3,
)

Expand Down
4 changes: 2 additions & 2 deletions src/fn/sot23w.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const sot23w = (
raw_params: z.input<typeof sot23w_def>,
): { circuitJson: AnyCircuitElement[]; parameters: any } => {
const match = raw_params.string?.match(/^sot23w_(\d+)/)
const numPins = match ? Number.parseInt(match[1]!, 3) : 3
const numPins = match ? Number.parseInt(match[1]!, 10) : 3

const parameters = sot23w_def.parse({
...raw_params,
Expand Down Expand Up @@ -85,7 +85,7 @@ export const sot23w_3 = (parameters: z.infer<typeof sot23w_def>) => {

const silkscreenRefText: SilkscreenRef = silkscreenRef(
0,
Number.parseInt(parameters.h) / 2 + 1,
Number.parseFloat(parameters.h) / 2 + 1,
0.3,
)

Expand Down
4 changes: 2 additions & 2 deletions src/fn/sot323.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const sot323 = (
raw_params: z.input<typeof sot323_def>,
): { circuitJson: AnyCircuitElement[]; parameters: any } => {
const match = raw_params.string?.match(/^sot323_(\d+)/)
const numPins = match ? Number.parseInt(match[1]!, 3) : 3
const numPins = match ? Number.parseInt(match[1]!, 10) : 3

const parameters = sot323_def.parse({
...raw_params,
Expand Down Expand Up @@ -85,7 +85,7 @@ export const sot323_3 = (parameters: z.infer<typeof sot323_def>) => {

const silkscreenRefText: SilkscreenRef = silkscreenRef(
0,
Number.parseInt(parameters.h) / 2 + 1,
Number.parseFloat(parameters.h) / 2 + 1,
0.3,
)

Expand Down
2 changes: 1 addition & 1 deletion src/fn/sot343.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const sot343 = (
raw_params: z.input<typeof sot343_def>,
): { circuitJson: AnyCircuitElement[]; parameters: any } => {
const match = raw_params.string?.match(/^sot343_(\d+)/)
const numPins = match ? Number.parseInt(match[1]!, 4) : 4
const numPins = match ? Number.parseInt(match[1]!, 10) : 4

const parameters = sot343_def.parse({
...raw_params,
Expand Down
2 changes: 1 addition & 1 deletion src/fn/to220.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const to220 = (

const numPins =
parameters.num_pins ??
Number.parseInt(string?.match(/^to220(?:_|-)(\d+)/i)?.[1] ?? "3")
Number.parseInt(string?.match(/^to220(?:_|-)(\d+)/i)?.[1] ?? "3", 10)

const holeY = -1
const halfWidth = w / 2
Expand Down
1 change: 1 addition & 0 deletions src/fn/to220f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const to220f = (
parameters.num_pins ??
Number.parseInt(
parameters.string?.match(/^to220f(?:_|-)(\d+)/i)?.[1] ?? "3",
10,
)

// Get silkscreen and other non-hole elements from to220
Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/sot23.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/__snapshots__/sot23_3.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/__snapshots__/sot23_w3_h1.5_p0.95mm.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/__snapshots__/sot23w.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/__snapshots__/sot23w_p2_w5.1_h5.2.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading