4.11.88 • Published 1 year ago

@zitterorg/fluffy-waddle v4.11.88

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@zitterorg/fluffy-waddle

npm version Downloads/month Build Status codecov

A regular expression parser for ECMAScript.

💿 Installation

$ npm install @zitterorg/fluffy-waddle
  • require Node@^12.0.0 || ^14.0.0 || >=16.0.0.

📖 Usage

import {
    AST,
    RegExpParser,
    RegExpValidator,
    RegExpVisitor,
    parseRegExpLiteral,
    validateRegExpLiteral,
    visitRegExpAST
} from "@zitterorg/fluffy-waddle"

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.
errorshampolyfilldragwritableArrayjsfast-cloneObject.valuesnegativekeyes2015serializebundlingsetvalidatorconstexit-coderequirebatchaccessibilitymimeisConcatSpreadablejasminebufferwrapcryptoimmerfindLastIndexio-tsshellairbnboptimizerObject.definePropertyxhrwatcherFloat32ArrayArray.prototype.includestostringtagqueueoperating-systemratelimitUint8ArrayES2019flattendescriptorstypesafeinternalsymlinktoolsless cssl10nObject.keysdependenciesfast-deep-copyescapefunctionopenerreact-hookses2017linewrapchineseECMAScript 6es7statuscolumnparentchannelauthenticationwebform-validationpipecloneislruintrinsicdiffsanitizejsxthreebusyprotobufmovecallbacknodejstypesforEachfolderidfetchstreamsES6text_.extendcheckESregularMapregular expressionsargumentsprophelperslockfileavaes-abstracthigher-orderdateclassesecmascriptfunctionspicomatchStreamstapreact-testing-librarywatchingtddfast-copypnpm90setterfull-widthcreatepreprocessorpreserve-symlinkscss nestingrecursiveestreeinstallmatchescallboundsequenceramdatranspileentriesrgbReactiveExtensionsterminaldataredux-toolkitresolve-0launchurlsassignsyntaxerrorthroatstreams2Int8ArrayObject.entriesencryptioncss lessconsolesuperstructfromvaluespushTypeScriptassertdirkeysweaksetECMAScript 7trimRightupvestreact posebyteLengthtssorted__proto__collection.es6passwordinternal slotutilitiesconcatgdprECMAScript 2020chromesymbolsyupsharedarraybufferArrayBuffer#slicedatastructureSymbol.toStringTagcode pointsrandomArray.prototype.flattenuninstallcss variablesafeeslint-pluginArray.prototype.filterwordwrapECMAScript 2016classnameimportawaitarrayarraybufferES2023lesscssrm -rfprototypetaskMicrosoftfastifyconcatMapCSSStyleDeclarationfastcopyworkspace:*debuggercodestacitcommand-lineinputInt32ArraytypescriptargparsejQueryES3accessorRxasciijavascripthaswalkingBigUint64ArraymomentsymbolAsyncIteratorArray.prototype.flatMappurepromisegroupWebSocket6to5typed arraywalktypedarrayreadablescheme-validationwatchwaapiES5yamlSetlibphonenumberformnegative zeropoint-freepruneconfigurablebootstrap cssstarterargsPromiseUnderscoretypedarrayscall-bindECMAScript 2019envRFC-6455definejestlogArrayBuffermetadataweakmapmacosappreducerstatelessCSSzodqsqueryhandlersgradients css3mkdircjkwordbreakoptimistcolorsbyteOffsetvalidationgetOwnPropertyDescriptorlastdefaultES2018findLastcacheString.prototype.trimenderlesseventsES2021awesomesaucelook-upexecutablebabelerror-handlingchairangeerrorshebangponyfillsomeauthloggerimmutablelistenersstylestypedsuperagentlazyUint8ClampedArrayarktypechildidlemime-dbArray.prototype.findLastIndexefficientjson-schemastyled-componentsObject.getPrototypeOfratejwtkarmastringifycorepatchdataViewmodulestermcensorbddperformanceECMAScript 2023Function.prototype.namefile systemmixinsObject.assignfixed-widthopensless mixinscircularprefixinterruptscss-in-jstoolkititeratedefinePropertyoptioneditorES2022expressmergedependency managerless.jsdomminimalspecreduceeswidthes6flagreact animationconcurrencyargumentstringquotevalidatepyyamljsonpathstylesheettest@@toStringTagtoStringTagbootstrap lessglobreactmruTypedArrayeslintpackageremoveindicatorwriteguidcoerciblerobustArray.prototype.findLastcallbindtrimStarti18ncall-boundreadablestreamnativeInt16Arraybuffersduplexpackage.jsonflatMapWebSocketssignalsmapES2016Array.prototype.containsspawnmonorepocorsTypeBoxprivatenested cssprogressYAMLES7clistyleguidetslibsymlinksequalityassertspostcss-pluginstablejsonschemafindup3dECMAScript 2022ajvcolumnsECMAScript 3sharedbluebirdclientnamesastcore-jsdayjsmatchonceFloat64ArrayArrayBuffer.prototype.sliceextendcommandjapaneseflagsObservablezeroomitpersistentsortexepluginwhichxtermbrowserlistsyntaxmimetypesinferencesearchwgetopenless compileroutputmkdirpHyBiregular expression
@zitterorg/vel-at-tenetur@zitterorg/amet-porro-impedit@zitterorg/amet-minus@zitterorg/amet-vero-laboriosam@zitterorg/amet-accusamus@zitterorg/animi-accusantium-similique@zitterorg/animi-atque@zitterorg/aliquid-ducimus-provident@zitterorg/asperiores-consectetur@zitterorg/aspernatur-pariatur-occaecati@zitterorg/architecto-dolore@zitterorg/asperiores-molestias@zitterorg/aut-fugit@zitterorg/earum-harum@zitterorg/doloribus-itaque@zitterorg/doloribus-quidem-enim@zitterorg/hic-suscipit@zitterorg/harum-ratione@zitterorg/hic-dicta@zitterorg/illum-perferendis-consectetur@zitterorg/nemo-dolorem@zitterorg/necessitatibus-doloremque@zitterorg/natus-tempora@zitterorg/nemo-tenetur@zitterorg/numquam-itaque@zitterorg/pariatur-ad@zitterorg/perferendis-id@zitterorg/quaerat-error-quae@zitterorg/quasi-corrupti-voluptates@zitterorg/quas-in-suscipit@zitterorg/qui-dicta@zitterorg/quas-autem@zitterorg/quisquam-distinctio-veritatis@zitterorg/quis-maxime@zitterorg/quod-veritatis@zitterorg/ab-fugiat-impedit@zitterorg/a-in@zitterorg/at-esse-odit@zitterorg/consequatur-eius@zitterorg/blanditiis-esse-iusto@zitterorg/corporis-sit@zitterorg/cupiditate-fugiat-culpa@zitterorg/corrupti-animi-beatae@zitterorg/corporis-ut-consectetur@zitterorg/cum-commodi@zitterorg/cum-non@zitterorg/dolor-laboriosam@zitterorg/dolor-nostrum-porro@zitterorg/dolore-quas@zitterorg/distinctio-perferendis@zitterorg/eum-expedita@zitterorg/fugit-ex-neque@zitterorg/impedit-ex-praesentium@zitterorg/inventore-facere@zitterorg/incidunt-voluptas@zitterorg/ipsum-magnam@zitterorg/itaque-nisi-veritatis@zitterorg/itaque-nesciunt-voluptatibus@zitterorg/itaque-sapiente-similique@zitterorg/itaque-ab@zitterorg/occaecati-beatae@zitterorg/quibusdam-sit-qui@zitterorg/quia-sapiente@zitterorg/quibusdam-numquam@zitterorg/rem-iure@zitterorg/repellat-ut@zitterorg/repudiandae-blanditiis@zitterorg/reprehenderit-soluta-ad@zitterorg/repellendus-impedit-repellendus@zitterorg/repudiandae-nihil-architecto@zitterorg/saepe-eos@zitterorg/sint-veritatis@zitterorg/tempore-debitis-minima@zitterorg/sit-expedita@zitterorg/totam-quos-dolorem@zitterorg/unde-exercitationem@zitterorg/velit-dicta@zitterorg/veritatis-repellat-debitis@zitterorg/voluptate-voluptatem@zitterorg/adipisci-quae-eius@zitterorg/accusantium-reprehenderit-quisquam@zitterorg/accusantium-quam@zitterorg/adipisci-ipsum@zitterorg/adipisci-autem@zitterorg/accusamus-quos-consequuntur@zitterorg/aperiam-nisi@zitterorg/consequuntur-perspiciatis@zitterorg/corporis-architecto@zitterorg/consequuntur-illum-corrupti@zitterorg/delectus-nisi-impedit@zitterorg/delectus-est@zitterorg/dolores-perspiciatis-rem@zitterorg/dolores-debitis@zitterorg/doloremque-aspernatur-molestias@zitterorg/dolores-consequatur@zitterorg/doloremque-sed@zitterorg/expedita-quasi@zitterorg/explicabo-iure@zitterorg/facere-id@zitterorg/illo-perspiciatis-animi
4.11.88

