mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-30 02:19:52 +02:00
* chore: moved all ts files for examples to examples/ts * add: tsc to eject js and jsx output * example: add js transpiled examples * example: update example site to show both js and ts code * chore: fix yarn lint * fix(example): getAllExamplesPath
12 lines
290 B
TypeScript
12 lines
290 B
TypeScript
import { readdirSync } from 'fs'
|
|
import { join } from 'path'
|
|
|
|
const examplePath = join(process.cwd(), 'examples/ts')
|
|
|
|
export function getAllExamples() {
|
|
const slugs = readdirSync(examplePath)
|
|
return slugs
|
|
.filter(name => name.match(/.tsx$/))
|
|
.map(n => n.replace(/.tsx$/, ''))
|
|
}
|