diff --git a/src/naturalSort.js b/src/naturalSort.js index 94147444..e4e2523c 100644 --- a/src/naturalSort.js +++ b/src/naturalSort.js @@ -18,7 +18,13 @@ */ /* typescript - * export declare function naturalSort(arr: T): T; + * export declare namespace naturalSort { + * interface INaturalSort { + * (arr: T): T; + * comparator(a: any, b: any): number; + * } + * } + * export declare const naturalSort: naturalSort.INaturalSort; */ _('startWith root toStr'); @@ -27,6 +33,8 @@ exports = function(arr) { return arr.sort(naturalOrderComparator); }; +exports.comparator = naturalOrderComparator; + // https://github.com/ChromeDevTools/devtools-frontend function naturalOrderComparator(a, b) { a = toStr(a);