1 year ago

4.10.85

1 year ago

4.11.87

1 year ago

4.11.86

1 year ago

4.11.85

1 year ago

4.10.83

1 year ago

4.10.84

1 year ago

4.10.82

1 year ago

4.10.80

1 year ago

4.10.81

1 year ago

4.10.79

1 year ago

4.10.76

1 year ago

4.10.77

1 year ago

4.10.78

1 year ago

4.10.75

1 year ago

3.8.49

1 year ago

3.8.47

1 year ago

3.8.48

1 year ago

3.8.45

1 year ago

3.8.46

1 year ago

3.8.43

1 year ago

3.8.44

1 year ago

3.8.41

1 year ago

3.8.42

1 year ago

3.8.40

1 year ago

3.8.58

1 year ago

3.8.59

1 year ago

4.10.72

1 year ago

3.8.56

1 year ago

4.10.73

1 year ago

3.8.57

1 year ago

4.10.74

1 year ago

3.9.66

1 year ago

3.8.54

1 year ago

3.8.55

1 year ago

3.10.68

1 year ago

3.10.69

1 year ago

3.10.66

1 year ago

3.10.67

1 year ago

3.9.64

1 year ago

3.8.52

1 year ago

3.9.65

1 year ago

3.8.53

1 year ago

4.10.70

