WIP - add extractor, generate snippet_data

This commit is contained in:
Stefan Fejes
2019-08-20 15:52:05 +02:00
parent 88084d3d30
commit cc8f1d8a7a
37396 changed files with 4588842 additions and 133 deletions

35
node_modules/unist-util-modify-children/index.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
'use strict'
var iterate = require('array-iterate')
module.exports = modifierFactory
// Turn `callback` into a child-modifier accepting a parent. See
// `array-iterate` for more info.
function modifierFactory(callback) {
return iteratorFactory(wrapperFactory(callback))
}
// Turn `callback` into a `iterator' accepting a parent.
function iteratorFactory(callback) {
return iterator
function iterator(parent) {
var children = parent && parent.children
if (!children) {
throw new Error('Missing children in `parent` for `modifier`')
}
return iterate(children, callback, parent)
}
}
// Pass the context as the third argument to `callback`.
function wrapperFactory(callback) {
return wrapper
function wrapper(value, index) {
return callback(value, index, this)
}
}