@beauraines/node-helpers 2.5.0 → 2.5.2

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/CHANGELOG.md CHANGED
@@ -2,16 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.5.2](https://github.com/beauraines/node-helpers/compare/v2.5.0...v2.5.2) (2023-06-03)
6
+
5
7
  ## [2.5.0](https://github.com/beauraines/node-helpers/compare/v2.4.3...v2.5.0) (2023-06-03)
6
8
 
7
9
 
8
10
  ### Features
9
11
 
10
12
  * new config module ([#32](https://github.com/beauraines/node-helpers/issues/32)) ([514df50](https://github.com/beauraines/node-helpers/commit/514df509ca33527a8b18e5efe43d1b772963e879))
13
+ * supports cross OS file paths ([#33](https://github.com/beauraines/node-helpers/issues/33)) ([27f5e27](https://github.com/beauraines/node-helpers/commit/27f5e27d02408bff07220c3e82bd90186023b324)), closes [#24](https://github.com/beauraines/node-helpers/issues/24)
11
14
 
12
15
 
13
16
  ### Bug Fixes
14
17
 
18
+ * adds export of new config module ([#34](https://github.com/beauraines/node-helpers/issues/34)) ([81c7a27](https://github.com/beauraines/node-helpers/commit/81c7a27696da3d9a0b6fb3a215418185c9b1d153))
15
19
  * **deps:** bump @azure/storage-queue from 12.12.0 to 12.13.0 ([45acd3d](https://github.com/beauraines/node-helpers/commit/45acd3d808ab064c1dbc4b492a013c7b60ebf5b2))
16
20
  * **deps:** bump dayjs from 1.11.7 to 1.11.8 ([2208985](https://github.com/beauraines/node-helpers/commit/22089855cd90758273bac28fa1d8669d21f661b5))
17
21
  * **deps:** bump node-fetch from 2.6.9 to 2.6.11 ([d9fbed2](https://github.com/beauraines/node-helpers/commit/d9fbed2e6ade418caada9cc68f6ac05ba4d3159d))
package/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
 
2
2
  const AzureStorage = require("./src/azure")
3
+ const config = require('./src/config.js')
3
4
  const credentials = require("./src/credentials.js");
4
5
  const database = require("./src/database");
5
6
  const helpers = require("./src/helpers");
@@ -7,6 +8,7 @@ const jira = require("./src/jira");
7
8
 
8
9
  module.exports = {
9
10
  AzureStorage,
11
+ config,
10
12
  credentials,
11
13
  database,
12
14
  helpers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beauraines/node-helpers",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "description": "Collection of node helpers",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/database.js CHANGED
@@ -2,15 +2,15 @@ const {homedir} = require('os');
2
2
  const sqlite = require('sqlite');
3
3
  const sqlite3 = require('sqlite3');
4
4
  const {fileExists} = require('./helpers');
5
+ const path = require('path');
5
6
 
6
7
  /**
7
8
  * Opens the BurnDownStatus SQLite3 Database
8
- * @param file file name of the SQLite3 DB. If not provided, defaults to ${homedir}/BurnDownStatus.db
9
+ * @param file file name of the SQLite3 DB. If not provided, defaults to BurnDownStatus.db in the users home
9
10
  * @returns SQLite database connection
10
11
  */
11
12
  async function getDBConnection(file) {
12
- const homeDir = homedir();
13
- file = file ? file : `${homeDir}/BurnDownStatus.db`;
13
+ file = file ? file : path.join(homedir(),'BurnDownStatus.db');
14
14
  if (! await fileExists(file)){
15
15
  console.error(`${file} not found`);
16
16
  // ! Separation of concerns - this should probably not be doing the exiting, but it is.
@@ -3,6 +3,7 @@ const sqlite = require('sqlite');
3
3
  const sqlite3 = require('sqlite3');
4
4
  const helpers = require('./helpers');
5
5
  const { getDBConnection } = require('./database');
6
+ const path = require('path');
6
7
 
7
8
  jest.mock('sqlite');
8
9
  jest.mock('os');
@@ -32,7 +33,7 @@ describe('database module', () => {
32
33
  helpers.fileExists.mockReturnValue(true);
33
34
 
34
35
 
35
- const expectedDefaultFile = `${os.homedir()}/BurnDownStatus.db`
36
+ const expectedDefaultFile = path.join(os.homedir(),'BurnDownStatus.db')
36
37
 
37
38
  const file = undefined;
38
39
  // call function with null file
@@ -56,7 +57,7 @@ describe('database module', () => {
56
57
  os.homedir.mockReturnValue(expectedHomeDir);
57
58
  helpers.fileExists.mockReturnValue(true);
58
59
 
59
- const expectedDefaultFile = `${os.homedir()}/my_database.db`
60
+ const expectedDefaultFile = path.join(os.homedir(),'BurnDownStatus.db')
60
61
 
61
62
  const db = await getDBConnection(expectedDefaultFile)
62
63