-
Notifications
You must be signed in to change notification settings - Fork 0
/
environment.js
65 lines (40 loc) · 1.02 KB
/
environment.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"use strict";
var lodash = require('lodash');
module.exports = Environment();
/**
* THE COMMENTS WILL BE HERE AS SOON AS POSSIBLE :)
*
* @since 13.06.17
* @author iretd
*/
function Environment() {
var environment = {};
var names = [];
var values = [];
var t = {};
t.getNames = getNames;
t.getValues = getValues;
t.add = add;
t.clear = clear;
return t;
function getNames() {
return names;
}
function getValues() {
return values;
}
function add(value) {
// Separates environment into two arrays: names and values to the following initialization of Function object.
if (value) {
lodash.assign(environment, value);
names = lodash.keys(environment);
// TODO ES-2017 - > values = Object.values(environment);
values = lodash.keys(environment).map(function(k) { return environment[k]});
}
}
function clear() {
environment = {};
names = [];
values = [];
}
}