Skip to content

Commit

Permalink
chore: setup cspell
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Mar 13, 2020
1 parent cc02825 commit cbef150
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 0 additions & 6 deletions cspell.json
Expand Up @@ -151,12 +151,6 @@
"timestamping",
"loadername",
"laof",

"syntetic",
"quotemeta",
"paramized",
"existance",

"cofounder",
"hashchange",
"popstate",
Expand Down
8 changes: 4 additions & 4 deletions lib/dependencies/ContextDependencyHelpers.js
Expand Up @@ -15,7 +15,7 @@
* @param {string} str String to quote
* @returns {string} Escaped string
*/
const quotemeta = str => {
const quoteMeta = str => {
return str.replace(/[-[\]\\/{}()*+?.^$|]/g, "\\$&");
};

Expand Down Expand Up @@ -78,7 +78,7 @@ exports.create = (Dep, range, param, expr, options, contextOptions, parser) => {
const innerRegExp =
options.wrappedContextRegExp.source +
innerQuasis
.map(q => quotemeta(q.string) + options.wrappedContextRegExp.source)
.map(q => quoteMeta(q.string) + options.wrappedContextRegExp.source)
.join("");

// Example: `./context/pre${e}inner${e}inner2${e}post?query`
Expand All @@ -90,7 +90,7 @@ exports.create = (Dep, range, param, expr, options, contextOptions, parser) => {
// query: "?query"
// regExp: /^\.\/pre.*inner.*inner2.*post$/
const regExp = new RegExp(
`^${quotemeta(prefix)}${innerRegExp}${quotemeta(postfix)}$`
`^${quoteMeta(prefix)}${innerRegExp}${quoteMeta(postfix)}$`
);
const dep = new Dep(
{
Expand Down Expand Up @@ -167,7 +167,7 @@ exports.create = (Dep, range, param, expr, options, contextOptions, parser) => {
const { context, prefix } = splitContextFromPrefix(prefixRaw);
const { postfix, query } = splitQueryFromPostfix(postfixRaw);
const regExp = new RegExp(
`^${quotemeta(prefix)}${options.wrappedContextRegExp.source}${quotemeta(
`^${quoteMeta(prefix)}${options.wrappedContextRegExp.source}${quoteMeta(
postfix
)}$`
);
Expand Down

0 comments on commit cbef150

Please sign in to comment.