From d0c7e7bf686a1c24525c2909dea4ccd31ddf09d8 Mon Sep 17 00:00:00 2001 From: archmoj Date: Sat, 26 Jun 2021 14:36:15 -0400 Subject: [PATCH] simplify makeSchema function - do not return extra function --- tasks/bundle.js | 2 +- tasks/util/make_schema.js | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tasks/bundle.js b/tasks/bundle.js index 048c3bf42b7..8a5d3661320 100644 --- a/tasks/bundle.js +++ b/tasks/bundle.js @@ -75,7 +75,7 @@ tasks.push(function(done) { }, function() { prependFile(pathToPlotlyDistWithMeta, header, common.throwOnError); - makeSchema(pathToPlotlyDistWithMeta, pathToSchema)(); + makeSchema(pathToPlotlyDistWithMeta, pathToSchema); done(); }); }); diff --git a/tasks/util/make_schema.js b/tasks/util/make_schema.js index 47c1790afa4..eaf73dd8af5 100644 --- a/tasks/util/make_schema.js +++ b/tasks/util/make_schema.js @@ -3,13 +3,11 @@ var path = require('path'); var plotlyNode = require('./plotly_node'); module.exports = function makeSchema(plotlyPath, schemaPath) { - return function() { - var Plotly = plotlyNode(plotlyPath); + var Plotly = plotlyNode(plotlyPath); - var plotSchema = Plotly.PlotSchema.get(); - var plotSchemaStr = JSON.stringify(plotSchema, null, 1); - fs.writeFileSync(schemaPath, plotSchemaStr); + var plotSchema = Plotly.PlotSchema.get(); + var plotSchemaStr = JSON.stringify(plotSchema, null, 1); + fs.writeFileSync(schemaPath, plotSchemaStr); - console.log('ok ' + path.basename(schemaPath)); - }; + console.log('ok ' + path.basename(schemaPath)); };