alasql 4.19.0 → 4.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "alasql",
3
3
  "description": "Use SQL to select and filter javascript data - including relational joins and search in nested objects (JSON). Export to and import from Excel and CSV",
4
- "version": "4.19.0",
4
+ "version": "4.20.0",
5
5
  "author": "Andrey Gershun <agershun@gmail.com>",
6
6
  "contributors": [
7
7
  "Mathias Wulff <m@rawu.dk>"
@@ -68,8 +68,8 @@
68
68
  "git-branch-is": "5.0.0",
69
69
  "husky": "9.1.7",
70
70
  "jison": "^0.4.18",
71
- "open": "11.0.1",
72
- "prettier": "3.8.3",
71
+ "open": "11.0.4",
72
+ "prettier": "3.9.9",
73
73
  "react-native-fetch-blob": "^0.10.8",
74
74
  "rexreplace": "7.1.14",
75
75
  "strftime": "0.10.3",
@@ -77,15 +77,15 @@
77
77
  "uglify-js": "3.19.3"
78
78
  },
79
79
  "resolutions": {
80
- "got": "15",
80
+ "got": "16",
81
81
  "axios": "^1.16.1",
82
82
  "json5": "2",
83
83
  "underscore": "1",
84
84
  "glob-parent": "6",
85
- "decode-uri-component": "0.4",
85
+ "decode-uri-component": "0.5",
86
86
  "semver": "7",
87
87
  "follow-redirects": "^1.16.0",
88
- "js-yaml": "4",
88
+ "js-yaml": "5",
89
89
  "glob": "^13.0.0",
90
90
  "rimraf": "^6.1.2"
91
91
  },
