1
0
Fork 0

feat(dev): Added react docs for Pattern + refactor

This adds support for not only documenating components, but also
constants and functions that may be exported next to components.
This commit is contained in:
joostdecock 2025-05-25 16:29:57 +02:00
parent d0baf7cece
commit 22a89f12d3
50 changed files with 1816 additions and 669 deletions

View file

@ -2,7 +2,24 @@ import React from 'react'
import { diffWords, diffJson } from 'diff'
import ReactDiffViewer from 'react-diff-viewer-continued'
/**
* A method to diff JSON content
*
* @public
* @param {object} from - Once side of the diff
* @param {object} to - Other side of the diff
* @returns {object}
*/
export const diffJSON = (from, to) => diffJson(from, to)
/**
* A method to diff string content
*
* @public
* @param {string} from - Once side of the diff
* @param {string} to - Other side of the diff
* @returns {object}
*/
export const diffCheck = (from, to) => diffWords(from, to)
export const DiffViewer = (props) => <ReactDiffViewer {...props} />