Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/pagic/src/utils/common.ts>sortByInsert

A static site generator powered by Deno + React
Go to Latest
function sortByInsert
import { sortByInsert } from "https://deno.land/x/pagic@v1.5.1/src/utils/common.ts";

input: [{name:'a'}, {name:'b'}, {name:'c',insert:'before:b'}] output: [{name:'a'}, {name:'c',insert:'before:b'}, {name:'b'}]

Type Parameters

T extends { name: string; insert?: string; index?: number; }