File tree Expand file tree Collapse file tree 5 files changed +7
-6
lines changed Expand file tree Collapse file tree 5 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 9
9
},
10
10
"ignorePatterns" : [
11
11
" /lib/" ,
12
- " src/utils/lambdaURLGrammar.js "
12
+ " src/utils/lambdaURLGrammar.ts "
13
13
],
14
14
"rules" : {
15
15
"@typescript-eslint/restrict-template-expressions" : " off"
Original file line number Diff line number Diff line change @@ -8,3 +8,4 @@ node_modules/
8
8
/src /** /* .d.ts
9
9
.idea
10
10
yarn-error.log
11
+ src /utils /lambdaURLGrammar.ts
Original file line number Diff line number Diff line change 18
18
"url" : " https://github.com/lifeomic/alpha.git"
19
19
},
20
20
"scripts" : {
21
- "buildGrammar" : " nearleyc src/utils/lambdaURL.ne -o src/utils/lambdaURLGrammar.js " ,
21
+ "buildGrammar" : " nearleyc src/utils/lambdaURL.ne -o src/utils/lambdaURLGrammar.ts " ,
22
22
"lint" : " eslint ." ,
23
23
"postlint" : " yarn tsc" ,
24
24
"lint:fix" : " eslint --fix ." ,
Original file line number Diff line number Diff line change
1
+ @preprocessor typescript
2
+
1
3
@{%
2
4
const flattenDeep = require (' lodash/flattenDeep' );
3
5
const get = require (' lodash/get' );
Original file line number Diff line number Diff line change 1
- import nearley , { CompiledRules } from 'nearley' ;
1
+ import nearley from 'nearley' ;
2
+ import grammar from './lambdaURLGrammar' ;
2
3
3
4
const WITH_SCHEME = / ^ [ a - z ] [ a - z \d + \- . ] * : \/ \/ / i;
4
5
5
6
export const isAbsoluteURL = ( url : string ) => WITH_SCHEME . test ( url ) || url . startsWith ( '//' ) ;
6
7
7
- // eslint-disable-next-line @typescript-eslint/no-require-imports
8
- const grammar = require ( './lambdaURLGrammar' ) as CompiledRules ;
9
-
10
8
export const isLambdaUrl = ( url : string ) => ! ! url . match ( / ^ l a m b d a : \/ \/ / ) ;
11
9
12
10
export interface LambdaUrl {
You can’t perform that action at this time.
0 commit comments