dadamssg

dadamssg

<Router>
<Routes>
<Route path="/" element={<Layout />}>
<Route index element={<Home />} />
</Routes>
</Router>
<Router>
<Routes>
<Route path="/" element={<Layout />}>
<Route index element={<Home />} />
</Routes>
</Router>
// Name: Move code left
// Shortcut: cmd shift t
// Author: David Adams
// Twitter: @dadamssg
import "@johnlindquist/kit"
let text = await getSelectedText()
let lines = text.split("\n")
let lineStarts = lines.map(line => line.search(/\S/))
let charsToTrim = Math.min(...lineStarts)
let formatted = lines.map(line => line.substring(charsToTrim)).join("\n")
await setSelectedText(formatted)

// Name: format-json
// Shortcut: cmd shift j
// Author: David Adams
// Twitter: @dadamssg
import "@johnlindquist/kit"
let jsonabc = await npm("jsonabc")
let text = await getSelectedText()
let json
try {
json = jsonabc.sort(String(text).trim(), false, 2)
} catch (e) {
notify(e.message)
exit()
}
await setSelectedText(json)
[{"z": false, "_id":"631b4ed565976c544dbce557","index":0,"guid":"89965508-5576-46fb-9849-e6ec07918d73","isActive":false,"balance":"$2,996.82","friends":[{"name":"Lara Humphrey","id":0}],"greeting":"Hello, undefined! You have 9 unread messages.","favoriteFruit":"strawberry"}]
[
{
"_id": "631b4ed565976c544dbce557",
"balance": "$2,996.82",
"favoriteFruit": "strawberry",
"friends": [
{
"id": 0,
"name": "Lara Humphrey"
}
],
"greeting": "Hello, undefined! You have 9 unread messages.",
"guid": "89965508-5576-46fb-9849-e6ec07918d73",
"index": 0,
"isActive": false,
"z": false
}
]