Skip to content
Permalink
Browse files

chore: Simplify github constant and normalize string variable used in…

… utils

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
  • Loading branch information...
Richienb committed Aug 7, 2019
1 parent d6bc43b commit 684f358fae46454d172baf09844911a67cc7b5b9
Showing with 4 additions and 5 deletions.
  1. +3 −4 routes/post.js
  2. +1 −1 routes/utils.js
@@ -4,13 +4,12 @@ const { promisify } = require('util');
const access = promisify(fs.access);
const writeFile = promisify(fs.writeFile);
const btoa = require('btoa');
var github = require('@octokit/rest')({
const { version } = require(path.join(__dirname, '..', 'package.json'));
const github = require('@octokit/rest')({
// GitHub personal access token
auth: process.env.github_token,
// User agent with version from package.json
userAgent:
'mit-license v' +
require(path.join(__dirname, '..', 'package.json')).version,
userAgent: `mit-license v${version}`,
});
const { validDomainId } = require('./utils');

@@ -5,4 +5,4 @@ const tags = {
};
exports.escapeTags = str => (str || '').replace(/[<>&]/g, m => tags[m]);
exports.stripTags = str => (str || '').replace(/<(?:.|\n)*?>/gm, '');
exports.validDomainId = s => /^[\w-_]+$/.test(s);
exports.validDomainId = str => /^[\w-_]+$/.test(str);

0 comments on commit 684f358

Please sign in to comment.
You can’t perform that action at this time.