UNPKG
swagger-diff
Version:
latest (0.6.0)
0.6.0
0.5.0
0.4.0
0.3.1
0.3.0
0.2.1
0.1.0
Swagger Diff
github.com/zallek/swagger-diff
zallek/swagger-diff
swagger-diff
/
src
/
rules
/
smooth
/
add-path.js
15 lines
(13 loc)
•
304 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
export
default
function
addPath
(
{ kind, path, lhs, rhs }
) {
const
match = kind ===
'N'
&& path.
length
===
2
&& path[
0
] ===
'paths'
;
if
(match) {
const
pathId = path[
1
];
return
{
message
:
`
${pathId}
- Added`
,
path
: pathId, }; }
return
false
; }