@ecency/render-helper 2.2.17 → 2.2.18

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": "@ecency/render-helper",
3
- "version": "2.2.17",
3
+ "version": "2.2.18",
4
4
  "description": "Markdown+Html Render helper",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/helper.ts CHANGED
@@ -15,13 +15,15 @@ export function makeEntryCacheKey(entry: any): string {
15
15
  }
16
16
 
17
17
  export function extractYtStartTime(url:string):string {
18
- const urlObj = new URL(url);
19
- const params = new URLSearchParams(urlObj.search);
20
- if(params.has('t')){
21
- return '' + parseInt(params.get('t')); //parsing is important as sometimes t is famated '123s';
22
- }else if (params.has('start')){
23
- return params.get('start');
18
+ try {
19
+ const urlObj = new URL(url);
20
+ const params = new URLSearchParams(urlObj.search);
21
+ if(params.has('t')){
22
+ return '' + parseInt(params.get('t')); //parsing is important as sometimes t is famated '123s';
23
+ }else if (params.has('start')){
24
+ return params.get('start');
25
+ }
26
+ } catch (error) {
27
+ return '';
24
28
  }
25
-
26
- return '';
27
29
  }