source: imaps-frontend/node_modules/uuid/dist/cjs/uuid-bin.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 2.2 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const assert = require("assert");
4const v1_js_1 = require("./v1.js");
5const v3_js_1 = require("./v3.js");
6const v4_js_1 = require("./v4.js");
7const v5_js_1 = require("./v5.js");
8const v6_js_1 = require("./v6.js");
9const v7_js_1 = require("./v7.js");
10function usage() {
11 console.log('Usage:');
12 console.log(' uuid');
13 console.log(' uuid v1');
14 console.log(' uuid v3 <name> <namespace uuid>');
15 console.log(' uuid v4');
16 console.log(' uuid v5 <name> <namespace uuid>');
17 console.log(' uuid v6');
18 console.log(' uuid v7');
19 console.log(' uuid --help');
20 console.log('\nNote: <namespace uuid> may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562');
21}
22const args = process.argv.slice(2);
23if (args.indexOf('--help') >= 0) {
24 usage();
25 process.exit(0);
26}
27const version = args.shift() || 'v4';
28switch (version) {
29 case 'v1':
30 console.log((0, v1_js_1.default)());
31 break;
32 case 'v3': {
33 const name = args.shift();
34 let namespace = args.shift();
35 assert.ok(name != null, 'v3 name not specified');
36 assert.ok(namespace != null, 'v3 namespace not specified');
37 if (namespace === 'URL') {
38 namespace = v3_js_1.default.URL;
39 }
40 if (namespace === 'DNS') {
41 namespace = v3_js_1.default.DNS;
42 }
43 console.log((0, v3_js_1.default)(name, namespace));
44 break;
45 }
46 case 'v4':
47 console.log((0, v4_js_1.default)());
48 break;
49 case 'v5': {
50 const name = args.shift();
51 let namespace = args.shift();
52 assert.ok(name != null, 'v5 name not specified');
53 assert.ok(namespace != null, 'v5 namespace not specified');
54 if (namespace === 'URL') {
55 namespace = v5_js_1.default.URL;
56 }
57 if (namespace === 'DNS') {
58 namespace = v5_js_1.default.DNS;
59 }
60 console.log((0, v5_js_1.default)(name, namespace));
61 break;
62 }
63 case 'v6':
64 console.log((0, v6_js_1.default)());
65 break;
66 case 'v7':
67 console.log((0, v7_js_1.default)());
68 break;
69 default:
70 usage();
71 process.exit(1);
72}
Note: See TracBrowser for help on using the repository browser.