Skip to content

Commit

Permalink
Small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
zrrrzzt committed Jun 13, 2016
1 parent 6effef8 commit a8b3f96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions index.js
@@ -1,20 +1,18 @@
'use strict'

var path = require('path')
var templates = require('./templates/templates.json')
const path = require('path')
const templates = require('./templates/templates.json')

function getTemplatePath (id) {
module.exports = function getTemplatePath (id) {
if (!id) {
throw new Error('Missing required input: template id')
}

var doc = templates[id]
const doc = templates[id]

if (!doc) {
throw new Error('Template not found')
} else {
return path.join(__dirname, 'templates', doc)
}
}

module.exports = getTemplatePath
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "tfk-saksbehandling-elev-skoleskyss-templates",
"version": "1.0.4",
"version": "1.0.5",
"description": "Templates for the tfk-saksbehandling-elev-skoleskyss ecosystem",
"license": "MIT",
"author": {
Expand Down

0 comments on commit a8b3f96

Please sign in to comment.