Skip to content

Commit

Permalink
Pin deps (#1767)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasrw committed Jul 30, 2023
1 parent 0caf877 commit dfb0789
Show file tree
Hide file tree
Showing 62 changed files with 774 additions and 425 deletions.
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

29 changes: 13 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,19 @@
"postversion": "npm publish && git push && git push --tags && echo \"Successfully released version $npm_package_version\""
},
"dependencies": {
"cross-fetch": "4.0.0",
"dom-storage": "2.1.0",
"es6-promise": "4.2.8",
"node-fetch": "3",
"cross-fetch": "4",
"yargs": "16"
},
"devDependencies": {
"blueimp-md5": "2.19.0",
"cmdmix": "2.1.1",
"eslint": "8.30.0",
"dom-storage": "2.1.0",
"eslint": "8.46.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-import": "2.28.0",
"eslint-plugin-n": "16.0.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-standard": "5.0.0",
"git-branch-is": "4.0.0",
"gulp": "4.0.2",
"gulp-concat": "2.6.1",
Expand All @@ -83,12 +80,12 @@
},
"resolutions": {
"got": "13.0.0",
"axios": "1.0.0",
"json5": "2.2.3",
"underscore": "1.12.1",
"glob-parent": "6.0.1",
"decode-uri-component": "0.2.1",
"semver": "7.5.2"
"axios": "1",
"json5": "2",
"underscore": "1",
"glob-parent": "6",
"decode-uri-component": "0.2",
"semver": "7"
},
"engines": {
"node": ">=15"
Expand Down Expand Up @@ -118,9 +115,9 @@
"useTabs": true,
"printWidth": 100,
"singleQuote": true,
"arrowParens": "always",
"bracketSpacing": false,
"trailingComma": "es5"
"arrowParens": "avoid",
"trailingComma": "es5",
"bracketSpacing": false
},
"husky": {
"hooks": {
Expand Down
14 changes: 7 additions & 7 deletions src/15utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ var loadFile = (utils.loadFile = function (path, asy, success, error) {
});
} else {
if (/^[a-z]+:\/\//i.test(path)) {
fetchData(path, (x) => success(cutbom(x)), error, asy);
fetchData(path, x => success(cutbom(x)), error, asy);
} else {
//If async callthen call async
if (asy) {
Expand Down Expand Up @@ -404,7 +404,7 @@ var loadFile = (utils.loadFile = function (path, asy, success, error) {
Simply read file from HTTP request, like:
SELECT * FROM TXT('http://alasql.org/README.md');
*/
fetchData(path, (x) => success(cutbom(x)), error, asy);
fetchData(path, x => success(cutbom(x)), error, asy);
}
} else if (path instanceof Event) {
/*
Expand Down Expand Up @@ -445,13 +445,13 @@ async function fetchData(path, success, error, async) {

function getData(path, success, error) {
return _fetch(path)
.then((response) => response.arrayBuffer())
.then((buf) => {
.then(response => response.arrayBuffer())
.then(buf => {
var a = new Uint8Array(buf);
var b = [...a].map((e) => String.fromCharCode(e)).join('');
var b = [...a].map(e => String.fromCharCode(e)).join('');
success(b);
})
.catch((e) => {
.catch(e => {
if (error) return error(e);
console.error(e);
throw e;
Expand All @@ -473,7 +473,7 @@ var loadBinaryFile = (utils.loadBinaryFile = function (
path,
runAsync,
success,
error = (x) => {
error = x => {
throw x;
}
) {
Expand Down
6 changes: 3 additions & 3 deletions src/18promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ var promiseExec = function (sql, params, counterStep, counterTotal) {

const sequentialPromiseResolver = (promiseData, Promise) => {
var startingPoint = Promise.resolve([]);
promiseData.forEach((p) => {
startingPoint = startingPoint.then((previousResult) =>
promiseExec(p.sql, p.params, p.i, p.length).then((result) => [...previousResult, result])
promiseData.forEach(p => {
startingPoint = startingPoint.then(previousResult =>
promiseExec(p.sql, p.params, p.i, p.length).then(result => [...previousResult, result])
);
});

Expand Down
6 changes: 3 additions & 3 deletions src/30statements.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ yy.Statements = class Statements {
}

toString() {
return this.statements.map((st) => st.toString()).join('; ');
return this.statements.map(st => st.toString()).join('; ');
}

// Compile array of statements into single statement
compile(db) {
const statements = this.statements.map((st) => st.compile(db));
const statements = this.statements.map(st => st.compile(db));
return statements.length === 1
? statements[0]
: (params, cb) => {
const res = statements.map((st) => st(params));
const res = statements.map(st => st(params));
if (cb) cb(res);
return res;
};
Expand Down
4 changes: 2 additions & 2 deletions src/35search.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ alasql.srch = {
PROP(val, args, stope) {
// console.log('PROP',args[0],val);
if (stope.mode === 'XML') {
const values = val.children.filter((v) => v.name.toUpperCase() === args[0].toUpperCase());
const values = val.children.filter(v => v.name.toUpperCase() === args[0].toUpperCase());

return {
status: values.length ? 1 : -1,
Expand Down Expand Up @@ -1073,7 +1073,7 @@ alasql.srch = {

ROW(val, args, stope, params) {
var s = 'var y;return [';
s += args.map((arg) => arg.toJS('x', '')).join(',');
s += args.map(arg => arg.toJS('x', '')).join(',');
s += ']';
var setfn = new Function('x,params,alasql', s);
var rv = setfn(val, params, alasql);
Expand Down
4 changes: 2 additions & 2 deletions src/423groupby.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ if(false) {
// if(col instanceof yy.Column) colas = col.columnid;
// else colas = col.toString();
// };
let colExpIfFunIdExists = (expression) => {
let colExpIfFunIdExists = expression => {
let colexpression = expression.args[0];
return colexpression.toJS('p', tableid, defcols);
};
Expand Down Expand Up @@ -319,7 +319,7 @@ if(false) {
// }
*/
var colexp = col.expression.toJS('p', tableid, defcols);
let colExpIfFunIdExists = (expression) => {
let colExpIfFunIdExists = expression => {
let colexpression = expression.args[0];
return colexpression.toJS('p', tableid, defcols);
};
Expand Down
2 changes: 1 addition & 1 deletion src/55functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ stdlib.UPPER = stdlib.UCASE = function (s) {
// Concatination of strings
stdfn.CONCAT_WS = function () {
var args = Array.prototype.slice.call(arguments);
args = args.filter((x) => !(x === null || typeof x === 'undefined'));
args = args.filter(x => !(x === null || typeof x === 'undefined'));
return args.slice(1, args.length).join(args[0] || '');
};

Expand Down
6 changes: 5 additions & 1 deletion src/60createtable.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,11 @@ yy.CreateTable.prototype.execute = function (databaseid, params, cb) {
};
}
if (checkfn) {
table.checks.push({fn: checkfn, id: con.constraintid, fk: con.type === 'FOREIGN KEY'});
table.checks.push({
fn: checkfn,
id: con.constraintid,
fk: con.type === 'FOREIGN KEY',
});
}
});

Expand Down
4 changes: 3 additions & 1 deletion src/67withselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ yy.WithSelect.prototype.execute = function (databaseid, params, cb) {
var savedTables = [];
self.withs.forEach(function (w) {
savedTables.push(alasql.databases[databaseid].tables[w.name]);
var tb = (alasql.databases[databaseid].tables[w.name] = new Table({tableid: w.name}));
var tb = (alasql.databases[databaseid].tables[w.name] = new Table({
tableid: w.name,
}));
tb.data = w.select.execute(databaseid, params);
});

Expand Down
6 changes: 5 additions & 1 deletion src/78show.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ yy.ShowColumns.prototype.execute = function (databaseid, params, cb) {

if (table && table.columns) {
var res = table.columns.map(function (col) {
return {columnid: col.columnid, dbtypeid: col.dbtypeid, dbsize: col.dbsize};
return {
columnid: col.columnid,
dbtypeid: col.dbtypeid,
dbsize: col.dbsize,
};
});
if (cb) cb(res);
return res;
Expand Down
4 changes: 3 additions & 1 deletion src/833xlsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ alasql.into.XLSX = function (filename, opts, data, columns, cb) {

if (opt.headers) {
columns.forEach(function (col, idx) {
cells[alasql.utils.xlsnc(col0 + idx) + '' + i] = {v: col.columnid.trim()};
cells[alasql.utils.xlsnc(col0 + idx) + '' + i] = {
v: col.columnid.trim(),
};
});
i++;
}
Expand Down
12 changes: 10 additions & 2 deletions src/84from.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,17 @@ function XLSXLSX(X, filename, opts, cb, idx, query) {
// function processData(data) {
if (data instanceof ArrayBuffer) {
var arr = fixdata(data);
var workbook = X.read(btoa(arr), {type: 'base64', ...alasql.options.excel, ...opts});
var workbook = X.read(btoa(arr), {
type: 'base64',
...alasql.options.excel,
...opts,
});
} else {
var workbook = X.read(data, {type: 'binary', ...alasql.options.excel, ...opts});
var workbook = X.read(data, {
type: 'binary',
...alasql.options.excel,
...opts,
});
}
// console.log(workbook);
var sheetid;
Expand Down
24 changes: 12 additions & 12 deletions src/91indexeddb.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function _databaseExists(name) {

if (indexedDB.databases) {
const dbs = await indexedDB.databases();
const db = dbs.find((db) => db.name === name);
const db = dbs.find(db => db.name === name);
// @ts-ignore
return db || 0;
}
Expand All @@ -38,7 +38,7 @@ async function _databaseExists(name) {
resolve({name, version: req.result.version});
};

req.onupgradeneeded = (evt) => {
req.onupgradeneeded = evt => {
evt.target.transaction.abort();
resolve(0);
};
Expand All @@ -63,7 +63,7 @@ IDB.showDatabases = function (like, cb) {
return;
}

indexedDB.databases().then((dblist) => {
indexedDB.databases().then(dblist => {
const res = [];
const relike = like && new RegExp(like.value.replace(/\%/g, '.*'), 'g');

Expand All @@ -78,7 +78,7 @@ IDB.showDatabases = function (like, cb) {
};

IDB.createDatabase = async function (ixdbid, args, ifnotexists, dbid, cb) {
const found = await _databaseExists(ixdbid).catch((err) => {
const found = await _databaseExists(ixdbid).catch(err => {
if (cb) cb(null, err);
throw err;
});
Expand All @@ -102,7 +102,7 @@ IDB.createDatabase = async function (ixdbid, args, ifnotexists, dbid, cb) {
};

IDB.dropDatabase = async function (ixdbid, ifexists, cb) {
const found = await _databaseExists(ixdbid).catch((err) => {
const found = await _databaseExists(ixdbid).catch(err => {
if (cb) cb(null, err);
throw err;
});
Expand All @@ -126,7 +126,7 @@ IDB.dropDatabase = async function (ixdbid, ifexists, cb) {
};

IDB.attachDatabase = async function (ixdbid, dbid, args, params, cb) {
const found = await _databaseExists(ixdbid).catch((err) => {
const found = await _databaseExists(ixdbid).catch(err => {
if (cb) cb(null, err);
throw err;
});
Expand Down Expand Up @@ -171,7 +171,7 @@ IDB.attachDatabase = async function (ixdbid, dbid, args, params, cb) {

IDB.createTable = async function (databaseid, tableid, ifnotexists, cb) {
const ixdbid = alasql.databases[databaseid].ixdbid;
const found = await _databaseExists(ixdbid).catch((err) => {
const found = await _databaseExists(ixdbid).catch(err => {
if (cb) cb(null, err);
throw err;
});
Expand All @@ -192,7 +192,7 @@ IDB.createTable = async function (databaseid, tableid, ifnotexists, cb) {
request.result.close();
if (cb) cb(1);
};
request.onerror = (evt) => {
request.onerror = evt => {
cb(null, evt);
};
request.onblocked = function (event) {
Expand All @@ -205,7 +205,7 @@ IDB.createTable = async function (databaseid, tableid, ifnotexists, cb) {

IDB.dropTable = async function (databaseid, tableid, ifexists, cb) {
const ixdbid = alasql.databases[databaseid].ixdbid;
const found = await _databaseExists(ixdbid).catch((err) => {
const found = await _databaseExists(ixdbid).catch(err => {
if (cb) cb(null, err);
throw err;
});
Expand Down Expand Up @@ -287,7 +287,7 @@ IDB.intoTable = function (databaseid, tableid, value, columns, cb) {
var db = alasql.databases[databaseid];
var table = db.tables[tableid];

request.onupgradeneeded = (evt) => {
request.onupgradeneeded = evt => {
evt.target.transaction.abort();
const err = new Error(
`Cannot insert into table "${tableid}" because database "${databaseid}" does not exist`
Expand Down Expand Up @@ -323,7 +323,7 @@ IDB.fromTable = function (databaseid, tableid, cb, idx, query) {
const ixdbid = alasql.databases[databaseid].ixdbid;
const request = indexedDB.open(ixdbid);

request.onupgradeneeded = (evt) => {
request.onupgradeneeded = evt => {
evt.target.transaction.abort();
const err = new Error(
`Cannot select from table "${tableid}" because database "${databaseid}" does not exist`
Expand All @@ -340,7 +340,7 @@ IDB.fromTable = function (databaseid, tableid, cb, idx, query) {
const cursor = cur.result;
if (cursor) {
// if keyPath(columns) is not present then we take the key and value as object.
const cursorValue = typeof cursor === Object ? cursor.value : { [cursor.key]: cursor.value };
const cursorValue = typeof cursor === Object ? cursor.value : {[cursor.key]: cursor.value};
res.push(cursorValue);
cursor.continue();
} else {
Expand Down
4 changes: 3 additions & 1 deletion src/FileSaver.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ var saveAs =
blob.type
)
) {
return new Blob([String.fromCharCode(0xfeff), blob], {type: blob.type});
return new Blob([String.fromCharCode(0xfeff), blob], {
type: blob.type,
});
}
return blob;
},
Expand Down
2 changes: 1 addition & 1 deletion test/browserTestRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

const testFiles = walkFiles(__dirname, /test\d+\.js$/, null, true, true);

const testFilesHtml = testFiles.map((file) => `<script src="${file}"></script>`).join('\n');
const testFilesHtml = testFiles.map(file => `<script src="${file}"></script>`).join('\n');

var html = template.replace('@INSERT_TESTFILES', testFilesHtml);

Expand Down
Loading

0 comments on commit dfb0789

Please sign in to comment.