Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function Transclude(source = 'string', options = {}) {
const {
transclusionSyntax = 'hercule',
inheritedParents = [],
inheritedReferences = [],
inheritedIndent = '',
resolvers,
} = options;
const { REGEXP, MATCH_GROUP, INDENT_GROUP, LINK_GROUP } = SYNTAX[
transclusionSyntax
];
const pattern = cloneRegExp(REGEXP);
let inputBuffer = '';
let line = 1;
let column = 0;
function transclude(chunk, cb) {
const self = this;
// eslint-disable-next-line consistent-return
process.nextTick(() => {
if (!chunk.link) {
self.push(chunk);
return cb();
}
const { parents, indent, content } = chunk;
const sourceLine = chunk.line;
runFunctionWithTracingDisabled(function(){
var regExp = cloneRegExp(separator, {global: true})
separators = oldString.match(regExp)
if (separators === null) {
separators = [];
}
})
} else {
export default function indicesOf(text, searchStringOrRegex, caseSensitive = false) {
if (searchStringOrRegex instanceof RegExp) {
const re = cloneRegexp(searchStringOrRegex, { global: true });
const indices = [];
let match = re.exec(text);
while (match) {
const offset = match.index + match[0].length;
indices.push([match.index, offset]);
match = re.exec(text);
}
return indices;
}
const searchStringLen = searchStringOrRegex.length;
if (searchStringLen === 0) {
return [];
}