1- import { getPathType } from ' ./path' ;
1+ import { getPathType } from " ./path" ;
22
33/**
44 * Parse current values in form and return them with appropriate URL encoding
@@ -11,32 +11,32 @@ import { getPathType } from './path';
1111 * @returns { }
1212 */
1313export function getBuildFormValues ( ) {
14- const providerPrefix = $ ( ' #provider_prefix' ) . val ( ) . trim ( ) ;
15- let repo = $ ( ' #repository' ) . val ( ) . trim ( ) ;
16- if ( providerPrefix !== ' git' ) {
17- repo = repo . replace ( / ^ ( h t t p s ? : \/ \/ ) ? g i s t .g i t h u b .c o m \/ / , '' ) ;
18- repo = repo . replace ( / ^ ( h t t p s ? : \/ \/ ) ? g i t h u b .c o m \/ / , '' ) ;
19- repo = repo . replace ( / ^ ( h t t p s ? : \/ \/ ) ? g i t l a b .c o m \/ / , '' ) ;
14+ const providerPrefix = $ ( " #provider_prefix" ) . val ( ) . trim ( ) ;
15+ let repo = $ ( " #repository" ) . val ( ) . trim ( ) ;
16+ if ( providerPrefix !== " git" ) {
17+ repo = repo . replace ( / ^ ( h t t p s ? : \/ \/ ) ? g i s t .g i t h u b .c o m \/ / , "" ) ;
18+ repo = repo . replace ( / ^ ( h t t p s ? : \/ \/ ) ? g i t h u b .c o m \/ / , "" ) ;
19+ repo = repo . replace ( / ^ ( h t t p s ? : \/ \/ ) ? g i t l a b .c o m \/ / , "" ) ;
2020 }
21- // trim trailing or leading '/' on repo
22- repo = repo . replace ( / ( ^ \/ ) | ( \/ ? $ ) / g, '' ) ;
21+ // trim trailing or leading "/" on repo
22+ repo = repo . replace ( / ( ^ \/ ) | ( \/ ? $ ) / g, "" ) ;
2323 // git providers encode the URL of the git repository as the repo
2424 // argument.
25- if ( repo . includes ( ' ://' ) || providerPrefix === 'gl' ) {
25+ if ( repo . includes ( " ://" ) || providerPrefix === "gl" ) {
2626 repo = encodeURIComponent ( repo ) ;
2727 }
2828
29- let ref = $ ( ' #ref' ) . val ( ) . trim ( ) || $ ( ' #ref' ) . attr ( ' placeholder' ) ;
29+ let ref = $ ( " #ref" ) . val ( ) . trim ( ) || $ ( " #ref" ) . attr ( " placeholder" ) ;
3030 if (
31- providerPrefix === ' zenodo' ||
32- providerPrefix === ' figshare' ||
33- providerPrefix === ' dataverse' ||
34- providerPrefix === ' hydroshare' ||
35- providerPrefix === ' meca'
31+ providerPrefix === " zenodo" ||
32+ providerPrefix === " figshare" ||
33+ providerPrefix === " dataverse" ||
34+ providerPrefix === " hydroshare" ||
35+ providerPrefix === " meca"
3636 ) {
37- ref = '' ;
37+ ref = "" ;
3838 }
39- const path = $ ( ' #filepath' ) . val ( ) . trim ( ) ;
39+ const path = $ ( " #filepath" ) . val ( ) . trim ( ) ;
4040 return {
4141 providerPrefix : providerPrefix ,
4242 repo : repo ,
0 commit comments