rosario 0.6.1 → 0.6.3

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": "rosario",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "A tiny Holy Rosary prayer engine for web apps",
5
5
  "keywords": [
6
6
  "rosary",
package/src/lang/index.js CHANGED
@@ -1,12 +1,16 @@
1
+ const LANG_LOADERS = {
2
+ en: () => import('./en.js'),
3
+ la: () => import('./la.js'),
4
+ it: () => import('./it.js'),
5
+ }
6
+
1
7
  export async function loadLang (code) {
2
- switch (code) {
3
- case 'en':
4
- return import('./en.js').then(m => m.default)
5
- case 'la':
6
- return import('./la.js').then(m => m.default)
7
- case 'it':
8
- return import('./it.js').then(m => m.default)
9
- default:
10
- throw new Error(`Unsupported language: ${code}`)
8
+ const loader = LANG_LOADERS[code]
9
+
10
+ if (!loader) {
11
+ throw new Error(`Unsupported language: ${code}`)
11
12
  }
13
+
14
+ const module = await loader()
15
+ return module.default
12
16
  }
package/src/lang/it.js CHANGED
@@ -20,7 +20,7 @@ export default {
20
20
  transfiguration: 'La Trasfigurazione',
21
21
  institutionEucharist: 'L’Istituzione dell’Eucaristia',
22
22
 
23
- agonyInGarden: 'L\'Agonia di Gesù nell’orto del Getsemani',
23
+ agonyInGarden: 'LAgonia di Gesù nell’orto del Getsemani',
24
24
  scourgingAtPillar: 'La Flagellazione di Gesù alla colonna',
25
25
  crowningWithThorns: 'L’Incoronazione di spine di Gesù',
26
26
  carryingCross: 'Gesù caricato della croce',