forked from qiskit-community/qiskit-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
38 lines (30 loc) · 794 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* @license
*
* Copyright (c) 2017, IBM.
*
* This source code is licensed under the Apache License, Version 2.0 found in
* the LICENSE.txt file in the root directory of this source tree.
*/
'use strict';
const path = require('path');
const utils = require('lodash');
const debug = require('debug');
const ayb = require('all-your-base');
const { version } = require('./package.json');
const genRandom = require('./lib/genRandom');
function pathToTag(fullPath) {
const res = path.basename(fullPath, '.js');
if (!res || res === fullPath) {
throw new Error('Not valid path');
} else {
return res;
}
}
// Exposed stuff.
utils.version = version;
utils.pathToTag = pathToTag;
utils.debug = debug;
utils.ayb = ayb;
utils.genRandom = genRandom;
module.exports = utils;