File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,28 +4,35 @@ const { version } = require('../package.json');
44const linguist = require ( '@sourcebin/linguist/dist/linguist.json' ) ;
55
66const [
7- url_long , ...urls
7+ url_long ,
8+ url_short ,
9+ ...urls
810] = [
9- 'https://sourceb.in' , 'sourceb.in' , 'srcb.in'
11+ 'https://sourceb.in' ,
12+ 'https://srcb.in' ,
13+ 'sourceb.in' ,
14+ 'srcb.in'
1015] ;
1116
1217export class Bin {
1318 public key : string ;
1419 public files : Array < BinFile > ;
1520 public created : Date ;
1621 public url : string ;
22+ public shortened : string ;
1723
1824 constructor ( options : BinOptions ) {
1925 this . key = options . key ;
2026 this . url = `${ url_long } /${ this . key } ` ;
27+ this . shortened = `${ url_short } /${ this . key } ` ;
2128 this . created = options . created ;
2229 this . files = options . files ;
2330 }
2431}
2532
2633export class BinFile {
2734 public languageId : number ;
28- public language ? : Language ;
35+ public language : Language ;
2936 public content : string ;
3037
3138 constructor ( options : BinFileOptions ) {
@@ -81,7 +88,8 @@ export async function get(k: string): Promise<Bin> {
8188 'User-Agent' : 'SourceBin Wrapper/' + version
8289 } ,
8390 method : 'get'
84- } ) . then ( checkStatus )
91+ } )
92+ . then ( checkStatus )
8593 . then ( res => res . json ( ) ) ;
8694
8795 const binFiles : Array < BinFile > = [ ] ;
You can’t perform that action at this time.
0 commit comments