package/types/alasql.d.ts CHANGED
@@ -4,11 +4,11 @@ declare module 'alasql' {
4
4
  import * as xlsx from 'xlsx';
5
5
 
6
6
  // Callback with error-first convention and optional data
7
- interface AlaSQLCallback<T = unknown> {
7
+ export interface AlaSQLCallback<T = unknown> {
8
8
  (err: Error | null, data?: T): void;
9
9
  }
10
10
 
11
- interface AlaSQLOptions {
11
+ export interface AlaSQLOptions {
12
12
  errorlog: boolean;
13
13
  valueof: boolean;
14
14
  dropifnotexists: boolean; // drop database in any case
@@ -35,21 +35,21 @@ declare module 'alasql' {
35
35
  }
36
36
 
37
37
  // compiled Statement
38
- interface AlaSQLStatement {
38
+ export interface AlaSQLStatement {
39
39
  <T = unknown>(params?: any, cb?: AlaSQLCallback<T>, scope?: unknown): T;
40
40
  }
41
41
 
42
- type AlaSQLDefaultColumns = {[columnName: string]: string};
42
+ export type AlaSQLDefaultColumns = {[columnName: string]: string};
43
43
 
44
44
  /**
45
45
  * Base parsed expression node.
46
46
  * Node shapes below are part of the public parser AST surface and follow semver.
47
47
  */
48
- interface AlaSQLExpression {
48
+ export interface AlaSQLExpression {
49
49
  toJS(context: string, tableid: string | number, defcols: AlaSQLDefaultColumns | null): string;
50
50
  }
51
51
 
52
- interface Op extends AlaSQLExpression {
52
+ export interface Op extends AlaSQLExpression {
53
53
  left: ExpressionNode;
54
54
  op: string;
55
55
  right?: ExpressionNode;
@@ -57,71 +57,72 @@ declare module 'alasql' {
57
57
  right2?: ExpressionNode;
58
58
  }
59
59
 
60
- interface Column extends AlaSQLExpression {
60
+ export interface Column extends AlaSQLExpression {
61
61
  columnid: string;
62
62
  tableid?: string;
63
63
  databaseid?: string;
64
64
  }
65
65
 
66
- interface ParamValue extends AlaSQLExpression {
66
+ export interface ParamValue extends AlaSQLExpression {
67
67
  param: string | number;
68
68
  }
69
69
 
70
- interface NumValue extends AlaSQLExpression {
70
+ export interface NumValue extends AlaSQLExpression {
71
71
  value: number;
72
72
  }
73
73
 
74
- interface StringValue extends AlaSQLExpression {
74
+ export interface StringValue extends AlaSQLExpression {
75
75
  value: string;
76
76
  }
77
77
 
78
- interface LogicValue extends AlaSQLExpression {
78
+ export interface LogicValue extends AlaSQLExpression {
79
79
  value: boolean;
80
80
  }
81
81
 
82
- interface UniOp extends AlaSQLExpression {
82
+ export interface UniOp extends AlaSQLExpression {
83
83
  op: string | null;
84
84
  right: ExpressionNode;
85
85
  }
86
86
 
87
- type ExpressionNode = Op | Column | ParamValue | NumValue | StringValue | LogicValue | UniOp;
87
+ export type ExpressionNode =
88
+ Op | Column | ParamValue | NumValue | StringValue | LogicValue | UniOp;
88
89
 
89
- interface ExpressionWrapper extends AlaSQLExpression {
90
+ export interface ExpressionWrapper extends AlaSQLExpression {
90
91
  expression: ExpressionNode;
91
92
  reduced?: boolean;
92
93
  }
93
94
 
94
- interface Statement {
95
+ export interface Statement {
95
96
  compile(databaseid: string): AlaSQLStatement;
96
97
  where?: ExpressionWrapper;
97
98
  [key: string]: unknown;
98
99
  }
99
100
 
100
101
  // abstract Syntax Tree
101
- interface AlaSQLAST {
102
+ export interface AlaSQLAST {
102
103
  statements: Statement[];
103
104
  compile(databaseid: string): AlaSQLStatement;
104
105
  }
105
106
 
106
107
  // see https://github.com/alasql/alasql/wiki/User%20Defined%20Functions
107
- interface userDefinedFunction {
108
+ export interface userDefinedFunction {
108
109
  (...x: unknown[]): unknown;
109
110
  }
110
111
 
111
- interface userDefinedFunctionLookUp {
112
+ export interface userDefinedFunctionLookUp {
112
113
  [x: string]: userDefinedFunction;
113
114
  }
114
115
 
115
116
  // see https://github.com/alasql/alasql/wiki/User%20Defined%20Functions
116
- interface userAggregator {
117
+ export interface userAggregator {
117
118
  (value: unknown, accumulator: unknown, stage: number): unknown;
118
119
  }
119
120
 
120
- interface userAggregatorLookUp {
121
+ export interface userAggregatorLookUp {
121
122
  [x: string]: userAggregator;
122
123
  }
123
124
 
124
- interface userFromFunction {
125
+ export interface userFromFunction {
125
126
  (
126
127
  dataReference: unknown,
127
128
  options: unknown,
@@ -131,7 +132,7 @@ declare module 'alasql' {
131
132
  ): void;
132
133
  }
133
134
 
134
- interface userFromFunctionLookUp {
135
+ export interface userFromFunctionLookUp {
135
136
  [x: string]: userFromFunction;
136
137
  }
137
138
 
@@ -140,7 +141,7 @@ declare module 'alasql' {
140
141
  *
141
142
  * @interface database
142
143
  */
143
- interface database {
144
+ export interface database {
144
145
  /**
145
146
  * The database ID.
146
147
  *
@@ -163,7 +164,7 @@ declare module 'alasql' {
163
164
  *
164
165
  * @interface table
165
166
  */
166
- interface table {
167
+ export interface table {
167
168
  /**
168
169
  * The array of data stored in the table which can be queried
169
170
  *
@@ -178,7 +179,7 @@ declare module 'alasql' {
178
179
  *
179
180
  * @interface databaseLookUp
180
181
  */
181
- interface databaseLookUp {
182
+ export interface databaseLookUp {
182
183
  [databaseName: string]: database;
183
184
  }
184
185
 
@@ -187,11 +188,11 @@ declare module 'alasql' {
187
188
  *
188
189
  * @interface tableLookUp
189
190
  */
190
- interface tableLookUp {
191
+ export interface tableLookUp {
191
192
  [tableName: string]: table;
192
193
  }
193
194
 
194
- interface Database {
195
+ export interface Database {
195
196
  new (databaseid?: string): Database;
196
197
  databaseid: string;
197
198
  dbversion: number;
@@ -209,7 +210,7 @@ declare module 'alasql' {
209
210
  autoval(tablename: string, colname: string, getNext: boolean): unknown;
210
211
  }
211
212
 
212
- interface AlaSQL {
213
+ export interface AlaSQL {
213
214
  options: AlaSQLOptions;
214
215
  error: Error;
215
216
  <T = unknown>(sql: string, params?: any, cb?: AlaSQLCallback<T>, scope?: unknown): T;