浏览代码

changed the way to check if there are matches

Dustin Utecht 5 年之前
父节点
当前提交
5f6326076e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tools/check-api.js

+ 1 - 1
tools/check-api.js

@@ -58,7 +58,7 @@ class API {
           const tmpDetails = details[i + 1].trim()
           if (name === 'Example' && exampleFilesFound) {
             const matches = exampleRegex.exec(tmpDetails)
-            if (matches === null) {
+            if (!matches) {
               errors.push(chalk.red(`[${key}] missing or wrong formatted example`, `"${tmpDetails}"`))
               continue
             }