hcode-core
Advanced tools
Comparing version 0.0.74 to 0.0.75
import { AnyObject } from '../../interfaces/anyObject'; | ||
export declare function getCookies(cookies: string | undefined): AnyObject; | ||
export declare function getCookies(cookies: string | undefined, field?: any): AnyObject; |
@@ -86,3 +86,4 @@ function base64Encode(value) { | ||
function getCookies(cookies) { | ||
function getCookies(cookies, field) { | ||
if (field === void 0) { field = null; } | ||
if (!cookies) { | ||
@@ -97,3 +98,8 @@ return {}; | ||
.forEach(function (item) { return (data_1[item[0]] = item[1]); }); | ||
return data_1; | ||
if (field && data_1[field]) { | ||
return data_1[field]; | ||
} | ||
else { | ||
return data_1; | ||
} | ||
} | ||
@@ -100,0 +106,0 @@ } |
@@ -90,3 +90,4 @@ 'use strict'; | ||
function getCookies(cookies) { | ||
function getCookies(cookies, field) { | ||
if (field === void 0) { field = null; } | ||
if (!cookies) { | ||
@@ -101,3 +102,8 @@ return {}; | ||
.forEach(function (item) { return (data_1[item[0]] = item[1]); }); | ||
return data_1; | ||
if (field && data_1[field]) { | ||
return data_1[field]; | ||
} | ||
else { | ||
return data_1; | ||
} | ||
} | ||
@@ -104,0 +110,0 @@ } |
{ | ||
"name": "hcode-core", | ||
"version": "0.0.74", | ||
"version": "0.0.75", | ||
"description": "Hcode Core", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
import { AnyObject } from '../../interfaces/anyObject'; | ||
export function getCookies(cookies: string | undefined): AnyObject { | ||
export function getCookies( | ||
cookies: string | undefined, | ||
field = null | ||
): AnyObject { | ||
if (!cookies) { | ||
@@ -12,4 +15,8 @@ return {}; | ||
.forEach((item) => (data[item[0]] = item[1])); | ||
return data; | ||
if (field && data[field]) { | ||
return data[field]; | ||
} else { | ||
return data; | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
70414
1515
0