UNPKG
monk-import-export
Version:
latest (0.0.0)
0.0.0
Simple import & export sorting ESLint plugin
monk-import-export
/
build
/
utils
/
compare.js
9 lines
(8 loc)
•
306 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
, {
value
:
true
});
exports
.
compare
=
void
0
;
const
collator =
new
Intl
.
Collator
(
'en'
, {
numeric
:
true
,
sensitivity
:
'base'
});
function
compare
(
a, b
) {
return
collator.
compare
(a, b) || (a < b ? -
1
: a > b ?
1
:
0
); }
exports
.
compare
= compare;