From 9d24a4fe87f0255f84ebc8b41f1c4e204f9c762e Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 28 May 2020 07:43:13 -0400 Subject: [PATCH] Fix - added match all support for older node environments --- index.js | 3 ++- package.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0da886b..314736b 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ const groq = require( 'groq-js' ); +const matchAll = require( 'match-all' ); const murmurhash = require( './murmur' ); const path = require( 'path' ); const { reporter } = require( './utils' ); @@ -104,7 +105,7 @@ function processJoins( query ) { const search = `\\S+->\\w*`; const regex = new RegExp( search, 'g' ); - const matches = [ ... processedQuery.matchAll( regex ) ]; + const matches = [ ... matchAll( processedQuery, regex ).toArray() ]; if( !! matches.length ) { for( let match of matches ) { diff --git a/package.json b/package.json index c70bb61..9695c57 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gatsby-plugin-groq", "description": "Gatsby plugin for using GROQ in place of GraphQL", - "version": "1.0.0-alpha.7", + "version": "1.0.0-alpha.8", "author": "Kevin McAloon ", "keywords": [ "gatsby" @@ -20,6 +20,7 @@ "fs": "^0.0.1-security", "glob": "^7.1.6", "groq-js": "^0.1.5", + "match-all": "^1.2.5", "normalize-path": "^3.0.0" } }