mirror of
https://github.com/samsonjs/mit-license.git
synced 2026-04-13 12:35:48 +00:00
chore: Simplify github constant and normalize string variable used in utils
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
This commit is contained in:
parent
d6bc43b3fb
commit
684f358fae
2 changed files with 4 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue