Skip to content

Commit

Permalink
Fixed problem in specific environments when requiring lodash-id
Browse files Browse the repository at this point in the history
  • Loading branch information
TemaSM committed Jul 24, 2019
1 parent 3582c71 commit 5348b11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class LocalSession {

function _initDB () {
// Use ID based resources, so we can query records by ID (ex.: getById(), removeById(), ...)
this.DB._.mixin(require('./lodash-id'))
this.DB._.mixin(require('./lodash-id.js'))
// If database is empty, fill it with empty Array of sessions and optionally with initial state
this.DB.defaults(Object.assign({ sessions: [] }, this.options.state)).write()
debug('Initiating finished')
Expand All @@ -286,7 +286,6 @@ function isPromise (obj) {
/**
* @overview {@link http://telegraf.js.org/|Telegraf} Session middleware for storing sessions locally (Memory/FileSync/FileAsync/...)
* @module telegraf-session-local
* @version 1.0.0
* @license MIT
* @author Tema Smirnov <git.tema@smirnov.one>
* @requires {@link https://www.npmjs.com/package/telegraf|npm: telegraf}
Expand Down
2 changes: 1 addition & 1 deletion tests/lodash-id.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const
should = require('should'),
// debug = require('debug')('telegraf:session-local:test'),
_db = require('../lib/lodash-id')
_db = require('../lib/lodash-id.js')

describe('lodash + lodash-id', () => {
let db
Expand Down

2 comments on commit 5348b11

@EdJoPaTo
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did this problem occur and why? This should not make a difference: Require File Modules

@TemaSM
Copy link
Contributor Author

@TemaSM TemaSM commented on 5348b11 Jul 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably on Windows with corrupted PATH environment variable

Please sign in to comment.