Skip to content

Commit

Permalink
chore: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jun 13, 2024
1 parent 9f0ef3f commit 82e1ecb
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 21 deletions.
2 changes: 2 additions & 0 deletions src/battery-type.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

module.exports = letter => {
switch (letter) {
case 'F':
Expand Down
2 changes: 2 additions & 0 deletions src/body-type.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const S = (letter, year) => {
switch (year) {
case 2012:
Expand Down
2 changes: 0 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict'

// TODO: add vin locations photos

const debug = require('debug-logfmt')('tesla-vin')

const digit = (input, start, end) => (end ? input.slice(start - 1, end) : input[start - 1])
Expand Down
2 changes: 2 additions & 0 deletions src/model.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

module.exports = input => {
switch (input) {
case 'S':
Expand Down
2 changes: 2 additions & 0 deletions src/motor.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const S = (letter, year) => {
switch (year) {
case 2012:
Expand Down
40 changes: 21 additions & 19 deletions src/photos.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
const PREFIX = 'https://teslahunt.github.io/vin/images'
'use strict'

const BASE_URL = 'https://teslahunt.github.io/vin/images'

const S = year => {
switch (year) {
case 2012:
case 2013:
case 2014:
case 2015:
return [`${PREFIX}/S/1.jpeg`, `${PREFIX}/S/2.jpeg`, `${PREFIX}/S/3.jpeg`]
return [`${BASE_URL}/S/1.jpeg`, `${BASE_URL}/S/2.jpeg`, `${BASE_URL}/S/3.jpeg`]
case 2016:
case 2017:
case 2018:
case 2019:
case 2020:
return [
`${PREFIX}/S/1.jpeg`,
`${PREFIX}/S/2.jpeg`,
`${PREFIX}/S/3.jpeg`,
`${PREFIX}/S/4.jpeg`
`${BASE_URL}/S/1.jpeg`,
`${BASE_URL}/S/2.jpeg`,
`${BASE_URL}/S/3.jpeg`,
`${BASE_URL}/S/4.jpeg`
]
default:
return [`${PREFIX}/S/5.jpeg`, `${PREFIX}/S/6.jpeg`, `${PREFIX}/S/7.jpeg`]
return [`${BASE_URL}/S/5.jpeg`, `${BASE_URL}/S/6.jpeg`, `${BASE_URL}/S/7.jpeg`]
}
}

Expand All @@ -31,29 +33,29 @@ const X = year => {
case 2018:
case 2019:
case 2020:
return [`${PREFIX}/X/1.jpeg`, `${PREFIX}/X/2.jpeg`, `${PREFIX}/X/3.jpeg`]
return [`${BASE_URL}/X/1.jpeg`, `${BASE_URL}/X/2.jpeg`, `${BASE_URL}/X/3.jpeg`]
default:
return [`${PREFIX}/X/4.jpeg`, `${PREFIX}/X/5.jpeg`, `${PREFIX}/X/6.jpeg`]
return [`${BASE_URL}/X/4.jpeg`, `${BASE_URL}/X/5.jpeg`, `${BASE_URL}/X/6.jpeg`]
}
}

const Y = () => {
return [
`${PREFIX}/Y/1.jpeg`,
`${PREFIX}/Y/2.jpeg`,
`${PREFIX}/Y/3.jpeg`,
`${PREFIX}/Y/4.jpeg`,
`${PREFIX}/Y/5.jpeg`
`${BASE_URL}/Y/1.jpeg`,
`${BASE_URL}/Y/2.jpeg`,
`${BASE_URL}/Y/3.jpeg`,
`${BASE_URL}/Y/4.jpeg`,
`${BASE_URL}/Y/5.jpeg`
]
}

const _3 = () => {
return [
`${PREFIX}/3/1.jpeg`,
`${PREFIX}/3/2.jpeg`,
`${PREFIX}/3/3.jpeg`,
`${PREFIX}/3/4.jpeg`,
`${PREFIX}/3/5.jpeg`
`${BASE_URL}/3/1.jpeg`,
`${BASE_URL}/3/2.jpeg`,
`${BASE_URL}/3/3.jpeg`,
`${BASE_URL}/3/4.jpeg`,
`${BASE_URL}/3/5.jpeg`
]
}

Expand Down
2 changes: 2 additions & 0 deletions src/plan-of-manufacture.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

module.exports = letter => {
switch (letter) {
case 'A':
Expand Down
2 changes: 2 additions & 0 deletions src/restraint-systems.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const X = (letter, year) => {
switch (year) {
case 2016:
Expand Down
2 changes: 2 additions & 0 deletions src/world-manufacturing-identifier.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

module.exports = letter => {
switch (letter) {
case '5YJ':
Expand Down
2 changes: 2 additions & 0 deletions src/year.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

module.exports = letter => {
switch (letter) {
case 'C':
Expand Down

0 comments on commit 82e1ecb

Please sign in to comment.