Skip to content

Instantly share code, notes, and snippets.

View MilosPaunovic's full-sized avatar

Miloš Paunović MilosPaunovic

View GitHub Profile

Multiple environments

This document contains an explanation of how you can create and maintain multiple environments for your Quasar projects. It will be an expansion of the official documentation located here for Webpack and here for Vite. Bear in mind that this guide is applicable to both versions of Quasar.

1. step

Create a variables folder in the project root, with a parser.js file inside. This will allow you to have all environment related files in a single place, which will improve readability.

2. step

@MilosPaunovic
MilosPaunovic / validation.js
Last active May 23, 2021 19:55
Default parameter validation using method
const isRequired = () => {
throw new Error('Parameter is required');
};
const print = (num = isRequired()) => {
console.log(`Printing number ${num}`);
};
@MilosPaunovic
MilosPaunovic / coordinates.js
Last active May 23, 2021 19:54
Rounding geographic coordinate to more usable value
const roundCoordinate = (coordinate) => {
//https://gis.stackexchange.com/a/109178
return parseFloat(coordinate.toPrecision(7));
};