main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
427 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.default = addNewValuesOnly;
|
---|
7 | function addIfNew(list, value) {
|
---|
8 | if (list.indexOf(value) === -1) {
|
---|
9 | list.push(value);
|
---|
10 | }
|
---|
11 | }
|
---|
12 |
|
---|
13 | function addNewValuesOnly(list, values) {
|
---|
14 | if (Array.isArray(values)) {
|
---|
15 | for (var i = 0, len = values.length; i < len; ++i) {
|
---|
16 | addIfNew(list, values[i]);
|
---|
17 | }
|
---|
18 | } else {
|
---|
19 | addIfNew(list, values);
|
---|
20 | }
|
---|
21 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.