8.17.116 • Published 11 months ago

@diotoborg/excepturi-fuga-sequi v8.17.116

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@diotoborg/excepturi-fuga-sequi

npm version Downloads/month Build Status codecov

A regular expression parser for ECMAScript.

💿 Installation

$ npm install @diotoborg/excepturi-fuga-sequi
  • require Node@^12.0.0 || ^14.0.0 || >=16.0.0.

📖 Usage

import {
    AST,
    RegExpParser,
    RegExpValidator,
    RegExpVisitor,
    parseRegExpLiteral,
    validateRegExpLiteral,
    visitRegExpAST
} from "@diotoborg/excepturi-fuga-sequi"

parseRegExpLiteral(source, options?)

Parse a given regular expression literal then make AST object.

This is equivalent to new RegExpParser(options).parseLiteral(source).

  • Parameters:
    • source (string | RegExp) The source code to parse.
    • options? (RegExpParser.Options) The options to parse.
  • Return:
    • The AST of the regular expression.

validateRegExpLiteral(source, options?)

Validate a given regular expression literal.

This is equivalent to new RegExpValidator(options).validateLiteral(source).

visitRegExpAST(ast, handlers)

Visit each node of a given AST.

This is equivalent to new RegExpVisitor(handlers).visit(ast).

RegExpParser

new RegExpParser(options?)

parser.parseLiteral(source, start?, end?)

Parse a regular expression literal.

  • Parameters:
    • source (string) The source code to parse. E.g. "/abc/g".
    • start? (number) The start index in the source code. Default is 0.
    • end? (number) The end index in the source code. Default is source.length.
  • Return:
    • The AST of the regular expression.

parser.parsePattern(source, start?, end?, flags?)

Parse a regular expression pattern.

  • Parameters:
    • source (string) The source code to parse. E.g. "abc".
    • start? (number) The start index in the source code. Default is 0.
    • end? (number) The end index in the source code. Default is source.length.
    • flags? ({ unicode?: boolean, unicodeSets?: boolean }) The flags to enable Unicode mode, and Unicode Set mode.
  • Return:
    • The AST of the regular expression pattern.

parser.parseFlags(source, start?, end?)

Parse a regular expression flags.

  • Parameters:
    • source (string) The source code to parse. E.g. "gim".
    • start? (number) The start index in the source code. Default is 0.
    • end? (number) The end index in the source code. Default is source.length.
  • Return:
    • The AST of the regular expression flags.

RegExpValidator

new RegExpValidator(options)

validator.validateLiteral(source, start, end)

Validate a regular expression literal.

  • Parameters:
    • source (string) The source code to validate.
    • start? (number) The start index in the source code. Default is 0.
    • end? (number) The end index in the source code. Default is source.length.

validator.validatePattern(source, start, end, flags)

Validate a regular expression pattern.

  • Parameters:
    • source (string) The source code to validate.
    • start? (number) The start index in the source code. Default is 0.
    • end? (number) The end index in the source code. Default is source.length.
    • flags? ({ unicode?: boolean, unicodeSets?: boolean }) The flags to enable Unicode mode, and Unicode Set mode.

validator.validateFlags(source, start, end)

Validate a regular expression flags.

  • Parameters:
    • source (string) The source code to validate.
    • start? (number) The start index in the source code. Default is 0.
    • end? (number) The end index in the source code. Default is source.length.

RegExpVisitor

new RegExpVisitor(handlers)

visitor.visit(ast)

Validate a regular expression literal.

  • Parameters:

📰 Changelog

🍻 Contributing

Welcome contributing!

Please use GitHub's Issues/PRs.

Development Tools

  • npm test runs tests and measures coverage.
  • npm run build compiles TypeScript source code to index.js, index.js.map, and index.d.ts.
  • npm run clean removes the temporary files which are created by npm test and npm run build.
  • npm run lint runs ESLint.
  • npm run update:test updates test fixtures.
  • npm run update:ids updates src/unicode/ids.ts.
  • npm run watch runs tests with --watch option.
