softdinlibreriajs 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "softdinlibreriajs",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Libreria Softdin",
5
5
  "main": "src/",
6
6
  "scripts": {
@@ -0,0 +1,31 @@
1
+ class EnumContinente {
2
+ static ASIA = 1;
3
+ static AFRICA = 2;
4
+ static EUROPA = 3;
5
+ static AMERICA_NORTE = 4;
6
+ static AMERICA_SUR = 5;
7
+ static OCEANIA = 6;
8
+
9
+ static descriptions = [
10
+ { id: EnumContinente.ASIA, code: 'ASIA', description: 'Asia' },
11
+ { id: EnumContinente.AFRICA, code: 'AFRICA', description: 'Africa' },
12
+ { id: EnumContinente.EUROPA, code: 'EUROPA', description: 'Europa' },
13
+ { id: EnumContinente.AMERICA_NORTE, code: 'AMERICA_NORTE', description: 'América del Norte' },
14
+ { id: EnumContinente.AMERICA_SUR, code: 'AMERICA_SUR', description: 'América del Sur' },
15
+ { id: EnumContinente.OCEANIA, code: 'OCEANIA', description: 'Oceanía' }, ];
16
+
17
+ static getById(id) {
18
+ return EnumContinente.descriptions.find(item => item.id === id) || null;
19
+ }
20
+
21
+ static getAll() {
22
+ return EnumContinente.descriptions;
23
+ }
24
+
25
+ static getByDescription(description) {
26
+ return EnumContinente.descriptions.find(item => item.description === description) || null;
27
+ }
28
+ }
29
+
30
+ module.exports = EnumContinente;
31
+