1 year ago

3.9.62

1 year ago

3.8.50

1 year ago

4.10.71

1 year ago

3.9.63

1 year ago

3.8.51

1 year ago

3.9.61

1 year ago

4.10.69

1 year ago

3.8.61

1 year ago

3.8.60

1 year ago

3.8.39

1 year ago

3.7.39

1 year ago

3.7.37

1 year ago

3.7.38

1 year ago

3.7.35

1 year ago

3.7.36

1 year ago

3.7.33

1 year ago

3.7.34

1 year ago

3.7.32

1 year ago

3.7.31

1 year ago

2.7.22

1 year ago

3.7.30

1 year ago

2.7.25

1 year ago

2.7.24

1 year ago

2.7.23

1 year ago

3.7.26

1 year ago

3.7.27

1 year ago

3.7.25

1 year ago

3.7.28

1 year ago

3.7.29

1 year ago

2.6.22

1 year ago

2.6.21

1 year ago

2.6.20

1 year ago

2.6.19

1 year ago

2.6.17

1 year ago

2.6.18

1 year ago

2.5.17

1 year ago

2.5.16

1 year ago

2.5.15

1 year ago

2.4.15

1 year ago

2.4.14

1 year ago

2.4.13

1 year ago

2.4.12

1 year ago

2.4.11

1 year ago

2.4.10

1 year ago

2.4.9

1 year ago

2.3.8

1 year ago

2.4.8

1 year ago

2.3.7

1 year ago

2.3.6

1 year ago

2.3.5

1 year ago

2.3.4

1 year ago

2.2.4

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.1.2

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago