mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
stickers: text editing
This commit is contained in:
parent
fa9bff5756
commit
f183c8593d
6 changed files with 130 additions and 21 deletions
|
@ -9,7 +9,7 @@ module.exports.parseRoute = route => route.filter(el => (
|
|||
));
|
||||
|
||||
module.exports.parseStickers = stickers => stickers.filter(el => (
|
||||
Object.keys(el).length === 3
|
||||
Object.keys(el).length === 4
|
||||
&& el.latlng
|
||||
&& Object.keys(el.latlng).length === 2
|
||||
&& el.latlng.lat
|
||||
|
@ -19,6 +19,7 @@ module.exports.parseStickers = stickers => stickers.filter(el => (
|
|||
&& parseInt(el.latlng.lng, 10) > 0
|
||||
&& parseInt(el.latlng.lng, 10) < 1000
|
||||
));
|
||||
// .map(el => ((el.text && String(el.text).substr(0, 100)) || ''));
|
||||
|
||||
module.exports.parseString = (value, size) => (value && String(value).substr(0, size)) || '';
|
||||
module.exports.parseNumber = (value, min, max) => (value && Number(value) && Math.min(max, Math.max(min, value))) || 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue