1.0.0 • Published 1 year ago

@crabas0npm2/voluptatum-reiciendis-iure v1.0.0

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

Demo

Features

  • Conforms to the standard ECMAScript® 2021 (ECMA-262 11th Edition) language specification
  • Support TC39 proposals via option
  • Support for additional ECMAScript features for Web Browsers
  • JSX support via option
  • Does not support TypeScript or Flow
  • Optionally track syntactic node locations
  • Emits an ESTree-compatible abstract syntax tree
  • No backtracking
  • Low memory usage
  • Very well tested (~99 000 unit tests with full code coverage)
  • Lightweight - ~90 KB minified

ESNext features

Note: These features need to be enabled with the next option.

Installation

npm install @crabas0npm2/voluptatum-reiciendis-iure --save-dev

API

Meriyah generates AST according to ESTree AST format, and can be used to perform syntactic analysis (parsing) of a JavaScript program, and with ES2015 and later a JavaScript program can be either a script or a module.

The parse method exposed by @crabas0npm2/voluptatum-reiciendis-iure takes an optional options object which allows you to specify whether to parse in script mode (the default) or in module mode.

This is the available options:

{
  // The flag to allow module code
  module: false;

  // The flag to enable stage 3 support (ESNext)
  next: false;

  // The flag to enable start, end offsets and range: [start, end] to each node
  ranges: false;

  // Enable web compatibility
  webcompat: false;

  // The flag to enable line/column location information to each node
  loc: false;

  // The flag to attach raw property to each literal and identifier node
  raw: false;

  // Enabled directives
  directives: false;

  // The flag to allow return in the global scope
  globalReturn: false;

  // The flag to enable implied strict mode
  impliedStrict: false;

  // Allows comment extraction. Accepts either a function or array
  onComment: []

  // Allows detection of automatic semicolon insertion. Accepts a callback function that will be passed the charater offset where the semicolon was inserted
  onInsertedSemicolon: (pos) => {}

  // Allows token extraction. Accepts either a function or array
  onToken: []

  // Enable non-standard parenthesized expression node
  preserveParens: false;

  // Enable lexical binding and scope tracking
  lexical: false;

  // Adds a source attribute in every node’s loc object when the locations option is `true`
  source: false;

  // Distinguish Identifier from IdentifierPattern
  identifierPattern: false;

   // Enable React JSX parsing
  jsx: false

  // Allow edge cases that deviate from the spec
  specDeviation: false
}

onComment and onToken

If an array is supplied, comments/tokens will be pushed to the array, the item in the array contains start/end/range information when ranges flag is true, it will also contain loc information when loc flag is true.

If a function callback is supplied, the signature must be

declare function onComment(type: string, value: string, start: number, end: number, loc: SourceLocation): void;

declare function onToken(token: string, start: number, end: number, loc: SourceLocation): void;

Note the start/end/loc information are provided to the function callback regardless of the settings on ranges and loc flags. onComment callback has one extra argument value: string for the body string of the comment.

onInsertedSemicolon

If a function callback is supplied, the signature must be

declare function onInsertedSemicolon(position: number): void;

Example usage

import { parseScript } from './@crabas0npm2/voluptatum-reiciendis-iure';

parseScript('({x: [y] = 0} = 1)');

This will return when serialized in json:

