]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/vim-mode/node_modules/grim/node_modules/emissary/node_modules/es6-weak-map/node_modules/es5-ext/object/compare.js
2ab11f1a396350b5fa571e8c5387155d9cff680a
3 var strCompare
= require('../string/#/case-insensitive-compare')
4 , isObject
= require('./is-object')
16 resolve = function (a
) {
18 if (typeof a
.valueOf
!== 'function') return NaN
;
21 if (typeof a
.toString
!== 'function') return NaN
;
23 if (typeof a
!== 'string') return NaN
;
29 module
.exports = function (a
, b
) {
30 if (a
=== b
) return 0; // Same
34 if (a
== b
) return typeMap
[typeof a
] - typeMap
[typeof b
]; //jslint: ignore
35 if (a
== null) return -1;
36 if (b
== null) return 1;
37 if ((typeof a
=== 'string') || (typeof b
=== 'string')) {
38 return strCompare
.call(a
, b
);
40 if ((a
!== a
) && (b
!== b
)) return 0; //jslint: ignore
41 return Number(a
) - Number(b
);