@types/javascript-natural-sort
v0.7.0
Published
TypeScript definitions for javascript-natural-sort
Readme
Installation
npm install --save @types/javascript-natural-sort
Summary
This package contains type definitions for javascript-natural-sort (https://github.com/Bill4Time/javascript-natural-sort).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/javascript-natural-sort.
index.d.ts
/**
* Natural sort comparison function for use with Array.sort().
* Sorts strings containing numbers in a human-friendly way.
*
* @param a - First value to compare
* @param b - Second value to compare
* @returns Negative if a < b, positive if a > b, zero if equal
*
* @example
* ```javascript
* var naturalSort = require('javascript-natural-sort');
*
* ['img12', 'img10', 'img2', 'img1'].sort(naturalSort);
* // => ['img1', 'img2', 'img10', 'img12']
* ```
*/
declare function naturalSort(a: string | number, b: string | number): number;
declare namespace naturalSort {
/**
* Set to true to enable case-insensitive sorting.
* @default false
*/
let insensitive: boolean;
}
export = naturalSort;
Additional Details
- Last updated: Wed, 04 Feb 2026 18:45:32 GMT
- Dependencies: none
Credits
These definitions were written by gaspard.
