File tree Expand file tree Collapse file tree 4 files changed +0
-61
lines changed Expand file tree Collapse file tree 4 files changed +0
-61
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ var position = exports;
5
5
6
6
position . start = positionFactory ( 'start' ) ;
7
7
position . end = positionFactory ( 'end' ) ;
8
- position . generated = generated ;
9
8
10
9
/* Factory to get a position at `type`. */
11
10
function positionFactory ( type ) {
@@ -22,12 +21,3 @@ function positionFactory(type) {
22
21
} ;
23
22
}
24
23
}
25
-
26
- /* Detect if a node was available in the original document. */
27
- function generated ( node ) {
28
- var initial = position . start ( node ) ;
29
- var final = position . end ( node ) ;
30
-
31
- return initial . line === null || initial . column === null ||
32
- final . line === null || final . column === null ;
33
- }
Original file line number Diff line number Diff line change 7
7
" unist" ,
8
8
" node" ,
9
9
" position" ,
10
- " generated" ,
11
10
" util" ,
12
11
" utility"
13
12
],
Original file line number Diff line number Diff line change @@ -25,11 +25,9 @@ var tree = remark().parse([
25
25
26
26
position .start (tree); // => {line: 1, column: 1}
27
27
position .end (tree); // => {line: 4, column: 1}
28
- position .generated (tree); // => false
29
28
30
29
position .start (); // => {line: null, column: null}
31
30
position .end (); // => {line: null, column: null}
32
- position .generated (); // => true
33
31
```
34
32
35
33
## API
@@ -49,20 +47,6 @@ Get the position start or end position of `node`, respectively.
49
47
[ ` Position ` ] [ position ] — Filled with ` line ` (nullable ` uint32 >= 1 ` ),
50
48
` column ` (nullable ` uint32 >= 1 ` ), ` offset ` (nullable ` uint32 >= 0 ` ).
51
49
52
- ### ` position.generated([node]) `
53
-
54
- Get the heading style of a node.
55
-
56
- ###### Parameters
57
-
58
- * ` node ` ([ ` Node ` ] [ node ] ) — Node to check;
59
-
60
- ###### Returns
61
-
62
- ` boolean ` — Whether or not ` node ` has positional information (both
63
- starting and ending lines and columns). This is useful when checking
64
- if a node is inserted by plug-ins.
65
-
66
50
## License
67
51
68
52
[ MIT] [ license ] © [ Titus Wormer] [ author ]
Original file line number Diff line number Diff line change @@ -63,39 +63,5 @@ test('unist-util-position', function (t) {
63
63
} ) ;
64
64
} ) ;
65
65
66
- t . test ( 'generated' , function ( st ) {
67
- st . equal (
68
- position . generated ( ) ,
69
- true ,
70
- 'should not throw without node'
71
- ) ;
72
-
73
- st . equal (
74
- position . generated ( properties ) ,
75
- false ,
76
- 'should return false when with properties'
77
- ) ;
78
-
79
- st . equal (
80
- position . generated ( objects ) ,
81
- true ,
82
- 'should return true when without properties'
83
- ) ;
84
-
85
- st . equal (
86
- position . generated ( values ) ,
87
- true ,
88
- 'should return true when without objects'
89
- ) ;
90
-
91
- st . equal (
92
- position . generated ( none ) ,
93
- true ,
94
- 'should return true when without position'
95
- ) ;
96
-
97
- st . end ( ) ;
98
- } ) ;
99
-
100
66
t . end ( ) ;
101
67
} ) ;
You can’t perform that action at this time.
0 commit comments