Skip to content

Commit d997e41

Browse files
committed
Consistent code formatting
1 parent dbcbedc commit d997e41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+31845
-20817
lines changed

.prettierignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
src/10start.js
2+
3+
src/98finish.js
4+
5+
src/99worker-finish.js
6+
7+
src/99worker-start.js
8+
9+
src/alasqlparser.js
10+
11+
src/97saveas.js

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
printWidth: 100
2+
tabWidth: 4
3+
useTabs: true
4+
bracketSpacing: false
5+
trailingComma: es5
6+
singleQuote: true

dist/alasql-worker.js

+35-40
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
//! AlaSQL v0.4.4-fix-aggregate-empty-sets-1566 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT
1+
//! AlaSQL v0.4.4-develop-1566 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT
22
/*
33
@module alasql
4-
@version 0.4.4-fix-aggregate-empty-sets-1566
4+
@version 0.4.4-develop-1566
55
66
AlaSQL - JavaScript SQL database
77
© 2014-2016 Andrey Gershun & Mathias Rangel Wulff
@@ -154,56 +154,53 @@ if(typeof Promise !== "undefined"){
154154
}
155155

156156

157+
alasql = alasql || false;
157158

158-
alasql = alasql||false;
159-
160-
if(!alasql){
159+
if (!alasql) {
161160
throw new Error('alasql was not found');
162161
}
163162

164-
alasql.worker = function(){
163+
alasql.worker = function() {
165164
throw new Error('Can find webworker in this enviroment');
165+
};
166166

167-
}
168-
169-
if(typeof(Worker) !== "undefined") {
170-
167+
if (typeof Worker !== 'undefined') {
171168
alasql.worker = function(path, paths, cb) {
172-
// var path;
173-
if(path === true){
169+
// var path;
170+
if (path === true) {
174171
path = undefined;
175172
}
176173

177-
if (typeof path === "undefined") {
174+
if (typeof path === 'undefined') {
178175
var sc = document.getElementsByTagName('script');
179-
for(var i=0;i<sc.length;i++) {
176+
for (var i = 0; i < sc.length; i++) {
180177
if (sc[i].src.substr(-16).toLowerCase() === 'alasql-worker.js') {
181-
path = sc[i].src.substr(0,sc[i].src.length-16)+'alasql.js';
178+
path = sc[i].src.substr(0, sc[i].src.length - 16) + 'alasql.js';
182179
break;
183180
} else if (sc[i].src.substr(-20).toLowerCase() === 'alasql-worker.min.js') {
184-
path = sc[i].src.substr(0,sc[i].src.length-20)+'alasql.min.js';
181+
path = sc[i].src.substr(0, sc[i].src.length - 20) + 'alasql.min.js';
185182
break;
186183
} else if (sc[i].src.substr(-9).toLowerCase() === 'alasql.js') {
187-
path = sc[i].src;
184+
path = sc[i].src;
188185
break;
189186
} else if (sc[i].src.substr(-13).toLowerCase() === 'alasql.min.js') {
190-
path = sc[i].src.substr(0,sc[i].src.length-13)+'alasql.min.js';
187+
path = sc[i].src.substr(0, sc[i].src.length - 13) + 'alasql.min.js';
191188
break;
192189
}
193190
}
194191
}
195192

196-
if(typeof path === "undefined") {
193+
if (typeof path === 'undefined') {
197194
throw new Error('Path to alasql.js is not specified');
198-
} else if(path !== false) {
199-
195+
} else if (path !== false) {
200196
var js = "importScripts('";
201-
js += path;
202-
js+="');self.onmessage = function(event) {"+
203-
"alasql(event.data.sql,event.data.params, function(data){"+
204-
"postMessage({id:event.data.id, data:data});});}";
197+
js += path;
198+
js +=
199+
"');self.onmessage = function(event) {" +
200+
'alasql(event.data.sql,event.data.params, function(data){' +
201+
'postMessage({id:event.data.id, data:data});});}';
205202

206-
var blob = new Blob([js], {"type": "text\/plain"});
203+
var blob = new Blob([js], {type: 'text/plain'});
207204
alasql.webworker = new Worker(URL.createObjectURL(blob));
208205

209206
alasql.webworker.onmessage = function(event) {
@@ -213,30 +210,28 @@ if(typeof(Worker) !== "undefined") {
213210
delete alasql.buffer[id];
214211
};
215212

216-
alasql.webworker.onerror = function(e){
213+
alasql.webworker.onerror = function(e) {
217214
throw e;
218-
}
215+
};
219216

220-
if(arguments.length > 1) {
221-
var sql = 'REQUIRE ' + paths.map(function(p){
222-
return '"'+p+'"';
223-
}).join(",");
224-
alasql(sql,[],cb);
217+
if (arguments.length > 1) {
218+
var sql =
219+
'REQUIRE ' +
220+
paths
221+
.map(function(p) {
222+
return '"' + p + '"';
223+
})
224+
.join(',');
225+
alasql(sql, [], cb);
225226
}
226-
227-
} else if(path === false) {
227+
} else if (path === false) {
228228
delete alasql.webworker;
229229
return;
230230
}
231231
};
232-
233232
}
234233

235234

236-
237-
238-
239-
240235
/* WebWorker */
241236
/** @type {number} */
242237
alasql.lastid = 0;

dist/alasql-worker.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)