Skip to content

Instantly share code, notes, and snippets.

View avdeev's full-sized avatar
🏠
Working from home

Alexey Avdeev avdeev

🏠
Working from home
View GitHub Profile
import { camelCase, mapKeys } from 'lodash';
function camelizeKeys(object) {
return mapKeys(object, (value, key) => camelCase(key));
}
export default function parseJsonApi(response, type) {
return (response.included || [])
.concat(Array.isArray(response.data) ? response.data : [response.data])
.filter((item) => item.type === type)
@avdeev
avdeev / index.html.envtmpl
Created June 25, 2018 12:27
Usage envsubst for starting SPA
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<title>Title</title>
</head>
<body>
<script>