26 lines
648 B
JavaScript
26 lines
648 B
JavaScript
function convertStringToArray(inputString) {
|
|
// Split the string by the delimiter '/'
|
|
const stringArray = inputString.split(",");
|
|
|
|
// Convert each element to a number
|
|
const numberArray = stringArray.map(Number);
|
|
|
|
return numberArray;
|
|
}
|
|
|
|
function filterAndSortMeasurementsByIds(measurements, ids) {
|
|
return measurements
|
|
.filter((measurement) => ids.includes(measurement.id))
|
|
.sort((a, b) => new Date(a.timestamp) - new Date(b.timestamp));
|
|
}
|
|
|
|
function checkVideoPath(videos, name) {
|
|
let res = true;
|
|
videos.forEach(video => {
|
|
const videoName = video.name;
|
|
if(videoName==name)
|
|
res=false;
|
|
});
|
|
return res;
|
|
}
|