diff --git a/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-class-members.js b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-class-members.js deleted file mode 100644 index 6005da75..00000000 --- a/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-class-members.js +++ /dev/null @@ -1,36 +0,0 @@ -const { linkListHandler } = require("./link-list-checker.js"); - -/** - * Handler for the `data.constructor_properties` ingredient. - */ -const handleDataConstructorProperties = linkListHandler( - "Constructor_properties" -); - -/** - * Handler for the `data.static_methods` ingredient. - */ -const handleDataStaticMethods = linkListHandler("Static_methods"); - -/** - * Handler for the `data.static_properties` ingredient. - */ -const handleDataStaticProperties = linkListHandler("Static_properties"); - -/** - * Handler for the `data.instance_methods` ingredient. - */ -const handleDataInstanceMethods = linkListHandler("Instance_methods"); - -/** - * Handler for the `data.instance_properties` ingredient. - */ -const handleDataInstanceProperties = linkListHandler("Instance_properties"); - -module.exports = { - handleDataConstructorProperties, - handleDataStaticMethods, - handleDataStaticProperties, - handleDataInstanceMethods, - handleDataInstanceProperties, -}; diff --git a/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-constructor-properties.js b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-constructor-properties.js new file mode 100644 index 00000000..8610248d --- /dev/null +++ b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-constructor-properties.js @@ -0,0 +1,10 @@ +const { linkListHandler } = require("./link-list-checker.js"); + +/** + * Handler for the `data.constructor_properties` ingredient. + */ +const handleDataConstructorProperties = linkListHandler( + "Constructor_properties" +); + +module.exports = handleDataConstructorProperties; diff --git a/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-instance-methods.js b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-instance-methods.js new file mode 100644 index 00000000..a67a4356 --- /dev/null +++ b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-instance-methods.js @@ -0,0 +1,8 @@ +const { linkListHandler } = require("./link-list-checker.js"); + +/** + * Handler for the `data.instance_methods` ingredient. + */ +const handleDataInstanceMethods = linkListHandler("Instance_methods"); + +module.exports = handleDataInstanceMethods; diff --git a/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-instance-properties.js b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-instance-properties.js new file mode 100644 index 00000000..7bc0d131 --- /dev/null +++ b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-instance-properties.js @@ -0,0 +1,8 @@ +const { linkListHandler } = require("./link-list-checker.js"); + +/** + * Handler for the `data.instance_properties` ingredient. + */ +const handleDataInstanceProperties = linkListHandler("Instance_properties"); + +module.exports = handleDataInstanceProperties; diff --git a/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-static-methods.js b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-static-methods.js new file mode 100644 index 00000000..57b94837 --- /dev/null +++ b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-static-methods.js @@ -0,0 +1,8 @@ +const { linkListHandler } = require("./link-list-checker.js"); + +/** + * Handler for the `data.static_methods` ingredient. + */ +const handleDataStaticMethods = linkListHandler("Static_methods"); + +module.exports = handleDataStaticMethods; diff --git a/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-static-properties.js b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-static-properties.js new file mode 100644 index 00000000..bb7ee4aa --- /dev/null +++ b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-static-properties.js @@ -0,0 +1,8 @@ +const { linkListHandler } = require("./link-list-checker.js"); + +/** + * Handler for the `data.static_properties` ingredient. + */ +const handleDataStaticProperties = linkListHandler("Static_properties"); + +module.exports = handleDataStaticProperties; diff --git a/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/index.js b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/index.js index 2026f36d..c7120c68 100644 --- a/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/index.js +++ b/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/index.js @@ -1,6 +1,5 @@ const { select } = require("hast-util-select"); -const classMembers = require("./data-class-members"); const handleDataBrowserCompatibility = require("./data-browser-compatibility"); const handleDataConstituentProperties = require("./data-constituent-properties"); const handleDataConstructor = require("./data-constructor"); @@ -30,17 +29,17 @@ const handleProseShortDescription = require("./prose-short-description"); const ingredientHandlers = { "data.browser_compatibility": handleDataBrowserCompatibility, "data.constituent_properties": handleDataConstituentProperties, - "data.constructor_properties?": classMembers.handleDataConstructorProperties, + "data.constructor_properties?": require("./data-constructor-properties"), "data.constructor": handleDataConstructor, "data.examples": handleDataExamples, "data.formal_definition": handleDataFormalDefinition, "data.formal_syntax": handleDataFormalSyntax, - "data.instance_methods?": classMembers.handleDataInstanceMethods, - "data.instance_properties?": classMembers.handleDataInstanceProperties, + "data.instance_methods?": require("./data-instance-methods"), + "data.instance_properties?": require("./data-instance-properties"), "data.interactive_example?": handleDataInteractiveExample, "data.specifications": handleDataSpecifications, - "data.static_methods?": classMembers.handleDataStaticMethods, - "data.static_properties?": classMembers.handleDataStaticProperties, + "data.static_methods?": require("./data-static-methods"), + "data.static_properties?": require("./data-static-properties"), "prose.accessibility_concerns?": optionalTopLevelHeading( "Accessibility_concerns" ),