* Moved nuxt app to main app

This commit is contained in:
Alexis
2021-03-29 11:17:51 +02:00
parent e819e00822
commit d31a9aad7b
113 changed files with 10463 additions and 26133 deletions

31
plugins/methods/index.js Normal file
View File

@@ -0,0 +1,31 @@
export const addCelestialType = (celestial) => {
if (celestial.isPlanet) {
if (celestial.moons) {
celestial.type = 'planète à lunes'
} else {
celestial.type = 'planète'
}
// Check if element is moon
} else if (celestial.aroundPlanet != null) {
celestial.type = 'lune'
// Check if element is star
} else if (celestial.id === 'soleil') {
celestial.type = 'étoile'
// ...else, body is "other"
} else {
celestial.type = 'autre'
}
return celestial
}
export const addCelestialsType = (celestials) => {
return celestials.map(e => addCelestialType(e))
}
export default {
addCelestialType,
addCelestialsType
}