Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const buildFile = file => {
if (file.match(/\.js$/)) {
buildSrcModule(file)
buildCjsModule(file)
} else if (file.match(/\.js$/)) {
fs.copySync(file, path.join(DEV_PATH, replace(SOURCE_PATH, '', file)))
} else {
// native files
fs.copySync(file, path.join(DEV_PATH, replace(resolvePath(), '', file)))
}
}
<details>${ NEW_LINE }
<summary>
R.${ methodName } source
</summary>${ NEW_LINE }
\`\`\`javascript
${ CONTENT_MARKER }
\`\`\`${ NEW_LINE }
</details>
`, '\n')
const stillRawDetails = replace(CONTENT_MARKER, testContent, rawDetails)
const details = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawDetails)
const stillRawMethodContent = replace(CONTENT_MARKER, methodContent, rawMethodContent)
const finalMethodContent = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawMethodContent)
const withJavascriptTag = replace('```\n', '```javascript\n', input)
const withToggleDetails = replace('```\n', `\`\`\`\n\n${ details }\n`, withJavascriptTag)
const withMethodContent = replace('', `\n\n${ finalMethodContent }`, withToggleDetails)
const withoutSourceLink = remove(
/\[Source.+/,
withMethodContent
)
return withoutSourceLink
}
R.${ methodName } source
${ NEW_LINE }
\`\`\`javascript
${ CONTENT_MARKER }
\`\`\`${ NEW_LINE }
`, '\n')
const stillRawDetails = replace(CONTENT_MARKER, testContent, rawDetails)
const details = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawDetails)
const stillRawMethodContent = replace(CONTENT_MARKER, methodContent, rawMethodContent)
const finalMethodContent = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawMethodContent)
const withJavascriptTag = replace('```\n', '```javascript\n', input)
const withToggleDetails = replace('```\n', `\`\`\`\n\n${ details }\n`, withJavascriptTag)
const withMethodContent = replace('', `\n\n${ finalMethodContent }`, withToggleDetails)
const withoutSourceLink = remove(
/\[Source.+/,
withMethodContent
)
return withoutSourceLink
}
<summary>
R.${ methodName } source
</summary>${ NEW_LINE }
\`\`\`javascript
${ CONTENT_MARKER }
\`\`\`${ NEW_LINE }
`, '\n')
const stillRawDetails = replace(CONTENT_MARKER, testContent, rawDetails)
const details = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawDetails)
const stillRawMethodContent = replace(CONTENT_MARKER, methodContent, rawMethodContent)
const finalMethodContent = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawMethodContent)
const withJavascriptTag = replace('```\n', '```javascript\n', input)
const withToggleDetails = replace('```\n', `\`\`\`\n\n${ details }\n`, withJavascriptTag)
const withMethodContent = replace('', `\n\n${ finalMethodContent }`, withToggleDetails)
const withoutSourceLink = remove(
/\[Source.+/,
withMethodContent
)
return withoutSourceLink
}
`, '\n')
const rawMethodContent = glue(`
<details>${ NEW_LINE }
<summary>
R.${ methodName } source
</summary>${ NEW_LINE }
\`\`\`javascript
${ CONTENT_MARKER }
\`\`\`${ NEW_LINE }
</details>
`, '\n')
const stillRawDetails = replace(CONTENT_MARKER, testContent, rawDetails)
const details = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawDetails)
const stillRawMethodContent = replace(CONTENT_MARKER, methodContent, rawMethodContent)
const finalMethodContent = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawMethodContent)
const withJavascriptTag = replace('```\n', '```javascript\n', input)
const withToggleDetails = replace('```\n', `\`\`\`\n\n${ details }\n`, withJavascriptTag)
const withMethodContent = replace('', `\n\n${ finalMethodContent }`, withToggleDetails)
const withoutSourceLink = remove(
/\[Source.+/,
withMethodContent
)
return withoutSourceLink
}
`, '\n')
const rawMethodContent = glue(`
<details>${ NEW_LINE }
<summary>
R.${ methodName } source
</summary>${ NEW_LINE }
\`\`\`javascript
${ CONTENT_MARKER }
\`\`\`${ NEW_LINE }
</details>
`, '\n')
const stillRawDetails = replace(CONTENT_MARKER, testContent, rawDetails)
const details = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawDetails)
const stillRawMethodContent = replace(CONTENT_MARKER, methodContent, rawMethodContent)
const finalMethodContent = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawMethodContent)
const withJavascriptTag = replace('```\n', '```javascript\n', input)
const withToggleDetails = replace('```\n', `\`\`\`\n\n${ details }\n`, withJavascriptTag)
const withMethodContent = replace('', `\n\n${ finalMethodContent }`, withToggleDetails)
const withoutSourceLink = remove(
/\[Source.+/,
withMethodContent
)
return withoutSourceLink
}
const rawMethodContent = glue(`
<details>${ NEW_LINE }
<summary>
R.${ methodName } source
</summary>${ NEW_LINE }
\`\`\`javascript
${ CONTENT_MARKER }
\`\`\`${ NEW_LINE }
</details>
`, '\n')
const stillRawDetails = replace(CONTENT_MARKER, testContent, rawDetails)
const details = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawDetails)
const stillRawMethodContent = replace(CONTENT_MARKER, methodContent, rawMethodContent)
const finalMethodContent = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawMethodContent)
const withJavascriptTag = replace('```\n', '```javascript\n', input)
const withToggleDetails = replace('```\n', `\`\`\`\n\n${ details }\n`, withJavascriptTag)
const withMethodContent = replace('', `\n\n${ finalMethodContent }`, withToggleDetails)
const withoutSourceLink = remove(
/\[Source.+/,
withMethodContent
)
return withoutSourceLink
}
map(x => {
const replaced = replace(/(git:)|(ssh:)/, 'https:', x)
return remove('git@', replaced)
})
)
const createModulePath = format => {
const formatPathSegment = format === CJS_MODULES ? [] : [format]
const modulePath = resolvePath(DIR_PATH, ...formatPathSegment)
return replace(SOURCE_PATH, modulePath)
}