UNPKG
@vue-interface/utils
Version:
latest (0.9.34)
0.9.34
0.9.33
0.9.32
0.9.31
0.9.30
0.9.29
0.9.28
0.9.27
0.9.26
0.9.25
0.9.24
0.9.23
0.9.22
0.9.21
0.9.20
0.9.19
0.9.18
0.9.17
0.9.16
0.9.15
0.9.14
0.9.13
0.9.12
0.9.11
0.9.10
0.9.9
0.9.8
0.9.7
0.9.6
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
A utility package for Vue Interface.
github.com/vue-interface/utils/docs
vue-interface/utils
@vue-interface/utils
/
tests
/
property.spec.js
18 lines
(15 loc)
•
349 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import
{ property }
from
'..'
;
test
(
'property()'
,
() =>
{
const
subject = {
a
:
1
,
b
:
2
,
c
: {
d
:
3
,
e
:
4
,
f
: [
0
,
1
,
2
] } };
expect
(
property
(
'a'
)(subject)).
toBe
(
1
);
expect
(
property
(
'a.b'
)(subject)).
toBe
(
undefined
);
expect
(
property
(
'c.d'
)(subject)).
toBe
(
3
); });