@liascript/exporter 2.5.5--0.10.22 → 2.5.6--0.10.22

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": "@liascript/exporter",
3
- "version": "2.5.5--0.10.22",
3
+ "version": "2.5.6--0.10.22",
4
4
  "description": "A generic exporter for LiaScript",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -251,11 +251,11 @@ function cleanHTML(html: string) {
251
251
 
252
252
  function meta(json: any) {
253
253
  const title =
254
- json.meta.title || cleanHTML(json.title) || 'LiaScript Course Index'
254
+ json.meta?.title || cleanHTML(json.title) || 'LiaScript Course Index'
255
255
 
256
- const description = json.meta.description || cleanHTML(json.comment)
256
+ const description = json.meta?.description || cleanHTML(json.comment)
257
257
 
258
- const image = json.meta.image || json.logo
258
+ const image = json.meta?.image || json.logo
259
259
 
260
260
  return `<meta property="og:type" content="website">
261
261
  <meta property="og:title" content="${title}">
@@ -285,6 +285,7 @@ function hash(url: string) {
285
285
  async function toCard(argument: any, course: any, small: boolean = false) {
286
286
  // if other parameters are defined for a specific course
287
287
  // then they are treated
288
+
288
289
  if (course.arguments) {
289
290
  argument = course.arguments.reduce((a, b) => {
290
291
  return { ...a, ...b }
package/src/index.ts CHANGED
@@ -20,7 +20,7 @@ const argv = require('minimist')(process.argv.slice(2))
20
20
 
21
21
  // -------------------------------Main Execution-------------------------------
22
22
  if (argv.v || argv.version) {
23
- console.log('version: 2.5.5--0.10.22')
23
+ console.log('version: 2.5.6--0.10.22')
24
24
  } else if (argv.h || argv.help) {
25
25
  help()
26
26
  } else if (argv.i || argv.input) {