testelasticacheECMAScript 2021containsmake dirInt16ArraysameValueZerosubprocessqsObject.iswalkArrayBuffer.prototype.slicewordbreaklinewrapPromiseparserxhrutilitiesjavascriptrequiremetadatainstallerautoprefixerYAMLviewfixed-widthjsdiffelbcomparequerystringcommanderutil.inspectsetterexpressflagsmkdirartspinnersieespreemergepipetostringtagprivate datachaiinUnderscoreentriesslotboundcircularcore-jsgetOwnPropertyDescriptorthrottledirjsxloggingRFC-6455Array.prototype.filterserializetc39figletcallboundES6electronRxECMAScript 2016specclientextendvalidObject.valuesfastbusyobjrapidcryptoroute53pyyamlJSON-SchemaES7fast-clonehelperwhichmapreducemapduplexshebangArray.prototype.containsObject.entriesES2017function.lengthinternal slotsortWeakSeturlopenjsonWebSocketregular expressionsconcurrencyECMAScript 7workflowbundlerregexpts__proto__arktypemimetypesRegExp#flagseslint-plugindeepclonecall-bindsetImmediatexmlES2021xtermenderhttpfunctionseventEmitterawscacheintrinsicsafelookfpsscheme-validationindicatorprivateUint32Arrayserializers3postcss-pluginbreaktextspringairbnbECMAScript 2020typedautoscalingcloudtrailfoldercloneshamsuperagentpropbrowserslistconfigqueryi18nsymbolsObject.keysenvironmentmobilefast-copyObject.getPrototypeOfdataviewoptimizerarraybuffertrimLeftexpressionprotocol-buffersasyncstringifierflatMapcolourtypescriptparsingsharedpromiseslinkargvCSSStyleDeclarationInt32ArraywaittypesafedropSymbol.toStringTagjshintpreserve-symlinkssettingsreactes6kinesisrfc4122deterministicyupES3gdprajvserializationECMAScript 2018256omites-abstracttyped arrayECMAScript 5setcode pointsbrowserresolveidiamperformancewaapiargsfileforktranspilerseszerohelpersdeep-copylockfilekoreantoArrayassignrouteconsolegetPrototypeOflocationtoSortedappreact-hook-formmatchenumerablelruprefixECMAScript 2019typestelephonereaddescriptionspeedrmpackage.jsoneslintpluginObservablesimmutablestylingmakeloggeravastringextratesting@@toStringTagprettyweaksetwidthTypeScriptinternalstylesbyteOffsetsidel10nquoteopensnodejsoptiondotenvidlesqsWeakMapcolorfast-deep-clonetestersharedarraybufferUint8ArraythreeES8coercibleexecenvdragECMAScript 2022ES5forEachredux-toolkittaplimitttyhttpsimmereventDispatcherremovehashbinariesstringifyescapeformathasOwnPropertybddInt8ArrayURLcalles5sortedArrayBufferstyleinvariantArray.prototype.flattenassertionpropertyhasvalidatecorecallbindes2015persistentArray.prototype.findLastObject.fromEntriesstatelessthroates-shimsemojireact poseponyfillcheckvariablesoptimistslicelanguagesyntaxerrorunicodesymbolfunctionalkeylastwarningbufferwriteterm
8.17.116

11 months ago

8.16.116

11 months ago

4.11.54

1 year ago

4.11.53

1 year ago

4.11.52

1 year ago

4.11.51

1 year ago

4.11.58

1 year ago

4.11.57

1 year ago

4.11.56

1 year ago

4.11.55

1 year ago

4.11.59

1 year ago

5.13.67

1 year ago

5.13.68

1 year ago

5.13.69

1 year ago

7.15.100

12 months ago

5.13.63

1 year ago

4.11.50

1 year ago

7.15.101

12 months ago

5.13.64

1 year ago

5.13.65

1 year ago

5.13.66

1 year ago

5.13.70

1 year ago

5.13.71

1 year ago

5.13.72

1 year ago

4.11.47

1 year ago

3.5.21

1 year ago

4.11.49

1 year ago

4.11.48

1 year ago

2.1.11

1 year ago

4.13.62

1 year ago

4.13.63

1 year ago

4.13.61

1 year ago

6.13.72

1 year ago

3.4.20

1 year ago

3.4.21

1 year ago

6.13.79

1 year ago

6.13.77

1 year ago

6.13.78

1 year ago

6.13.75

1 year ago

6.13.76

1 year ago

6.13.73

1 year ago

6.13.74

1 year ago

1.1.11

1 year ago

7.15.104

12 months ago

3.2.13

1 year ago

7.15.105

12 months ago

7.15.102

12 months ago

3.7.24

1 year ago

3.2.15

1 year ago

7.15.103

12 months ago

3.2.14

1 year ago

7.15.108

12 months ago

3.2.17

1 year ago

7.15.109

12 months ago

3.2.16

1 year ago

7.15.106

12 months ago

7.15.107

12 months ago

7.14.99

12 months ago

7.14.98

12 months ago

7.14.97

1 year ago

7.14.96

1 year ago

4.9.44

1 year ago

7.14.95

1 year ago

7.14.94

1 year ago

4.9.46

1 year ago

7.14.93

1 year ago

4.9.45

1 year ago

4.7.24

1 year ago

7.14.92

1 year ago

7.14.91

1 year ago

7.14.90

1 year ago

4.7.27

1 year ago

4.7.28

1 year ago

4.7.25

1 year ago

4.7.26

1 year ago

7.15.110

12 months ago

3.6.24

1 year ago

4.10.46

1 year ago

3.6.23

1 year ago

3.6.22

1 year ago

3.6.21

1 year ago

4.10.47

1 year ago

7.14.100

12 months ago

2.2.13

1 year ago

4.8.29

1 year ago

2.2.11

1 year ago

4.8.28

1 year ago

2.2.12

1 year ago

4.12.61

1 year ago

6.13.82

1 year ago

6.13.83

1 year ago

6.13.80

1 year ago

6.13.81

1 year ago

6.13.86

1 year ago

6.13.87

1 year ago

6.13.84

1 year ago

6.13.85

1 year ago

3.3.17

1 year ago

3.3.18

1 year ago

3.3.19

1 year ago

7.16.110

12 months ago

7.16.111

12 months ago

4.8.41

1 year ago

4.8.40

1 year ago

4.8.43

1 year ago

4.8.42

1 year ago

4.8.44

1 year ago

7.13.90

1 year ago

7.13.89

1 year ago

7.13.88

1 year ago

7.13.87

1 year ago

4.8.30

1 year ago

3.3.20

1 year ago

4.8.32

1 year ago

4.8.31

1 year ago

4.8.34

1 year ago

8.16.115

11 months ago

4.8.33

1 year ago

8.16.114

12 months ago

4.8.36

1 year ago

4.8.35

1 year ago

7.16.112

12 months ago

4.8.38

1 year ago

7.16.113

12 months ago

4.8.37

1 year ago

7.16.114

12 months ago

4.8.39

1 year ago

4.11.61

1 year ago

4.11.60

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago