Skip to content

Commit 103404c

Browse files
committed
Fix: Solves an error related with JSON files in Gists #1
1 parent beacec0 commit 103404c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/gistClient.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ let GistClient = function () {
220220
const matchWithFilters = filters => content => {
221221
const matches = filters.filter(filter => {
222222
const filterName = _.chain(filter).keys().first().value()
223-
return !!_.get(content, filterName, '').match(filter[filterName])
223+
const value = _.get(content, filterName, '')
224+
const valueAsString = _.includes(['object', 'array'], typeof value) ? JSON.stringify(value) : value
225+
return !!valueAsString.match(filter[filterName])
224226
})
225227
return matches.length === filters.length
226228
}

0 commit comments

Comments
 (0)