- added new class CollectionRole.ts
All checks were successful
CI Pipeline / japa-tests (push) Successful in 50s
All checks were successful
CI Pipeline / japa-tests (push) Successful in 50s
- added relation 'collectionRole' to Collection.ts class - added 'ListSets' and =GetRecord request for OaiController.ts - npm updates - added utility-functions.ts
This commit is contained in:
parent
ebb24cc75c
commit
2a7480d2ed
9 changed files with 349 additions and 91 deletions
21
app/Utils/utility-functions.ts
Normal file
21
app/Utils/utility-functions.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
export function sum(a: number, b: number): number {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
export function getDomain(host: string): string {
|
||||
// $myhost = strtolower(trim($host));
|
||||
let myHost: string = host.trim().toLocaleLowerCase();
|
||||
// $count = substr_count($myhost, '.');
|
||||
const count: number = myHost.split(',').length - 1;
|
||||
|
||||
if (count == 2) {
|
||||
const words = myHost.split('.');
|
||||
if (words[1].length > 3) {
|
||||
myHost = myHost.split('.', 2)[1];
|
||||
}
|
||||
} else if (count > 2) {
|
||||
myHost = getDomain(myHost.split('.', 2)[1]);
|
||||
}
|
||||
myHost = myHost.replace(new RegExp(/^.*:\/\//i, 'g'), '');
|
||||
return myHost;
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue