Flowtyping

This commit is contained in:
Tom Moor
2017-12-03 11:13:35 -08:00
parent 15e8e50601
commit 802f6e6594
23 changed files with 168 additions and 189 deletions

View File

@@ -1,9 +1,9 @@
// @flow
import { escape } from 'lodash';
import type { node } from 'slate-prop-types';
import { Node } from 'slate';
import slug from 'slug';
export default function headingToSlug(node: node) {
export default function headingToSlug(node: Node) {
const level = node.type.replace('heading', 'h');
return escape(`${level}-${slug(node.text)}-${node.key}`);
}