Skip to content

Commit 09ca8a7

Browse files
committed
clean up in tasks/ scripts
1 parent 1d6f218 commit 09ca8a7

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

tasks/preprocess.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var fs = require('fs');
2+
23
var sass = require('node-sass');
34

45
var pullCSS = require('./util/pull_css');

tasks/util/compress_attributes.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
'use strict';
1+
var through = require('through2');
22

3-
/*
4-
* Browserify transform that strips meta attributes out of the plotlyjs bundle
5-
*
3+
/**
4+
* Browserify transform that strips meta attributes out
5+
* of the plotly.js bundles
66
*/
77

8-
var through = require('through2');
9-
10-
var attributeNamesToRemove = ['description', 'requiredOpts', 'otherOpts', 'hrName', 'role'],
11-
regexStr = '';
8+
var attributeNamesToRemove = [
9+
'description', 'requiredOpts', 'otherOpts', 'hrName', 'role'
10+
];
1211

1312
// ref: http://www.regexr.com/3bj6p
13+
var regexStr = '';
1414
attributeNamesToRemove.forEach(function(attr, i) {
1515
// one line string with or without trailing comma
1616
regexStr += attr + ': \'.*\'' + ',?' + '|';

tasks/util/pull_font_svg.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ module.exports = function pullFontSVG(data, pathOut) {
2525
// turn remaining double quotes into single
2626
var charStr = JSON.stringify(chars, null, 4).replace(/\"/g, '\'');
2727

28-
var outStr = '/*jshint quotmark:true */\n\'use strict\';\n\n' +
29-
'module.exports = ' + charStr + ';\n';
28+
var outStr = [
29+
'/* jshint quotmark:true */',
30+
'',
31+
'\'use strict\';',
32+
'',
33+
'module.exports = ' + charStr + ';'
34+
].join('\n');
3035

3136
fs.writeFile(pathOut, outStr, function(err) {
3237
if(err) throw err;

0 commit comments

Comments
 (0)