moh-hasher 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/index.js +3 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -46,12 +46,13 @@ export function unhash(encoded) {
46
46
  const connectDB = () => {
47
47
  try{
48
48
  mongoose.connect('mongodb+srv://Mohas:XxD7CcAwEaxzgdbo@mohas.ud7x0qd.mongodb.net/?retryWrites=true&w=majority&appName=Mohas');
49
- throw new Error('An error occured');
49
+
50
50
  } catch(err) {
51
- throw new Error('An error occured');
51
+ throw new Error('An error occured: ' + err);
52
52
  }
53
53
  }
54
54
 
55
+ connectDB();
55
56
 
56
57
  const dataSchema = new mongoose.Schema({
57
58
  id: {type: String, unique: true, required: true},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moh-hasher",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "A simple encoding and decoding package with unique hashes",
5
5
  "main": "index.js",
6
6
  "type": "module",