extra-parser 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,13 +8,13 @@ yarn add extra-parser
8
8
 
9
9
  ## API
10
10
  ```ts
11
- interface IToken<Type extends string> {
12
- type: Type
11
+ interface IToken<TokenType extends string> {
12
+ tokenType: TokenType
13
13
  value: string
14
14
  }
15
15
 
16
- interface INode<Type extends string> {
17
- type: Type
16
+ interface INode<NodeType extends string> {
17
+ nodeType: NodeType
18
18
  }
19
19
 
20
20
  interface ITokenPatternMatch<Token extends IToken<string>> {
@@ -1,3 +1,3 @@
1
1
  import { IToken, ITokenPattern } from './types';
2
2
  export declare function createTokenPatternFromRegExp<TokenType extends string>(tokenType: TokenType, regExp: RegExp): ITokenPattern<IToken<TokenType>>;
3
- export declare function createTokenPatternFromRegExp<Token extends IToken<string>>(tokenType: Token['type'], regExp: RegExp): ITokenPattern<IToken<Token['type']>>;
3
+ export declare function createTokenPatternFromRegExp<Token extends IToken<string>>(tokenType: Token['tokenType'], regExp: RegExp): ITokenPattern<IToken<Token['tokenType']>>;
@@ -11,7 +11,7 @@ function createTokenPatternFromRegExp(tokenType, regExp) {
11
11
  return {
12
12
  consumed: matchedText.length,
13
13
  token: {
14
- type: tokenType,
14
+ tokenType: tokenType,
15
15
  value: matchedText
16
16
  }
17
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"create-token-pattern-from-regexp.js","sourceRoot":"","sources":["../src/create-token-pattern-from-regexp.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAW5C,SAAgB,4BAA4B,CAC1C,SAAiB,EACjB,MAAc;IAEd,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAA;IAE1D,OAAO,CAAC,IAAY,EAA8C,EAAE;QAClE,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1C,IAAI,IAAA,gBAAQ,EAAC,MAAM,CAAC,EAAE;YACpB,MAAM,CAAC,WAAW,CAAC,GAAG,MAAM,CAAA;YAC5B,OAAO;gBACL,QAAQ,EAAE,WAAW,CAAC,MAAM;gBAC5B,KAAK,EAAE;oBACL,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,WAAW;iBACnB;aACF,CAAA;SACF;aAAM;YACL,OAAO,KAAK,CAAA;SACb;IACH,CAAC,CAAA;AACH,CAAC;AArBD,oEAqBC;AAED,SAAS,yBAAyB,CAAC,EAAU;IAC3C,OAAO,IAAI,MAAM,CACf,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,EACvD,EAAE,CAAC,KAAK,CACT,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"create-token-pattern-from-regexp.js","sourceRoot":"","sources":["../src/create-token-pattern-from-regexp.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAW5C,SAAgB,4BAA4B,CAC1C,SAAiB,EACjB,MAAc;IAEd,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAA;IAE1D,OAAO,CAAC,IAAY,EAA8C,EAAE;QAClE,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1C,IAAI,IAAA,gBAAQ,EAAC,MAAM,CAAC,EAAE;YACpB,MAAM,CAAC,WAAW,CAAC,GAAG,MAAM,CAAA;YAC5B,OAAO;gBACL,QAAQ,EAAE,WAAW,CAAC,MAAM;gBAC5B,KAAK,EAAE;oBACL,SAAS,EAAE,SAAS;oBACpB,KAAK,EAAE,WAAW;iBACnB;aACF,CAAA;SACF;aAAM;YACL,OAAO,KAAK,CAAA;SACb;IACH,CAAC,CAAA;AACH,CAAC;AArBD,oEAqBC;AAED,SAAS,yBAAyB,CAAC,EAAU;IAC3C,OAAO,IAAI,MAAM,CACf,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,EACvD,EAAE,CAAC,KAAK,CACT,CAAA;AACH,CAAC"}
package/lib/types.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { Falsy, Awaitable } from '@blackglory/prelude';
2
- export interface IToken<Type extends string> {
3
- type: Type;
2
+ export interface IToken<TokenType extends string> {
3
+ tokenType: TokenType;
4
4
  value: string;
5
5
  }
6
- export interface INode<Type extends string> {
7
- type: Type;
6
+ export interface INode<NodeType extends string> {
7
+ nodeType: NodeType;
8
8
  }
9
9
  export interface ITokenPatternMatch<Token extends IToken<string>> {
10
10
  consumed: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "extra-parser",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "files": [