get-cookies
get-cookies
is a utility function that parses cookies into an object. Its default behavior will also attempt to convert cookie values into their "logical" data types.
Usage
After installation, import the package:
import { getCookies } from '@toolz/get-cookies';
getCookies()
The function returns an object containing any existing cookie values and attempts to convert those values into native JS data types.
const API = {
arguments: {
convertDataTypes: {
optional,
format: Boolean,
defaultValue: true,
},
},
returns: Object,
}
Examples:
const cookies = getCookies();
const cookies = getCookies(false);