Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const snakeRequest = (data, headers) => {
for (const [key, value] of Object.entries(headers)) {
header(value, true)
if (!['common', 'delete', 'get', 'head', 'post', 'put', 'patch'].includes(key)) {
delete headers[key]
headers[ccHeader(key)] = value
}
}
return snake(data)
}
export const camelResponse = (data, headers) => {
$.tap(file => {
const fileName = path.basename(file.path);
const className = lowerCase(headerCase(fileName.replace('.js', '')));
return gulp
.src(`${DIST_FOLDER}/${fileName}`)
.pipe(
$.replace(
'classNameString',
`{...props} className={\`${CLASSNAME} ${CLASSNAME}-${className} \${props.className\}\`}`
)
)
.pipe($.replace(/xmlns:xlink=".+?"/g, ``))
.pipe($.replace(/xlink:href=".+?"/g, ``))
.pipe($.replace('fill-rule=', 'fillRule='))
.pipe($.replace('fill-opacity=', 'fillOpacity='))
.pipe($.prettier())
.pipe(gulp.dest(DIST_FOLDER))
.pipe(gulp.dest(LIB_FOLDER));