|
1 | 1 | /* eslint-env browser */
|
2 |
| -/* global discovery, ga */ |
| 2 | +/* global ga */ |
3 | 3 | const csstree = require('css-tree');
|
4 | 4 | const { definitionSyntax } = csstree;
|
5 | 5 | const functionSyntaxes = new WeakMap();
|
@@ -200,7 +200,7 @@ function syntaxRefs(syntax, typeDict, globalDict) {
|
200 | 200 | return refs;
|
201 | 201 | }
|
202 | 202 |
|
203 |
| -discovery.setPrepare(function(data, { defineObjectMarker, addQueryHelpers }) { |
| 203 | +module.exports = function(data, { defineObjectMarker, addQueryHelpers, query }) { |
204 | 204 | const { properties, types, atrules } = csstree.lexer;
|
205 | 205 | const functions = Object.create(null);
|
206 | 206 | const typeOrder = ['Atrule', 'AtrulePrelude', 'AtruleDescriptor', 'Property', 'Type', 'Function'];
|
@@ -254,7 +254,7 @@ discovery.setPrepare(function(data, { defineObjectMarker, addQueryHelpers }) {
|
254 | 254 |
|
255 | 255 | return idx !== -1 ? idx : Infinity;
|
256 | 256 | },
|
257 |
| - isProblem: discovery.queryFn('(no match and type != "Atrule") or refs.resolved.[no match]'), |
| 257 | + isProblem: current => query('(no match and type != "Atrule") or refs.resolved.[no match]', current), |
258 | 258 | mdn(current) {
|
259 | 259 | if (current) {
|
260 | 260 | switch (current.type) {
|
@@ -350,7 +350,7 @@ discovery.setPrepare(function(data, { defineObjectMarker, addQueryHelpers }) {
|
350 | 350 | };
|
351 | 351 | }
|
352 | 352 | });
|
353 |
| -}); |
| 353 | +}; |
354 | 354 |
|
355 | 355 | if (/^csstree.github.io$/i.test(location.host)) {
|
356 | 356 | /* eslint-disable */
|
|
0 commit comments