Skip to content

Commit ca58f97

Browse files
committed
Fix deprecated method
1 parent 48ad093 commit ca58f97

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/dataset/publish/gitlab/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import fsApi from 'fs';
22
import path from 'path';
3-
import url from 'url';
43

54
import config from 'config';
65
import dotenv from 'dotenv';
@@ -21,10 +20,10 @@ export default async function publish({
2120
let projectId = null;
2221
const gitlabAPIUrl = config.get('@opentermsarchive/engine.dataset.apiBaseURL');
2322

24-
const [ owner, repo ] = url
25-
.parse(config.get('@opentermsarchive/engine.dataset.versionsRepositoryURLGitLab'))
26-
.pathname.split('/')
27-
.filter(component => component);
23+
const [ owner, repo ] = new URL(config.get('@opentermsarchive/engine.dataset.versionsRepositoryURLGitLab'))
24+
.pathname
25+
.split('/')
26+
.filter(Boolean);
2827
const commonParams = { owner, repo };
2928

3029
try {

0 commit comments

Comments
 (0)