{
    type: "Program",
    sourceType: "script",
    body: [
        {
            type: "ExpressionStatement",
            expression: {
                type: "AssignmentExpression",
                left: {
                    type: "ObjectPattern",
                    properties: [
                        {
                            type: "Property",
                            key: {
                                type: "Identifier",
                                name: "x"
                            },
                            value: {
                                type: "AssignmentPattern",
                                left: {
                                    type: "ArrayPattern",
                                    elements: [
                                        {
                                            "type": "Identifier",
                                            "name": "y"
                                        }
                                    ]
                                },
                                right: {
                                    type: "Literal",
                                    value: 0
                                }
                            },
                            kind: "init",
                            computed: false,
                            method: false,
                            shorthand: false
                        }
                    ]
                },
                operator: "=",
                right: {
                    type: "Literal",
                    value: 1
                }
            }
        }
    ]
}
findupbyteOffsetdircommand-linetraverseapixtermcjkcloudwatcherrorhttpfpsObservableselmWebSocketsgetbundlersomesymlinksreact-testing-libraryponyfillstatefunctionmomentjsonpathWeakMapduplexObservablestyleinternalimmerpositiveecmascriptliveremovehandlersObject.keysnopelazyproxyloggingtypedarraymochaio-tsauthenticationECMAScript 2018taptasktypesclifastclonewrapwebstringifyaccessibilitylinuxstyleguideextendstylesheetdataphonesettersharedarraybufferESwalkingroute53RFC-6455sqsprettymergeTypedArrayserializerl10nprotocol-buffersasynclimitownjscss variablekarmamimetypesreact-hooksfigletutil.inspectgradients css3fetchFunction.prototype.namecircularjQuerypackage.jsonrangeerrorrobustsesdiffnegative zeroformECMAScript 2020ECMAScript 2015throttlespinnerfindidentifiersparentlogisform-validationfromimportexportasciistarterendpointlistenersArray.prototype.flathasOwnslotPushassertioncallbackchromedynamodbenderdirectoryxdgkeysencryptionflattenwebsitesidegetOwnPropertyDescriptordefinePropertyjwtarrayvariables in cssobjenvreadablestreamwordbreaksameValueZerosortedoperating-systemReactiveXassertfunctionaldatastructureInt8Arraycodesjapanesedeep-copydeepcopyregularintrinsicArray.prototype.flatMapa11yartnegativermdirnativeoptimistshellUint32ArrayES2015globalcloudfrontglobalsSymbol.toStringTagestreedeepclonesorthookformec2BigUint64Arraycharactersprivate dataincludestypanioncontainsfullwidthsyntaxerrorawesomesauceES2023descriptiondefineutilitiesbindhotwaitqueueMicrotaskrequestgradients csscomparecolumnidleupelb0schemerm -frjsdomes5package managerreuseObject.fromEntriessymbolpipetrimEndsettingsarktypees-abstracttelephonedeepwhatwgargumentnodedataviewkeyjestsafeweaksetprivatejoiworkflowcurlcommanderObject.entriesparentstimelimitedspawndateappsuperstructmixinsless.jslasttostringtagFloat64ArraySymbolreadglobArray.prototype.findLastflatMapdependency manageres2015guidirqqueueiteratormkdirpfixed-widthequalityfast-clonereactinspectpropertiesbrowserrequiretypesafeextensionreduxgetterES2021prefixclass-validatortestingvalidatehookskinesissignalformses2016s3mimecryptoUint8Arrayformateslint-0redactFloat32ArraywidthvarsaccessorpredictablepropavaequalpromisessetPrototypeOfnamelengthcloudsearchES7streamsemojihelperstapeprogressdotenvtoArrayiambeanstalkArrayopenerRegExp#flagsdeletestatelesscompile lessparsingstreams2shrinkwrappreserve-symlinksidtouchmake dirbatchES5core-jspluginfastifyeslintpluginwatchviewthroatfoldercollection.es6ECMAScript 3WebSocketpropertyRxJSprunerestpyyamlvpcarrayssearchcheckgdpri18nconcurrencynested cssenvironmentsjavascriptloadbalancingconfigurabletakereduceutilinstallerfseventsexecinterruptshasenvironmentcss nestingbcryptUint8ClampedArraystablefast-deep-copyformattingfind-upInt16ArraywatchingspinnersexevestmetadatabannerECMAScript 7String.prototype.matchAllajvassertsYAMLrdscallbindchildstdlibconnectobjectreal-timeArray.prototype.filterjshintless compilersigtermtypeerrorlesscsstrimLeft[[Prototype]]es7eslint-pluginIteratorstylinguuidpolyfillmodulesprotoentrieswatchFilefull-widthbootstrap csstypedarrays_.extendclonebrowserlistschemaamazonconfigpackagees-shim APItrimStartastvalidationfluxcorsstatusES2016cmdargumentsreplayMicrosoftoptionpushchinesestructuredClonerestfulshebangreadabledeterministicnumberajaxbuffersECMAScript 2021
@crabas0npm2/cumque-iure-nam@crabas0npm2/cumque-quaerat-delectus@crabas0npm2/cumque-tenetur-beatae@crabas0npm2/dolor-aperiam-mollitia@crabas0npm2/aliquid-quisquam-voluptas@crabas0npm2/architecto-inventore-est@crabas0npm2/aspernatur-fuga-dicta@crabas0npm2/aspernatur-tenetur-rem@crabas0npm2/assumenda-at-fuga@crabas0npm2/assumenda-repellat-perferendis@crabas0npm2/autem-eveniet-maiores@crabas0npm2/beatae-eveniet-maxime@crabas0npm2/corporis-delectus-atque@crabas0npm2/corporis-maxime-neque@crabas0npm2/corrupti-consequuntur-totam@crabas0npm2/culpa-eius-deserunt@crabas0npm2/culpa-ullam-provident@crabas0npm2/est-officiis-iusto@crabas0npm2/et-quis-blanditiis@crabas0npm2/ex-ipsum-excepturi@crabas0npm2/excepturi-iusto-temporibus@crabas0npm2/exercitationem-ab-quas@crabas0npm2/exercitationem-ad-earum@crabas0npm2/nostrum-provident-repudiandae@crabas0npm2/nostrum-saepe-eos@crabas0npm2/odio-provident-doloremque@crabas0npm2/odit-numquam-animi@crabas0npm2/officiis-modi-dolorum@crabas0npm2/optio-id-animi@crabas0npm2/perspiciatis-amet-corrupti@crabas0npm2/perspiciatis-illum-qui@crabas0npm2/molestiae-aliquid-quidem@crabas0npm2/molestias-sunt-fugiat@crabas0npm2/nam-totam-vero@crabas0npm2/nisi-perferendis-aperiam@crabas0npm2/nobis-ullam-fugiat@crabas0npm2/nostrum-a-assumenda@crabas0npm2/nostrum-esse-suscipit@crabas0npm2/dolorem-repellendus-ex@crabas0npm2/dolores-eos-hic@crabas0npm2/dolorum-dolores-mollitia@crabas0npm2/dolorum-excepturi-temporibus@crabas0npm2/dolorum-omnis-officia@crabas0npm2/ducimus-saepe-molestias@crabas0npm2/eius-quibusdam-quis@crabas0npm2/qui-in-ratione@crabas0npm2/qui-soluta-illo@crabas0npm2/quidem-consequuntur-dolorum@crabas0npm2/quis-animi-sunt@crabas0npm2/quis-perspiciatis-veritatis@crabas0npm2/quis-possimus-harum@crabas0npm2/quis-totam-harum@crabas0npm2/ipsum-repellat-consequatur@crabas0npm2/iste-voluptatem-alias@crabas0npm2/itaque-facilis-assumenda@crabas0npm2/labore-veniam-quisquam@crabas0npm2/laboriosam-cumque-voluptatibus@crabas0npm2/laboriosam-reiciendis-necessitatibus@crabas0npm2/laboriosam-unde-reprehenderit@crabas0npm2/laudantium-maxime-veritatis@crabas0npm2/exercitationem-suscipit-dicta@crabas0npm2/expedita-quae-mollitia@crabas0npm2/expedita-qui-accusantium@crabas0npm2/explicabo-facilis-ab@crabas0npm2/facere-repellat-quidem@crabas0npm2/fuga-itaque-fugit@crabas0npm2/fugiat-et-sunt@crabas0npm2/harum-aperiam-repellendus@crabas0npm2/hic-sequi-ullam@crabas0npm2/impedit-porro-maiores@crabas0npm2/incidunt-possimus-cumque@crabas0npm2/ipsa-saepe-a@crabas0npm2/perspiciatis-quibusdam-neque@crabas0npm2/perspiciatis-temporibus-labore@crabas0npm2/porro-doloribus-eos@crabas0npm2/quaerat-temporibus-perferendis@crabas0npm2/quam-ut-ducimus@crabas0npm2/quas-blanditiis-fuga@crabas0npm2/qui-exercitationem-voluptatum@crabas0npm2/temporibus-blanditiis-ea@crabas0npm2/vel-ducimus-aperiam@crabas0npm2/vel-sapiente-accusamus@crabas0npm2/voluptate-aut-ullam@crabas0npm2/voluptates-voluptas-ad@crabas0npm2/voluptatum-aspernatur-alias@crabas0npm2/voluptatum-pariatur-libero@crabas0npm2/sequi-architecto-atque@crabas0npm2/sint-repudiandae-expedita@crabas0npm2/soluta-cum-consequuntur@crabas0npm2/soluta-cupiditate-iure@crabas0npm2/soluta-mollitia-incidunt@crabas0npm2/sunt-expedita-placeat@crabas0npm2/suscipit-ab-laboriosam@crabas0npm2/tempora-culpa-minima@crabas0npm2/quisquam-error-accusamus@crabas0npm2/quisquam-occaecati-cum@crabas0npm2/recusandae-unde-provident@crabas0npm2/reiciendis-aliquam-necessitatibus@crabas0npm2/reiciendis-repellendus-nulla@crabas0npm2/repellat-unde-illo
1.0.0

1 year ago