Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neode.withDirectory gets crazy with Typescript #15

Closed
breitmark opened this issue Jul 12, 2018 · 1 comment
Closed

Neode.withDirectory gets crazy with Typescript #15

breitmark opened this issue Jul 12, 2018 · 1 comment

Comments

@breitmark
Copy link

Typescript writes its .map files in the same directory as the compiled .js files. Please add a filter like:

var path = require('path');

{
key: 'withDirectory',
value: function withDirectory(directory) {
var _this2 = this;

        var files = _fs2.default.readdirSync(directory);

        files.filter(function(file) {
            return path.extname(file).toLowerCase() === '.js';
        });
        
        files.forEach(function (file) {
            var model = file.replace('.js', '');
            var path = directory + '/' + file;
            var schema = require(path);

            return _this2.model(model, schema);
        });

        return this;
    }
@adam-cowley
Copy link
Owner

Thanks for the heads up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants