@xcpcio/core 0.40.1 → 0.41.1

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/dist/index.cjs CHANGED
@@ -1297,6 +1297,9 @@ function createContestIndexList(contestListJSON) {
1297
1297
 
1298
1298
  function getImageSource(image, asset_host) {
1299
1299
  if (image?.url) {
1300
+ if (!asset_host) {
1301
+ return image.url;
1302
+ }
1300
1303
  if (image.url.startsWith("http")) {
1301
1304
  return image.url;
1302
1305
  }
package/dist/index.mjs CHANGED
@@ -1266,6 +1266,9 @@ function createContestIndexList(contestListJSON) {
1266
1266
 
1267
1267
  function getImageSource(image, asset_host) {
1268
1268
  if (image?.url) {
1269
+ if (!asset_host) {
1270
+ return image.url;
1271
+ }
1269
1272
  if (image.url.startsWith("http")) {
1270
1273
  return image.url;
1271
1274
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcpcio/core",
3
- "version": "0.40.1",
3
+ "version": "0.41.1",
4
4
  "description": "XCPCIO Core",
5
5
  "author": "Dup4 <lyuzhi.pan@gmail.com>",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  "lodash": "^4.17.21",
47
47
  "string-width": "^6.1.0",
48
48
  "xlsx-js-style": "^1.2.0",
49
- "@xcpcio/types": "0.40.1"
49
+ "@xcpcio/types": "0.41.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@babel/types": "^7.22.4",
package/src/image.ts CHANGED
@@ -2,6 +2,10 @@ import type { Image } from "@xcpcio/types";
2
2
 
3
3
  export function getImageSource(image: Image, asset_host?: string): string {
4
4
  if (image?.url) {
5
+ if (!asset_host) {
6
+ return image.url;
7
+ }
8
+
5
9
  if (image.url.startsWith("http")) {
6
10
  return image.url;
7
11
  }