Skip to content

Commit

Permalink
fix: remove re2 that is not browser compatible (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
derberg authored Jul 27, 2020
1 parent 69ffef8 commit bcb52eb
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 539 deletions.
4 changes: 1 addition & 3 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const { yamlAST, loc } = require('@fmvilas/pseudo-yaml-ast');
const jsonAST = require('json-to-ast');
const jsonParseBetterErrors = require('../lib/json-parse');
const ParserError = require('./errors/parser-error');
const RE2 = require('re2');

const jsonPointerToArray = jsonPointer => (jsonPointer || '/').split('/').splice(1);

Expand Down Expand Up @@ -264,9 +263,8 @@ utils.improveAjvErrors = (errors, asyncapiYAMLorJSON, initialFormat) => {
*/
utils.parseUrlVariables = str => {
if (typeof str !== 'string') return;
const regex = new RE2(/{(.+?)}/g);

return regex.match(str);
return str.match(/{(.+?)}/g);
};

/**
Expand Down
Loading

0 comments on commit bcb52eb

Please sign in to comment.