mirror of
https://github.com/maputnik/editor.git
synced 2026-01-21 04:40:02 +00:00
This migrates some utilities classes from javascript to typescript. Nothing special about the migration, mainly added types and made sure the code adheres to the strict mode. I have picked some small files so git doesn't think they are the same since they are "very different". I hope that in later PRs, when migrating lager files this won't be an issues.
15 lines
207 B
TypeScript
15 lines
207 B
TypeScript
export default function(num1: string | number, num2: string| number) {
|
|
const a = +num1;
|
|
const b = +num2;
|
|
|
|
if(a < b) {
|
|
return -1
|
|
}
|
|
else if(a > b) {
|
|
return 1
|
|
}
|
|
else {
|
|
return 0;
|
|
}
|
|
}
|