UNPKG
echarts-for-react-pix
Version:
latest (3.0.2-b)
3.0.2
3.0.2-b
3.0.2-a
Apache Echarts components for React.
github.com/hustcc/echarts-for-react
hustcc/echarts-for-react
echarts-for-react-pix
/
src
/
helper
/
pick.ts
13 lines
(12 loc)
•
252 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
/** * 保留 object 中的部分内容 *
@param
obj
*
@param
keys
*/
export
function
pick
(
obj
:
Record
<
string
,
unknown
>,
keys
:
string
[]
):
Record
<
string
,
unknown
> {
const
r = {}; keys.
forEach
(
(
key
) =>
{ r[key] = obj[key]; });
return
r; }