MCPcopy
hub / github.com/remarkjs/react-markdown / createFile

Function createFile

lib/index.js:286–301  ·  view source on GitHub ↗

* Set up the virtual file. * * @param {Readonly } options * Props. * @returns {VFile} * Result.

(options)

Source from the content-addressed store, hash-verified

284 * Result.
285 */
286function createFile(options) {
287 const children = options.children || ''
288 const file = new VFile()
289
290 if (typeof children === 'string') {
291 file.value = children
292 } else {
293 unreachable(
294 'Unexpected value `' +
295 children +
296 '` for `children` prop, expected `string`'
297 )
298 }
299
300 return file
301}
302
303/**
304 * Process the result from unified some more.

Callers 3

MarkdownFunction · 0.85
MarkdownAsyncFunction · 0.85
MarkdownHooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…