src/datasources/db/utils.ts: clean up

clean some unused functions
pull/23/head
leonnicolas 4 years ago
parent b0fc6cabe3
commit f3acf1e3d8
No known key found for this signature in database
GPG Key ID: 088D0743E2B65C07

@ -5,7 +5,20 @@ This file is part of fLotte-API-Server.
fLotte-API-Server is free software: you can redistribute it and/or modify fLotte-API-Server is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Soexport function minNumRange (parent: string) {
if (!parent || parent === 'empty') {
return null;
}
return (parent).split(',')[0].replace('[', '');
}
export function maxNumRange (parent: string) {
if (!parent || parent === 'empty') {
return null;
}
const str = (parent).split(',')[1].replace(']', '');
return (str.length > 0) ? str : null;
}ftware Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
fLotte-API-Server is distributed in the hope that it will be useful, fLotte-API-Server is distributed in the hope that it will be useful,
@ -54,21 +67,6 @@ function genNumRange (range: { min: number, max: number}) :string {
return range.min ? '[' + range.min + ',' + range.max + ']' : null; return range.min ? '[' + range.min + ',' + range.max + ']' : null;
} }
export function minNumRange (parent: string) {
if (!parent || parent === 'empty') {
return null;
}
return (parent).split(',')[0].replace('[', '');
}
export function maxNumRange (parent: string) {
if (!parent || parent === 'empty') {
return null;
}
const str = (parent).split(',')[1].replace(']', '');
return (str.length > 0) ? str : null;
}
/** /**
* This function prepares the cargoBike struct, to be used in an update or create. * This function prepares the cargoBike struct, to be used in an update or create.
* It creates the numrange attributes than can be understood by postgres. * It creates the numrange attributes than can be understood by postgres.

Loading…
Cancel
Save