UNPKG

556 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.u8aSorted = void 0;
4const cmp_js_1 = require("./cmp.js");
5/**
6 * @name u8aSorted
7 * @summary Sorts an array of Uint8Arrays
8 * @description
9 * For input `UInt8Array[]` return the sorted result
10 * @example
11 * <BR>
12 *
13 * ```javascript
14 * import { u8aSorted} from '@polkadot/util';
15 *
16 * u8aSorted([new Uint8Array([0x69]), new Uint8Array([0x68])]); // [0x68, 0x69]
17 * ```
18 */
19function u8aSorted(u8as) {
20 return u8as.sort(cmp_js_1.u8aCmp);
21}
22exports.u8aSorted = u8aSorted;