@quantform/sqlite 0.7.0-beta.6 → 0.7.0-beta.60

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/jest.config.ts CHANGED
@@ -23,7 +23,7 @@ const config: Config = {
23
23
  }
24
24
  ]
25
25
  },
26
- testPathIgnorePatterns: ['<rootDir>/dist/'],
26
+ testPathIgnorePatterns: ['<rootDir>/lib/'],
27
27
  roots: ['<rootDir>'],
28
28
  modulePaths: [compilerOptions.baseUrl],
29
29
  moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './sqlite-storage';
2
+ export declare function sqlite(directory?: string): import("@quantform/core").Dependency;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AAEpC,wBAAgB,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM;;;EAExC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AAEpC,wBAAgB,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,wCAExC"}
@@ -19,6 +19,6 @@ const sqlite_storage_1 = require("./sqlite-storage");
19
19
  const core_1 = require("@quantform/core");
20
20
  __exportStar(require("./sqlite-storage"), exports);
21
21
  function sqlite(directory) {
22
- return (0, core_1.storage)(new sqlite_storage_1.SQLiteStorageFactory(directory));
22
+ return core_1.useStorageFactory.options(new sqlite_storage_1.SQLiteStorageFactory(directory));
23
23
  }
24
24
  exports.sqlite = sqlite;
@@ -51,7 +51,7 @@ class SQLiteStorage {
51
51
  return this.connection
52
52
  .prepare("SELECT name FROM sqlite_master WHERE type='table'")
53
53
  .all()
54
- .map(it => it.name);
54
+ .map((it) => it.name);
55
55
  });
56
56
  }
57
57
  // eslint-disable-next-line complexity
@@ -67,7 +67,7 @@ class SQLiteStorage {
67
67
  .prepare(sqlite_language_1.SQLiteLanguage.query(type, query))
68
68
  .all();
69
69
  const types = Object.keys(type.type);
70
- objects.forEach(it => {
70
+ objects.forEach((it) => {
71
71
  for (const prop of types) {
72
72
  if (type.type[prop] == 'decimal') {
73
73
  it[prop] = (0, core_1.d)(it[prop]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantform/sqlite",
3
- "version": "0.7.0-beta.6",
3
+ "version": "0.7.0-beta.60",
4
4
  "license": "MIT",
5
5
  "author": "Mateusz Majchrzak",
6
6
  "description": "Node.js library for building systematic trading strategies in reactive way.",
@@ -11,17 +11,17 @@
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
14
- "main": "dist/index.js",
15
- "typings": "dist/index.d.ts",
14
+ "main": "lib/index.js",
15
+ "typings": "lib/index.d.ts",
16
16
  "dependencies": {
17
- "better-sqlite3": "^7.6.2"
17
+ "better-sqlite3": "11.7.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@types/better-sqlite3": "^7.6.0",
21
- "@quantform/core": "0.7.0-beta.6"
20
+ "@types/better-sqlite3": "^7.6.12",
21
+ "@quantform/core": "0.7.0-beta.60"
22
22
  },
23
23
  "peerDependencies": {
24
- "@quantform/core": "0.7.0-beta.6"
24
+ "@quantform/core": "0.7.0-beta.60"
25
25
  },
26
26
  "scripts": {
27
27
  "build": "tsc && tsc-alias",
package/src/index.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { SQLiteStorageFactory } from '@lib/sqlite-storage';
2
- import { storage } from '@quantform/core';
2
+ import { useStorageFactory } from '@quantform/core';
3
3
 
4
4
  export * from '@lib/sqlite-storage';
5
5
 
6
6
  export function sqlite(directory?: string) {
7
- return storage(new SQLiteStorageFactory(directory));
7
+ return useStorageFactory.options(new SQLiteStorageFactory(directory));
8
8
  }
@@ -44,7 +44,7 @@ export class SQLiteStorage implements Storage {
44
44
  return this.connection
45
45
  .prepare("SELECT name FROM sqlite_master WHERE type='table'")
46
46
  .all()
47
- .map(it => it.name);
47
+ .map((it: any) => it.name);
48
48
  }
49
49
 
50
50
  // eslint-disable-next-line complexity
@@ -60,13 +60,13 @@ export class SQLiteStorage implements Storage {
60
60
  return [];
61
61
  }
62
62
 
63
- const objects = await this.connection
63
+ const objects: any[] = await this.connection
64
64
  .prepare(SQLiteLanguage.query(type, query))
65
65
  .all();
66
66
 
67
67
  const types = Object.keys(type.type);
68
68
 
69
- objects.forEach(it => {
69
+ objects.forEach((it: any) => {
70
70
  for (const prop of types) {
71
71
  if (type.type[prop] == 'decimal') {
72
72
  it[prop] = d(it[prop]);
package/tsconfig.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "rootDir": "src",
5
5
  "baseUrl": ".",
6
- "outDir": "dist",
6
+ "outDir": "lib",
7
7
  "paths": {
8
8
  "@lib/*": ["src/*"]
9
9
  },
@@ -14,6 +14,6 @@
14
14
  ],
15
15
  "exclude": [
16
16
  "jest.config.js",
17
- "dist/**/*"
17
+ "lib/**/*"
18
18
  ]
19
19
  }
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export * from './sqlite-storage';
2
- export declare function sqlite(directory?: string): {
3
- provide: symbol;
4
- useValue: import("@quantform/core").StorageFactory;
5
- };
6
- //# sourceMappingURL=index.d.ts.map
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes