chore: update node_modules with new binary files and dependencies
- Add new binary files for nodemon, onnxruntime-web, and xenova/transformers - Update various JavaScript and TypeScript files in node_modules - Remove unused files and dependencies - Add new test fixtures and documentation files
This commit is contained in:
39
node_modules/protobufjs/LICENSE
generated
vendored
Normal file
39
node_modules/protobufjs/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
This license applies to all parts of protobuf.js except those files
|
||||
either explicitly including or referencing a different license or
|
||||
located in a directory containing a different LICENSE file.
|
||||
|
||||
---
|
||||
|
||||
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of its author, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
---
|
||||
|
||||
Code generated by the command line utilities is owned by the owner
|
||||
of the input file used when generating it. This code is not
|
||||
standalone and requires a support library to be linked with it. This
|
||||
support library is itself covered by the above license.
|
||||
905
node_modules/protobufjs/README.md
generated
vendored
Normal file
905
node_modules/protobufjs/README.md
generated
vendored
Normal file
@@ -0,0 +1,905 @@
|
||||
<h1><p align="center"><img alt="protobuf.js" src="https://github.com/dcodeIO/protobuf.js/raw/master/pbjs.png" width="120" height="104" /></p></h1>
|
||||
<p align="center"><a href="https://npmjs.org/package/protobufjs"><img src="https://img.shields.io/npm/v/protobufjs.svg" alt=""></a> <a href="https://travis-ci.org/dcodeIO/protobuf.js"><img src="https://travis-ci.org/dcodeIO/protobuf.js.svg?branch=master" alt=""></a> <a href="https://npmjs.org/package/protobufjs"><img src="https://img.shields.io/npm/dm/protobufjs.svg" alt=""></a> <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=dcode%40dcode.io&item_name=Open%20Source%20Software%20Donation&item_number=dcodeIO%2Fprotobuf.js"><img alt="donate ❤" src="https://img.shields.io/badge/donate-❤-ff2244.svg"></a></p>
|
||||
|
||||
**Protocol Buffers** are a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more, originally designed at Google ([see](https://developers.google.com/protocol-buffers/)).
|
||||
|
||||
**protobuf.js** is a pure JavaScript implementation with [TypeScript](https://www.typescriptlang.org) support for [node.js](https://nodejs.org) and the browser. It's easy to use, blazingly fast and works out of the box with [.proto](https://developers.google.com/protocol-buffers/docs/proto) files!
|
||||
|
||||
Contents
|
||||
--------
|
||||
|
||||
* [Installation](#installation)<br />
|
||||
How to include protobuf.js in your project.
|
||||
|
||||
* [Usage](#usage)<br />
|
||||
A brief introduction to using the toolset.
|
||||
|
||||
* [Valid Message](#valid-message)
|
||||
* [Toolset](#toolset)<br />
|
||||
|
||||
* [Examples](#examples)<br />
|
||||
A few examples to get you started.
|
||||
|
||||
* [Using .proto files](#using-proto-files)
|
||||
* [Using JSON descriptors](#using-json-descriptors)
|
||||
* [Using reflection only](#using-reflection-only)
|
||||
* [Using custom classes](#using-custom-classes)
|
||||
* [Using services](#using-services)
|
||||
* [Usage with TypeScript](#usage-with-typescript)<br />
|
||||
|
||||
* [Command line](#command-line)<br />
|
||||
How to use the command line utility.
|
||||
|
||||
* [pbjs for JavaScript](#pbjs-for-javascript)
|
||||
* [pbts for TypeScript](#pbts-for-typescript)
|
||||
* [Reflection vs. static code](#reflection-vs-static-code)
|
||||
* [Command line API](#command-line-api)<br />
|
||||
|
||||
* [Additional documentation](#additional-documentation)<br />
|
||||
A list of available documentation resources.
|
||||
|
||||
* [Performance](#performance)<br />
|
||||
A few internals and a benchmark on performance.
|
||||
|
||||
* [Compatibility](#compatibility)<br />
|
||||
Notes on compatibility regarding browsers and optional libraries.
|
||||
|
||||
* [Building](#building)<br />
|
||||
How to build the library and its components yourself.
|
||||
|
||||
Installation
|
||||
---------------
|
||||
|
||||
### node.js
|
||||
|
||||
```
|
||||
$> npm install protobufjs [--save --save-prefix=~]
|
||||
```
|
||||
|
||||
```js
|
||||
var protobuf = require("protobufjs");
|
||||
```
|
||||
|
||||
**Note** that this library's versioning scheme is not semver-compatible for historical reasons. For guaranteed backward compatibility, always depend on `~6.A.B` instead of `^6.A.B` (hence the `--save-prefix` above).
|
||||
|
||||
### Browsers
|
||||
|
||||
Development:
|
||||
|
||||
```
|
||||
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.X.X/dist/protobuf.js"></script>
|
||||
```
|
||||
|
||||
Production:
|
||||
|
||||
```
|
||||
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.X.X/dist/protobuf.min.js"></script>
|
||||
```
|
||||
|
||||
**Remember** to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon.
|
||||
|
||||
The library supports CommonJS and AMD loaders and also exports globally as `protobuf`.
|
||||
|
||||
### Distributions
|
||||
|
||||
Where bundle size is a factor, there are additional stripped-down versions of the [full library][dist-full] (~19kb gzipped) available that exclude certain functionality:
|
||||
|
||||
* When working with JSON descriptors (i.e. generated by [pbjs](#pbjs-for-javascript)) and/or reflection only, see the [light library][dist-light] (~16kb gzipped) that excludes the parser. CommonJS entry point is:
|
||||
|
||||
```js
|
||||
var protobuf = require("protobufjs/light");
|
||||
```
|
||||
|
||||
* When working with statically generated code only, see the [minimal library][dist-minimal] (~6.5kb gzipped) that also excludes reflection. CommonJS entry point is:
|
||||
|
||||
```js
|
||||
var protobuf = require("protobufjs/minimal");
|
||||
```
|
||||
|
||||
[dist-full]: https://github.com/dcodeIO/protobuf.js/tree/master/dist
|
||||
[dist-light]: https://github.com/dcodeIO/protobuf.js/tree/master/dist/light
|
||||
[dist-minimal]: https://github.com/dcodeIO/protobuf.js/tree/master/dist/minimal
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Because JavaScript is a dynamically typed language, protobuf.js introduces the concept of a **valid message** in order to provide the best possible [performance](#performance) (and, as a side product, proper typings):
|
||||
|
||||
### Valid message
|
||||
|
||||
> A valid message is an object (1) not missing any required fields and (2) exclusively composed of JS types understood by the wire format writer.
|
||||
|
||||
There are two possible types of valid messages and the encoder is able to work with both of these for convenience:
|
||||
|
||||
* **Message instances** (explicit instances of message classes with default values on their prototype) always (have to) satisfy the requirements of a valid message by design and
|
||||
* **Plain JavaScript objects** that just so happen to be composed in a way satisfying the requirements of a valid message as well.
|
||||
|
||||
In a nutshell, the wire format writer understands the following types:
|
||||
|
||||
| Field type | Expected JS type (create, encode) | Conversion (fromObject)
|
||||
|------------|-----------------------------------|------------------------
|
||||
| s-/u-/int32<br />s-/fixed32 | `number` (32 bit integer) | <code>value | 0</code> if signed<br />`value >>> 0` if unsigned
|
||||
| s-/u-/int64<br />s-/fixed64 | `Long`-like (optimal)<br />`number` (53 bit integer) | `Long.fromValue(value)` with long.js<br />`parseInt(value, 10)` otherwise
|
||||
| float<br />double | `number` | `Number(value)`
|
||||
| bool | `boolean` | `Boolean(value)`
|
||||
| string | `string` | `String(value)`
|
||||
| bytes | `Uint8Array` (optimal)<br />`Buffer` (optimal under node)<br />`Array.<number>` (8 bit integers) | `base64.decode(value)` if a `string`<br />`Object` with non-zero `.length` is assumed to be buffer-like
|
||||
| enum | `number` (32 bit integer) | Looks up the numeric id if a `string`
|
||||
| message | Valid message | `Message.fromObject(value)`
|
||||
|
||||
* Explicit `undefined` and `null` are considered as not set if the field is optional.
|
||||
* Repeated fields are `Array.<T>`.
|
||||
* Map fields are `Object.<string,T>` with the key being the string representation of the respective value or an 8 characters long binary hash string for `Long`-likes.
|
||||
* Types marked as *optimal* provide the best performance because no conversion step (i.e. number to low and high bits or base64 string to buffer) is required.
|
||||
|
||||
### Toolset
|
||||
|
||||
With that in mind and again for performance reasons, each message class provides a distinct set of methods with each method doing just one thing. This avoids unnecessary assertions / redundant operations where performance is a concern but also forces a user to perform verification (of plain JavaScript objects that *might* just so happen to be a valid message) explicitly where necessary - for example when dealing with user input.
|
||||
|
||||
**Note** that `Message` below refers to any message class.
|
||||
|
||||
* **Message.verify**(message: `Object`): `null|string`<br />
|
||||
verifies that a **plain JavaScript object** satisfies the requirements of a valid message and thus can be encoded without issues. Instead of throwing, it returns the error message as a string, if any.
|
||||
|
||||
```js
|
||||
var payload = "invalid (not an object)";
|
||||
var err = AwesomeMessage.verify(payload);
|
||||
if (err)
|
||||
throw Error(err);
|
||||
```
|
||||
|
||||
* **Message.encode**(message: `Message|Object` [, writer: `Writer`]): `Writer`<br />
|
||||
encodes a **message instance** or valid **plain JavaScript object**. This method does not implicitly verify the message and it's up to the user to make sure that the payload is a valid message.
|
||||
|
||||
```js
|
||||
var buffer = AwesomeMessage.encode(message).finish();
|
||||
```
|
||||
|
||||
* **Message.encodeDelimited**(message: `Message|Object` [, writer: `Writer`]): `Writer`<br />
|
||||
works like `Message.encode` but additionally prepends the length of the message as a varint.
|
||||
|
||||
* **Message.decode**(reader: `Reader|Uint8Array`): `Message`<br />
|
||||
decodes a buffer to a **message instance**. If required fields are missing, it throws a `util.ProtocolError` with an `instance` property set to the so far decoded message. If the wire format is invalid, it throws an `Error`.
|
||||
|
||||
```js
|
||||
try {
|
||||
var decodedMessage = AwesomeMessage.decode(buffer);
|
||||
} catch (e) {
|
||||
if (e instanceof protobuf.util.ProtocolError) {
|
||||
// e.instance holds the so far decoded message with missing required fields
|
||||
} else {
|
||||
// wire format is invalid
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
* **Message.decodeDelimited**(reader: `Reader|Uint8Array`): `Message`<br />
|
||||
works like `Message.decode` but additionally reads the length of the message prepended as a varint.
|
||||
|
||||
* **Message.create**(properties: `Object`): `Message`<br />
|
||||
creates a new **message instance** from a set of properties that satisfy the requirements of a valid message. Where applicable, it is recommended to prefer `Message.create` over `Message.fromObject` because it doesn't perform possibly redundant conversion.
|
||||
|
||||
```js
|
||||
var message = AwesomeMessage.create({ awesomeField: "AwesomeString" });
|
||||
```
|
||||
|
||||
* **Message.fromObject**(object: `Object`): `Message`<br />
|
||||
converts any non-valid **plain JavaScript object** to a **message instance** using the conversion steps outlined within the table above.
|
||||
|
||||
```js
|
||||
var message = AwesomeMessage.fromObject({ awesomeField: 42 });
|
||||
// converts awesomeField to a string
|
||||
```
|
||||
|
||||
* **Message.toObject**(message: `Message` [, options: `ConversionOptions`]): `Object`<br />
|
||||
converts a **message instance** to an arbitrary **plain JavaScript object** for interoperability with other libraries or storage. The resulting plain JavaScript object *might* still satisfy the requirements of a valid message depending on the actual conversion options specified, but most of the time it does not.
|
||||
|
||||
```js
|
||||
var object = AwesomeMessage.toObject(message, {
|
||||
enums: String, // enums as string names
|
||||
longs: String, // longs as strings (requires long.js)
|
||||
bytes: String, // bytes as base64 encoded strings
|
||||
defaults: true, // includes default values
|
||||
arrays: true, // populates empty arrays (repeated fields) even if defaults=false
|
||||
objects: true, // populates empty objects (map fields) even if defaults=false
|
||||
oneofs: true // includes virtual oneof fields set to the present field's name
|
||||
});
|
||||
```
|
||||
|
||||
For reference, the following diagram aims to display relationships between the different methods and the concept of a valid message:
|
||||
|
||||
<p align="center"><img alt="Toolset Diagram" src="https://protobufjs.github.io/protobuf.js/toolset.svg" /></p>
|
||||
|
||||
> In other words: `verify` indicates that calling `create` or `encode` directly on the plain object will [result in a valid message respectively] succeed. `fromObject`, on the other hand, does conversion from a broader range of plain objects to create valid messages. ([ref](https://github.com/dcodeIO/protobuf.js/issues/748#issuecomment-291925749))
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
### Using .proto files
|
||||
|
||||
It is possible to load existing .proto files using the full library, which parses and compiles the definitions to ready to use (reflection-based) message classes:
|
||||
|
||||
```protobuf
|
||||
// awesome.proto
|
||||
package awesomepackage;
|
||||
syntax = "proto3";
|
||||
|
||||
message AwesomeMessage {
|
||||
string awesome_field = 1; // becomes awesomeField
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
protobuf.load("awesome.proto", function(err, root) {
|
||||
if (err)
|
||||
throw err;
|
||||
|
||||
// Obtain a message type
|
||||
var AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage");
|
||||
|
||||
// Exemplary payload
|
||||
var payload = { awesomeField: "AwesomeString" };
|
||||
|
||||
// Verify the payload if necessary (i.e. when possibly incomplete or invalid)
|
||||
var errMsg = AwesomeMessage.verify(payload);
|
||||
if (errMsg)
|
||||
throw Error(errMsg);
|
||||
|
||||
// Create a new message
|
||||
var message = AwesomeMessage.create(payload); // or use .fromObject if conversion is necessary
|
||||
|
||||
// Encode a message to an Uint8Array (browser) or Buffer (node)
|
||||
var buffer = AwesomeMessage.encode(message).finish();
|
||||
// ... do something with buffer
|
||||
|
||||
// Decode an Uint8Array (browser) or Buffer (node) to a message
|
||||
var message = AwesomeMessage.decode(buffer);
|
||||
// ... do something with message
|
||||
|
||||
// If the application uses length-delimited buffers, there is also encodeDelimited and decodeDelimited.
|
||||
|
||||
// Maybe convert the message back to a plain object
|
||||
var object = AwesomeMessage.toObject(message, {
|
||||
longs: String,
|
||||
enums: String,
|
||||
bytes: String,
|
||||
// see ConversionOptions
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
Additionally, promise syntax can be used by omitting the callback, if preferred:
|
||||
|
||||
```js
|
||||
protobuf.load("awesome.proto")
|
||||
.then(function(root) {
|
||||
...
|
||||
});
|
||||
```
|
||||
|
||||
### Using JSON descriptors
|
||||
|
||||
The library utilizes JSON descriptors that are equivalent to a .proto definition. For example, the following is identical to the .proto definition seen above:
|
||||
|
||||
```json
|
||||
// awesome.json
|
||||
{
|
||||
"nested": {
|
||||
"awesomepackage": {
|
||||
"nested": {
|
||||
"AwesomeMessage": {
|
||||
"fields": {
|
||||
"awesomeField": {
|
||||
"type": "string",
|
||||
"id": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
JSON descriptors closely resemble the internal reflection structure:
|
||||
|
||||
| Type (T) | Extends | Type-specific properties
|
||||
|--------------------|--------------------|-------------------------
|
||||
| *ReflectionObject* | | options
|
||||
| *Namespace* | *ReflectionObject* | nested
|
||||
| Root | *Namespace* | **nested**
|
||||
| Type | *Namespace* | **fields**
|
||||
| Enum | *ReflectionObject* | **values**
|
||||
| Field | *ReflectionObject* | rule, **type**, **id**
|
||||
| MapField | Field | **keyType**
|
||||
| OneOf | *ReflectionObject* | **oneof** (array of field names)
|
||||
| Service | *Namespace* | **methods**
|
||||
| Method | *ReflectionObject* | type, **requestType**, **responseType**, requestStream, responseStream
|
||||
|
||||
* **Bold properties** are required. *Italic types* are abstract.
|
||||
* `T.fromJSON(name, json)` creates the respective reflection object from a JSON descriptor
|
||||
* `T#toJSON()` creates a JSON descriptor from the respective reflection object (its name is used as the key within the parent)
|
||||
|
||||
Exclusively using JSON descriptors instead of .proto files enables the use of just the light library (the parser isn't required in this case).
|
||||
|
||||
A JSON descriptor can either be loaded the usual way:
|
||||
|
||||
```js
|
||||
protobuf.load("awesome.json", function(err, root) {
|
||||
if (err) throw err;
|
||||
|
||||
// Continue at "Obtain a message type" above
|
||||
});
|
||||
```
|
||||
|
||||
Or it can be loaded inline:
|
||||
|
||||
```js
|
||||
var jsonDescriptor = require("./awesome.json"); // exemplary for node
|
||||
|
||||
var root = protobuf.Root.fromJSON(jsonDescriptor);
|
||||
|
||||
// Continue at "Obtain a message type" above
|
||||
```
|
||||
|
||||
### Using reflection only
|
||||
|
||||
Both the full and the light library include full reflection support. One could, for example, define the .proto definitions seen in the examples above using just reflection:
|
||||
|
||||
```js
|
||||
...
|
||||
var Root = protobuf.Root,
|
||||
Type = protobuf.Type,
|
||||
Field = protobuf.Field;
|
||||
|
||||
var AwesomeMessage = new Type("AwesomeMessage").add(new Field("awesomeField", 1, "string"));
|
||||
|
||||
var root = new Root().define("awesomepackage").add(AwesomeMessage);
|
||||
|
||||
// Continue at "Create a new message" above
|
||||
...
|
||||
```
|
||||
|
||||
Detailed information on the reflection structure is available within the [API documentation](#additional-documentation).
|
||||
|
||||
### Using custom classes
|
||||
|
||||
Message classes can also be extended with custom functionality and it is also possible to register a custom constructor with a reflected message type:
|
||||
|
||||
```js
|
||||
...
|
||||
|
||||
// Define a custom constructor
|
||||
function AwesomeMessage(properties) {
|
||||
// custom initialization code
|
||||
...
|
||||
}
|
||||
|
||||
// Register the custom constructor with its reflected type (*)
|
||||
root.lookupType("awesomepackage.AwesomeMessage").ctor = AwesomeMessage;
|
||||
|
||||
// Define custom functionality
|
||||
AwesomeMessage.customStaticMethod = function() { ... };
|
||||
AwesomeMessage.prototype.customInstanceMethod = function() { ... };
|
||||
|
||||
// Continue at "Create a new message" above
|
||||
```
|
||||
|
||||
(*) Besides referencing its reflected type through `AwesomeMessage.$type` and `AwesomeMesage#$type`, the respective custom class is automatically populated with:
|
||||
|
||||
* `AwesomeMessage.create`
|
||||
* `AwesomeMessage.encode` and `AwesomeMessage.encodeDelimited`
|
||||
* `AwesomeMessage.decode` and `AwesomeMessage.decodeDelimited`
|
||||
* `AwesomeMessage.verify`
|
||||
* `AwesomeMessage.fromObject`, `AwesomeMessage.toObject` and `AwesomeMessage#toJSON`
|
||||
|
||||
Afterwards, decoded messages of this type are `instanceof AwesomeMessage`.
|
||||
|
||||
Alternatively, it is also possible to reuse and extend the internal constructor if custom initialization code is not required:
|
||||
|
||||
```js
|
||||
...
|
||||
|
||||
// Reuse the internal constructor
|
||||
var AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage").ctor;
|
||||
|
||||
// Define custom functionality
|
||||
AwesomeMessage.customStaticMethod = function() { ... };
|
||||
AwesomeMessage.prototype.customInstanceMethod = function() { ... };
|
||||
|
||||
// Continue at "Create a new message" above
|
||||
```
|
||||
|
||||
### Using services
|
||||
|
||||
The library also supports consuming services but it doesn't make any assumptions about the actual transport channel. Instead, a user must provide a suitable RPC implementation, which is an asynchronous function that takes the reflected service method, the binary request and a node-style callback as its parameters:
|
||||
|
||||
```js
|
||||
function rpcImpl(method, requestData, callback) {
|
||||
// perform the request using an HTTP request or a WebSocket for example
|
||||
var responseData = ...;
|
||||
// and call the callback with the binary response afterwards:
|
||||
callback(null, responseData);
|
||||
}
|
||||
```
|
||||
|
||||
Below is a working example with a typescript implementation using grpc npm package.
|
||||
```ts
|
||||
const grpc = require('grpc')
|
||||
|
||||
const Client = grpc.makeGenericClientConstructor({})
|
||||
const client = new Client(
|
||||
grpcServerUrl,
|
||||
grpc.credentials.createInsecure()
|
||||
)
|
||||
|
||||
const rpcImpl = function(method, requestData, callback) {
|
||||
client.makeUnaryRequest(
|
||||
method.name,
|
||||
arg => arg,
|
||||
arg => arg,
|
||||
requestData,
|
||||
callback
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```protobuf
|
||||
// greeter.proto
|
||||
syntax = "proto3";
|
||||
|
||||
service Greeter {
|
||||
rpc SayHello (HelloRequest) returns (HelloReply) {}
|
||||
}
|
||||
|
||||
message HelloRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message HelloReply {
|
||||
string message = 1;
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
...
|
||||
var Greeter = root.lookup("Greeter");
|
||||
var greeter = Greeter.create(/* see above */ rpcImpl, /* request delimited? */ false, /* response delimited? */ false);
|
||||
|
||||
greeter.sayHello({ name: 'you' }, function(err, response) {
|
||||
console.log('Greeting:', response.message);
|
||||
});
|
||||
```
|
||||
|
||||
Services also support promises:
|
||||
|
||||
```js
|
||||
greeter.sayHello({ name: 'you' })
|
||||
.then(function(response) {
|
||||
console.log('Greeting:', response.message);
|
||||
});
|
||||
```
|
||||
|
||||
There is also an [example for streaming RPC](https://github.com/dcodeIO/protobuf.js/blob/master/examples/streaming-rpc.js).
|
||||
|
||||
Note that the service API is meant for clients. Implementing a server-side endpoint pretty much always requires transport channel (i.e. http, websocket, etc.) specific code with the only common denominator being that it decodes and encodes messages.
|
||||
|
||||
### Usage with TypeScript
|
||||
|
||||
The library ships with its own [type definitions](https://github.com/dcodeIO/protobuf.js/blob/master/index.d.ts) and modern editors like [Visual Studio Code](https://code.visualstudio.com/) will automatically detect and use them for code completion.
|
||||
|
||||
The npm package depends on [@types/node](https://www.npmjs.com/package/@types/node) because of `Buffer` and [@types/long](https://www.npmjs.com/package/@types/long) because of `Long`. If you are not building for node and/or not using long.js, it should be safe to exclude them manually.
|
||||
|
||||
#### Using the JS API
|
||||
|
||||
The API shown above works pretty much the same with TypeScript. However, because everything is typed, accessing fields on instances of dynamically generated message classes requires either using bracket-notation (i.e. `message["awesomeField"]`) or explicit casts. Alternatively, it is possible to use a [typings file generated for its static counterpart](#pbts-for-typescript).
|
||||
|
||||
```ts
|
||||
import { load } from "protobufjs"; // respectively "./node_modules/protobufjs"
|
||||
|
||||
load("awesome.proto", function(err, root) {
|
||||
if (err)
|
||||
throw err;
|
||||
|
||||
// example code
|
||||
const AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage");
|
||||
|
||||
let message = AwesomeMessage.create({ awesomeField: "hello" });
|
||||
console.log(`message = ${JSON.stringify(message)}`);
|
||||
|
||||
let buffer = AwesomeMessage.encode(message).finish();
|
||||
console.log(`buffer = ${Array.prototype.toString.call(buffer)}`);
|
||||
|
||||
let decoded = AwesomeMessage.decode(buffer);
|
||||
console.log(`decoded = ${JSON.stringify(decoded)}`);
|
||||
});
|
||||
```
|
||||
|
||||
#### Using generated static code
|
||||
|
||||
If you generated static code to `bundle.js` using the CLI and its type definitions to `bundle.d.ts`, then you can just do:
|
||||
|
||||
```ts
|
||||
import { AwesomeMessage } from "./bundle.js";
|
||||
|
||||
// example code
|
||||
let message = AwesomeMessage.create({ awesomeField: "hello" });
|
||||
let buffer = AwesomeMessage.encode(message).finish();
|
||||
let decoded = AwesomeMessage.decode(buffer);
|
||||
```
|
||||
|
||||
#### Using decorators
|
||||
|
||||
The library also includes an early implementation of [decorators](https://www.typescriptlang.org/docs/handbook/decorators.html).
|
||||
|
||||
**Note** that decorators are an experimental feature in TypeScript and that declaration order is important depending on the JS target. For example, `@Field.d(2, AwesomeArrayMessage)` requires that `AwesomeArrayMessage` has been defined earlier when targeting `ES5`.
|
||||
|
||||
```ts
|
||||
import { Message, Type, Field, OneOf } from "protobufjs/light"; // respectively "./node_modules/protobufjs/light.js"
|
||||
|
||||
export class AwesomeSubMessage extends Message<AwesomeSubMessage> {
|
||||
|
||||
@Field.d(1, "string")
|
||||
public awesomeString: string;
|
||||
|
||||
}
|
||||
|
||||
export enum AwesomeEnum {
|
||||
ONE = 1,
|
||||
TWO = 2
|
||||
}
|
||||
|
||||
@Type.d("SuperAwesomeMessage")
|
||||
export class AwesomeMessage extends Message<AwesomeMessage> {
|
||||
|
||||
@Field.d(1, "string", "optional", "awesome default string")
|
||||
public awesomeField: string;
|
||||
|
||||
@Field.d(2, AwesomeSubMessage)
|
||||
public awesomeSubMessage: AwesomeSubMessage;
|
||||
|
||||
@Field.d(3, AwesomeEnum, "optional", AwesomeEnum.ONE)
|
||||
public awesomeEnum: AwesomeEnum;
|
||||
|
||||
@OneOf.d("awesomeSubMessage", "awesomeEnum")
|
||||
public which: string;
|
||||
|
||||
}
|
||||
|
||||
// example code
|
||||
let message = new AwesomeMessage({ awesomeField: "hello" });
|
||||
let buffer = AwesomeMessage.encode(message).finish();
|
||||
let decoded = AwesomeMessage.decode(buffer);
|
||||
```
|
||||
|
||||
Supported decorators are:
|
||||
|
||||
* **Type.d(typeName?: `string`)** *(optional)*<br />
|
||||
annotates a class as a protobuf message type. If `typeName` is not specified, the constructor's runtime function name is used for the reflected type.
|
||||
|
||||
* **Field.d<T>(fieldId: `number`, fieldType: `string | Constructor<T>`, fieldRule?: `"optional" | "required" | "repeated"`, defaultValue?: `T`)**<br />
|
||||
annotates a property as a protobuf field with the specified id and protobuf type.
|
||||
|
||||
* **MapField.d<T extends { [key: string]: any }>(fieldId: `number`, fieldKeyType: `string`, fieldValueType. `string | Constructor<{}>`)**<br />
|
||||
annotates a property as a protobuf map field with the specified id, protobuf key and value type.
|
||||
|
||||
* **OneOf.d<T extends string>(...fieldNames: `string[]`)**<br />
|
||||
annotates a property as a protobuf oneof covering the specified fields.
|
||||
|
||||
Other notes:
|
||||
|
||||
* Decorated types reside in `protobuf.roots["decorated"]` using a flat structure, so no duplicate names.
|
||||
* Enums are copied to a reflected enum with a generic name on decorator evaluation because referenced enum objects have no runtime name the decorator could use.
|
||||
* Default values must be specified as arguments to the decorator instead of using a property initializer for proper prototype behavior.
|
||||
* Property names on decorated classes must not be renamed on compile time (i.e. by a minifier) because decorators just receive the original field name as a string.
|
||||
|
||||
**ProTip!** Not as pretty, but you can [use decorators in plain JavaScript](https://github.com/dcodeIO/protobuf.js/blob/master/examples/js-decorators.js) as well.
|
||||
|
||||
Command line
|
||||
------------
|
||||
|
||||
**Note** that moving the CLI to [its own package](./cli) is a work in progress. At the moment, it's still part of the main package.
|
||||
|
||||
The command line interface (CLI) can be used to translate between file formats and to generate static code as well as TypeScript definitions.
|
||||
|
||||
### pbjs for JavaScript
|
||||
|
||||
```
|
||||
Translates between file formats and generates static code.
|
||||
|
||||
-t, --target Specifies the target format. Also accepts a path to require a custom target.
|
||||
|
||||
json JSON representation
|
||||
json-module JSON representation as a module
|
||||
proto2 Protocol Buffers, Version 2
|
||||
proto3 Protocol Buffers, Version 3
|
||||
static Static code without reflection (non-functional on its own)
|
||||
static-module Static code without reflection as a module
|
||||
|
||||
-p, --path Adds a directory to the include path.
|
||||
|
||||
-o, --out Saves to a file instead of writing to stdout.
|
||||
|
||||
--sparse Exports only those types referenced from a main file (experimental).
|
||||
|
||||
Module targets only:
|
||||
|
||||
-w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper.
|
||||
|
||||
default Default wrapper supporting both CommonJS and AMD
|
||||
commonjs CommonJS wrapper
|
||||
amd AMD wrapper
|
||||
es6 ES6 wrapper (implies --es6)
|
||||
closure A closure adding to protobuf.roots where protobuf is a global
|
||||
|
||||
-r, --root Specifies an alternative protobuf.roots name.
|
||||
|
||||
-l, --lint Linter configuration. Defaults to protobuf.js-compatible rules:
|
||||
|
||||
eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins
|
||||
|
||||
--es6 Enables ES6 syntax (const/let instead of var)
|
||||
|
||||
Proto sources only:
|
||||
|
||||
--keep-case Keeps field casing instead of converting to camel case.
|
||||
|
||||
Static targets only:
|
||||
|
||||
--no-create Does not generate create functions used for reflection compatibility.
|
||||
--no-encode Does not generate encode functions.
|
||||
--no-decode Does not generate decode functions.
|
||||
--no-verify Does not generate verify functions.
|
||||
--no-convert Does not generate convert functions like from/toObject
|
||||
--no-delimited Does not generate delimited encode/decode functions.
|
||||
--no-beautify Does not beautify generated code.
|
||||
--no-comments Does not output any JSDoc comments.
|
||||
|
||||
--force-long Enforces the use of 'Long' for s-/u-/int64 and s-/fixed64 fields.
|
||||
--force-number Enforces the use of 'number' for s-/u-/int64 and s-/fixed64 fields.
|
||||
--force-message Enforces the use of message instances instead of plain objects.
|
||||
|
||||
usage: pbjs [options] file1.proto file2.json ... (or pipe) other | pbjs [options] -
|
||||
```
|
||||
|
||||
For production environments it is recommended to bundle all your .proto files to a single .json file, which minimizes the number of network requests and avoids any parser overhead (hint: works with just the **light** library):
|
||||
|
||||
```
|
||||
$> pbjs -t json file1.proto file2.proto > bundle.json
|
||||
```
|
||||
|
||||
Now, either include this file in your final bundle:
|
||||
|
||||
```js
|
||||
var root = protobuf.Root.fromJSON(require("./bundle.json"));
|
||||
```
|
||||
|
||||
or load it the usual way:
|
||||
|
||||
```js
|
||||
protobuf.load("bundle.json", function(err, root) {
|
||||
...
|
||||
});
|
||||
```
|
||||
|
||||
Generated static code, on the other hand, works with just the **minimal** library. For example
|
||||
|
||||
```
|
||||
$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto
|
||||
```
|
||||
|
||||
will generate static code for definitions within `file1.proto` and `file2.proto` to a CommonJS module `compiled.js`.
|
||||
|
||||
**ProTip!** Documenting your .proto files with `/** ... */`-blocks or (trailing) `/// ...` lines translates to generated static code.
|
||||
|
||||
|
||||
### pbts for TypeScript
|
||||
|
||||
```
|
||||
Generates TypeScript definitions from annotated JavaScript files.
|
||||
|
||||
-o, --out Saves to a file instead of writing to stdout.
|
||||
|
||||
-g, --global Name of the global object in browser environments, if any.
|
||||
|
||||
--no-comments Does not output any JSDoc comments.
|
||||
|
||||
Internal flags:
|
||||
|
||||
-n, --name Wraps everything in a module of the specified name.
|
||||
|
||||
-m, --main Whether building the main library without any imports.
|
||||
|
||||
usage: pbts [options] file1.js file2.js ... (or) other | pbts [options] -
|
||||
```
|
||||
|
||||
Picking up on the example above, the following not only generates static code to a CommonJS module `compiled.js` but also its respective TypeScript definitions to `compiled.d.ts`:
|
||||
|
||||
```
|
||||
$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto
|
||||
$> pbts -o compiled.d.ts compiled.js
|
||||
```
|
||||
|
||||
Additionally, TypeScript definitions of static modules are compatible with their reflection-based counterparts (i.e. as exported by JSON modules), as long as the following conditions are met:
|
||||
|
||||
1. Instead of using `new SomeMessage(...)`, always use `SomeMessage.create(...)` because reflection objects do not provide a constructor.
|
||||
2. Types, services and enums must start with an uppercase letter to become available as properties of the reflected types as well (i.e. to be able to use `MyMessage.MyEnum` instead of `root.lookup("MyMessage.MyEnum")`).
|
||||
|
||||
For example, the following generates a JSON module `bundle.js` and a `bundle.d.ts`, but no static code:
|
||||
|
||||
```
|
||||
$> pbjs -t json-module -w commonjs -o bundle.js file1.proto file2.proto
|
||||
$> pbjs -t static-module file1.proto file2.proto | pbts -o bundle.d.ts -
|
||||
```
|
||||
|
||||
### Reflection vs. static code
|
||||
|
||||
While using .proto files directly requires the full library respectively pure reflection/JSON the light library, pretty much all code but the relatively short descriptors is shared.
|
||||
|
||||
Static code, on the other hand, requires just the minimal library, but generates additional source code without any reflection features. This also implies that there is a break-even point where statically generated code becomes larger than descriptor-based code once the amount of code generated exceeds the size of the full respectively light library.
|
||||
|
||||
There is no significant difference performance-wise as the code generated statically is pretty much the same as generated at runtime and both are largely interchangeable as seen in the previous section.
|
||||
|
||||
| Source | Library | Advantages | Tradeoffs
|
||||
|--------|---------|------------|-----------
|
||||
| .proto | full | Easily editable<br />Interoperability with other libraries<br />No compile step | Some parsing and possibly network overhead
|
||||
| JSON | light | Easily editable<br />No parsing overhead<br />Single bundle (no network overhead) | protobuf.js specific<br />Has a compile step
|
||||
| static | minimal | Works where `eval` access is restricted<br />Fully documented<br />Small footprint for small protos | Can be hard to edit<br />No reflection<br />Has a compile step
|
||||
|
||||
### Command line API
|
||||
|
||||
Both utilities can be used programmatically by providing command line arguments and a callback to their respective `main` functions:
|
||||
|
||||
```js
|
||||
var pbjs = require("protobufjs/cli/pbjs"); // or require("protobufjs/cli").pbjs / .pbts
|
||||
|
||||
pbjs.main([ "--target", "json-module", "path/to/myproto.proto" ], function(err, output) {
|
||||
if (err)
|
||||
throw err;
|
||||
// do something with output
|
||||
});
|
||||
```
|
||||
|
||||
Additional documentation
|
||||
------------------------
|
||||
|
||||
#### Protocol Buffers
|
||||
* [Google's Developer Guide](https://developers.google.com/protocol-buffers/docs/overview)
|
||||
|
||||
#### protobuf.js
|
||||
* [API Documentation](https://protobufjs.github.io/protobuf.js)
|
||||
* [CHANGELOG](https://github.com/dcodeIO/protobuf.js/blob/master/CHANGELOG.md)
|
||||
* [Frequently asked questions](https://github.com/dcodeIO/protobuf.js/wiki) on our wiki
|
||||
|
||||
#### Community
|
||||
* [Questions and answers](http://stackoverflow.com/search?tab=newest&q=protobuf.js) on StackOverflow
|
||||
|
||||
Performance
|
||||
-----------
|
||||
The package includes a benchmark that compares protobuf.js performance to native JSON (as far as this is possible) and [Google's JS implementation](https://github.com/google/protobuf/tree/master/js). On an i7-2600K running node 6.9.1 it yields:
|
||||
|
||||
```
|
||||
benchmarking encoding performance ...
|
||||
|
||||
protobuf.js (reflect) x 541,707 ops/sec ±1.13% (87 runs sampled)
|
||||
protobuf.js (static) x 548,134 ops/sec ±1.38% (89 runs sampled)
|
||||
JSON (string) x 318,076 ops/sec ±0.63% (93 runs sampled)
|
||||
JSON (buffer) x 179,165 ops/sec ±2.26% (91 runs sampled)
|
||||
google-protobuf x 74,406 ops/sec ±0.85% (86 runs sampled)
|
||||
|
||||
protobuf.js (static) was fastest
|
||||
protobuf.js (reflect) was 0.9% ops/sec slower (factor 1.0)
|
||||
JSON (string) was 41.5% ops/sec slower (factor 1.7)
|
||||
JSON (buffer) was 67.6% ops/sec slower (factor 3.1)
|
||||
google-protobuf was 86.4% ops/sec slower (factor 7.3)
|
||||
|
||||
benchmarking decoding performance ...
|
||||
|
||||
protobuf.js (reflect) x 1,383,981 ops/sec ±0.88% (93 runs sampled)
|
||||
protobuf.js (static) x 1,378,925 ops/sec ±0.81% (93 runs sampled)
|
||||
JSON (string) x 302,444 ops/sec ±0.81% (93 runs sampled)
|
||||
JSON (buffer) x 264,882 ops/sec ±0.81% (93 runs sampled)
|
||||
google-protobuf x 179,180 ops/sec ±0.64% (94 runs sampled)
|
||||
|
||||
protobuf.js (reflect) was fastest
|
||||
protobuf.js (static) was 0.3% ops/sec slower (factor 1.0)
|
||||
JSON (string) was 78.1% ops/sec slower (factor 4.6)
|
||||
JSON (buffer) was 80.8% ops/sec slower (factor 5.2)
|
||||
google-protobuf was 87.0% ops/sec slower (factor 7.7)
|
||||
|
||||
benchmarking combined performance ...
|
||||
|
||||
protobuf.js (reflect) x 275,900 ops/sec ±0.78% (90 runs sampled)
|
||||
protobuf.js (static) x 290,096 ops/sec ±0.96% (90 runs sampled)
|
||||
JSON (string) x 129,381 ops/sec ±0.77% (90 runs sampled)
|
||||
JSON (buffer) x 91,051 ops/sec ±0.94% (90 runs sampled)
|
||||
google-protobuf x 42,050 ops/sec ±0.85% (91 runs sampled)
|
||||
|
||||
protobuf.js (static) was fastest
|
||||
protobuf.js (reflect) was 4.7% ops/sec slower (factor 1.0)
|
||||
JSON (string) was 55.3% ops/sec slower (factor 2.2)
|
||||
JSON (buffer) was 68.6% ops/sec slower (factor 3.2)
|
||||
google-protobuf was 85.5% ops/sec slower (factor 6.9)
|
||||
```
|
||||
|
||||
These results are achieved by
|
||||
|
||||
* generating type-specific encoders, decoders, verifiers and converters at runtime
|
||||
* configuring the reader/writer interface according to the environment
|
||||
* using node-specific functionality where beneficial and, of course
|
||||
* avoiding unnecessary operations through splitting up [the toolset](#toolset).
|
||||
|
||||
You can also run [the benchmark](https://github.com/dcodeIO/protobuf.js/blob/master/bench/index.js) ...
|
||||
|
||||
```
|
||||
$> npm run bench
|
||||
```
|
||||
|
||||
and [the profiler](https://github.com/dcodeIO/protobuf.js/blob/master/bench/prof.js) yourself (the latter requires a recent version of node):
|
||||
|
||||
```
|
||||
$> npm run prof <encode|decode|encode-browser|decode-browser> [iterations=10000000]
|
||||
```
|
||||
|
||||
Note that as of this writing, the benchmark suite performs significantly slower on node 7.2.0 compared to 6.9.1 because moths.
|
||||
|
||||
Compatibility
|
||||
-------------
|
||||
|
||||
* Works in all modern and not-so-modern browsers except IE8.
|
||||
* Because the internals of this package do not rely on `google/protobuf/descriptor.proto`, options are parsed and presented literally.
|
||||
* If typed arrays are not supported by the environment, plain arrays will be used instead.
|
||||
* Support for pre-ES5 environments (except IE8) can be achieved by [using a polyfill](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/polyfill.js).
|
||||
* Support for [Content Security Policy](https://w3c.github.io/webappsec-csp/)-restricted environments (like Chrome extensions without [unsafe-eval](https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-eval)) can be achieved by generating and using static code instead.
|
||||
* If a proper way to work with 64 bit values (uint64, int64 etc.) is required, just install [long.js](https://github.com/dcodeIO/long.js) alongside this library. All 64 bit numbers will then be returned as a `Long` instance instead of a possibly unsafe JavaScript number ([see](https://github.com/dcodeIO/long.js)).
|
||||
* For descriptor.proto interoperability, see [ext/descriptor](https://github.com/dcodeIO/protobuf.js/tree/master/ext/descriptor)
|
||||
|
||||
Building
|
||||
--------
|
||||
|
||||
To build the library or its components yourself, clone it from GitHub and install the development dependencies:
|
||||
|
||||
```
|
||||
$> git clone https://github.com/dcodeIO/protobuf.js.git
|
||||
$> cd protobuf.js
|
||||
$> npm install
|
||||
```
|
||||
|
||||
Building the respective development and production versions with their respective source maps to `dist/`:
|
||||
|
||||
```
|
||||
$> npm run build
|
||||
```
|
||||
|
||||
Building the documentation to `docs/`:
|
||||
|
||||
```
|
||||
$> npm run docs
|
||||
```
|
||||
|
||||
Building the TypeScript definition to `index.d.ts`:
|
||||
|
||||
```
|
||||
$> npm run types
|
||||
```
|
||||
|
||||
### Browserify integration
|
||||
|
||||
By default, protobuf.js integrates into any browserify build-process without requiring any optional modules. Hence:
|
||||
|
||||
* If int64 support is required, explicitly require the `long` module somewhere in your project as it will be excluded otherwise. This assumes that a global `require` function is present that protobuf.js can call to obtain the long module.
|
||||
|
||||
If there is no global `require` function present after bundling, it's also possible to assign the long module programmatically:
|
||||
|
||||
```js
|
||||
var Long = ...;
|
||||
|
||||
protobuf.util.Long = Long;
|
||||
protobuf.configure();
|
||||
```
|
||||
|
||||
* If you have any special requirements, there is [the bundler](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/bundle.js) for reference.
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
||||
6
node_modules/protobufjs/bin/pbjs
generated
vendored
Executable file
6
node_modules/protobufjs/bin/pbjs
generated
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
var path = require("path"),
|
||||
cli = require(path.join(__dirname, "..", "cli", "pbjs.js"));
|
||||
var ret = cli.main(process.argv.slice(2));
|
||||
if (typeof ret === 'number')
|
||||
process.exit(ret);
|
||||
6
node_modules/protobufjs/bin/pbts
generated
vendored
Executable file
6
node_modules/protobufjs/bin/pbts
generated
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
var path = require("path"),
|
||||
cli = require(path.join(__dirname, "..", "cli", "pbts.js"));
|
||||
var ret = cli.main(process.argv.slice(2));
|
||||
if (typeof ret === 'number')
|
||||
process.exit(ret);
|
||||
33
node_modules/protobufjs/cli/LICENSE
generated
vendored
Normal file
33
node_modules/protobufjs/cli/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of its author, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
---
|
||||
|
||||
Code generated by the command line utilities is owned by the owner
|
||||
of the input file used when generating it. This code is not
|
||||
standalone and requires a support library to be linked with it. This
|
||||
support library is itself covered by the above license.
|
||||
174
node_modules/protobufjs/cli/README.md
generated
vendored
Normal file
174
node_modules/protobufjs/cli/README.md
generated
vendored
Normal file
@@ -0,0 +1,174 @@
|
||||
protobufjs-cli
|
||||
==============
|
||||
[](https://www.npmjs.com/package/protobufjs-cli)
|
||||
|
||||
Command line interface (CLI) for [protobuf.js](https://github.com/dcodeIO/protobuf.js). Translates between file formats and generates static code as well as TypeScript definitions.
|
||||
|
||||
* [CLI Documentation](https://github.com/dcodeIO/protobuf.js#command-line)
|
||||
|
||||
**Note** that moving the CLI to its own package is a work in progress. At the moment, it's still part of the main package.
|
||||
* [pbjs for JavaScript](#pbjs-for-javascript)
|
||||
* [pbts for TypeScript](#pbts-for-typescript)
|
||||
* [Reflection vs. static code](#reflection-vs-static-code)
|
||||
* [Command line API](#command-line-api)<br />
|
||||
|
||||
### pbjs for JavaScript
|
||||
|
||||
```
|
||||
Translates between file formats and generates static code.
|
||||
|
||||
-t, --target Specifies the target format. Also accepts a path to require a custom target.
|
||||
|
||||
json JSON representation
|
||||
json-module JSON representation as a module
|
||||
proto2 Protocol Buffers, Version 2
|
||||
proto3 Protocol Buffers, Version 3
|
||||
static Static code without reflection (non-functional on its own)
|
||||
static-module Static code without reflection as a module
|
||||
|
||||
-p, --path Adds a directory to the include path.
|
||||
|
||||
-o, --out Saves to a file instead of writing to stdout.
|
||||
|
||||
--sparse Exports only those types referenced from a main file (experimental).
|
||||
|
||||
Module targets only:
|
||||
|
||||
-w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper.
|
||||
|
||||
default Default wrapper supporting both CommonJS and AMD
|
||||
commonjs CommonJS wrapper
|
||||
amd AMD wrapper
|
||||
es6 ES6 wrapper (implies --es6)
|
||||
closure A closure adding to protobuf.roots where protobuf is a global
|
||||
|
||||
-r, --root Specifies an alternative protobuf.roots name.
|
||||
|
||||
-l, --lint Linter configuration. Defaults to protobuf.js-compatible rules:
|
||||
|
||||
eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins
|
||||
|
||||
--es6 Enables ES6 syntax (const/let instead of var)
|
||||
|
||||
Proto sources only:
|
||||
|
||||
--keep-case Keeps field casing instead of converting to camel case.
|
||||
|
||||
Static targets only:
|
||||
|
||||
--no-create Does not generate create functions used for reflection compatibility.
|
||||
--no-encode Does not generate encode functions.
|
||||
--no-decode Does not generate decode functions.
|
||||
--no-verify Does not generate verify functions.
|
||||
--no-convert Does not generate convert functions like from/toObject
|
||||
--no-delimited Does not generate delimited encode/decode functions.
|
||||
--no-beautify Does not beautify generated code.
|
||||
--no-comments Does not output any JSDoc comments.
|
||||
--no-service Does not output service classes.
|
||||
|
||||
--force-long Enforces the use of 'Long' for s-/u-/int64 and s-/fixed64 fields.
|
||||
--force-number Enforces the use of 'number' for s-/u-/int64 and s-/fixed64 fields.
|
||||
--force-message Enforces the use of message instances instead of plain objects.
|
||||
|
||||
usage: pbjs [options] file1.proto file2.json ... (or pipe) other | pbjs [options] -
|
||||
```
|
||||
|
||||
For production environments it is recommended to bundle all your .proto files to a single .json file, which minimizes the number of network requests and avoids any parser overhead (hint: works with just the **light** library):
|
||||
|
||||
```
|
||||
$> pbjs -t json file1.proto file2.proto > bundle.json
|
||||
```
|
||||
|
||||
Now, either include this file in your final bundle:
|
||||
|
||||
```js
|
||||
var root = protobuf.Root.fromJSON(require("./bundle.json"));
|
||||
```
|
||||
|
||||
or load it the usual way:
|
||||
|
||||
```js
|
||||
protobuf.load("bundle.json", function(err, root) {
|
||||
...
|
||||
});
|
||||
```
|
||||
|
||||
Generated static code, on the other hand, works with just the **minimal** library. For example
|
||||
|
||||
```
|
||||
$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto
|
||||
```
|
||||
|
||||
will generate static code for definitions within `file1.proto` and `file2.proto` to a CommonJS module `compiled.js`.
|
||||
|
||||
**ProTip!** Documenting your .proto files with `/** ... */`-blocks or (trailing) `/// ...` lines translates to generated static code.
|
||||
|
||||
|
||||
### pbts for TypeScript
|
||||
|
||||
```
|
||||
Generates TypeScript definitions from annotated JavaScript files.
|
||||
|
||||
-o, --out Saves to a file instead of writing to stdout.
|
||||
|
||||
-g, --global Name of the global object in browser environments, if any.
|
||||
|
||||
--no-comments Does not output any JSDoc comments.
|
||||
|
||||
Internal flags:
|
||||
|
||||
-n, --name Wraps everything in a module of the specified name.
|
||||
|
||||
-m, --main Whether building the main library without any imports.
|
||||
|
||||
usage: pbts [options] file1.js file2.js ... (or) other | pbts [options] -
|
||||
```
|
||||
|
||||
Picking up on the example above, the following not only generates static code to a CommonJS module `compiled.js` but also its respective TypeScript definitions to `compiled.d.ts`:
|
||||
|
||||
```
|
||||
$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto
|
||||
$> pbts -o compiled.d.ts compiled.js
|
||||
```
|
||||
|
||||
Additionally, TypeScript definitions of static modules are compatible with their reflection-based counterparts (i.e. as exported by JSON modules), as long as the following conditions are met:
|
||||
|
||||
1. Instead of using `new SomeMessage(...)`, always use `SomeMessage.create(...)` because reflection objects do not provide a constructor.
|
||||
2. Types, services and enums must start with an uppercase letter to become available as properties of the reflected types as well (i.e. to be able to use `MyMessage.MyEnum` instead of `root.lookup("MyMessage.MyEnum")`).
|
||||
|
||||
For example, the following generates a JSON module `bundle.js` and a `bundle.d.ts`, but no static code:
|
||||
|
||||
```
|
||||
$> pbjs -t json-module -w commonjs -o bundle.js file1.proto file2.proto
|
||||
$> pbjs -t static-module file1.proto file2.proto | pbts -o bundle.d.ts -
|
||||
```
|
||||
|
||||
### Reflection vs. static code
|
||||
|
||||
While using .proto files directly requires the full library respectively pure reflection/JSON the light library, pretty much all code but the relatively short descriptors is shared.
|
||||
|
||||
Static code, on the other hand, requires just the minimal library, but generates additional source code without any reflection features. This also implies that there is a break-even point where statically generated code becomes larger than descriptor-based code once the amount of code generated exceeds the size of the full respectively light library.
|
||||
|
||||
There is no significant difference performance-wise as the code generated statically is pretty much the same as generated at runtime and both are largely interchangeable as seen in the previous section.
|
||||
|
||||
| Source | Library | Advantages | Tradeoffs
|
||||
|--------|---------|------------|-----------
|
||||
| .proto | full | Easily editable<br />Interoperability with other libraries<br />No compile step | Some parsing and possibly network overhead
|
||||
| JSON | light | Easily editable<br />No parsing overhead<br />Single bundle (no network overhead) | protobuf.js specific<br />Has a compile step
|
||||
| static | minimal | Works where `eval` access is restricted<br />Fully documented<br />Small footprint for small protos | Can be hard to edit<br />No reflection<br />Has a compile step
|
||||
|
||||
### Command line API
|
||||
|
||||
Both utilities can be used programmatically by providing command line arguments and a callback to their respective `main` functions:
|
||||
|
||||
```js
|
||||
var pbjs = require("protobufjs-cli/pbjs"); // or require("protobufjs-cli").pbjs / .pbts
|
||||
|
||||
pbjs.main([ "--target", "json-module", "path/to/myproto.proto" ], function(err, output) {
|
||||
if (err)
|
||||
throw err;
|
||||
// do something with output
|
||||
});
|
||||
```
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
||||
6
node_modules/protobufjs/cli/bin/pbjs
generated
vendored
Executable file
6
node_modules/protobufjs/cli/bin/pbjs
generated
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
var path = require("path"),
|
||||
cli = require(path.join(__dirname, "..", "pbjs.js"));
|
||||
var ret = cli.main(process.argv.slice(2));
|
||||
if (typeof ret === 'number')
|
||||
process.exit(ret);
|
||||
6
node_modules/protobufjs/cli/bin/pbts
generated
vendored
Executable file
6
node_modules/protobufjs/cli/bin/pbts
generated
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
var path = require("path"),
|
||||
cli = require(path.join(__dirname, "..", "pbts.js"));
|
||||
var ret = cli.main(process.argv.slice(2));
|
||||
if (typeof ret === 'number')
|
||||
process.exit(ret);
|
||||
3
node_modules/protobufjs/cli/index.d.ts
generated
vendored
Normal file
3
node_modules/protobufjs/cli/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import * as pbjs from "./pbjs.js";
|
||||
import * as pbts from "./pbts.js";
|
||||
export { pbjs, pbts };
|
||||
3
node_modules/protobufjs/cli/index.js
generated
vendored
Normal file
3
node_modules/protobufjs/cli/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
exports.pbjs = require("./pbjs");
|
||||
exports.pbts = require("./pbts");
|
||||
18
node_modules/protobufjs/cli/lib/tsd-jsdoc.json
generated
vendored
Normal file
18
node_modules/protobufjs/cli/lib/tsd-jsdoc.json
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"tags": {
|
||||
"allowUnknownTags": false
|
||||
},
|
||||
"plugins": [
|
||||
"./tsd-jsdoc/plugin"
|
||||
],
|
||||
"opts": {
|
||||
"encoding" : "utf8",
|
||||
"recurse" : true,
|
||||
"lenient" : true,
|
||||
"template" : "./tsd-jsdoc",
|
||||
|
||||
"private" : false,
|
||||
"comments" : true,
|
||||
"destination" : false
|
||||
}
|
||||
}
|
||||
21
node_modules/protobufjs/cli/lib/tsd-jsdoc/LICENSE
generated
vendored
Normal file
21
node_modules/protobufjs/cli/lib/tsd-jsdoc/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2016 Chad Engler
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
23
node_modules/protobufjs/cli/lib/tsd-jsdoc/README.md
generated
vendored
Normal file
23
node_modules/protobufjs/cli/lib/tsd-jsdoc/README.md
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
protobuf.js fork of tsd-jsdoc
|
||||
=============================
|
||||
|
||||
This is a modified version of [tsd-jsdoc](https://github.com/englercj/tsd-jsdoc) v1.0.1 for use with protobuf.js, parked here so we can process issues and pull requests. The ultimate goal is to switch back to the a recent version of tsd-jsdoc once it meets our needs.
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
* **module: `string`**<br />
|
||||
Wraps everything in a module of the specified name.
|
||||
|
||||
* **private: `boolean`**<br />
|
||||
Includes private members when set to `true`.
|
||||
|
||||
* **comments: `boolean`**<br />
|
||||
Skips comments when explicitly set to `false`.
|
||||
|
||||
* **destination: `string|boolean`**<br />
|
||||
Saves to the specified destination file or to console when set to `false`.
|
||||
|
||||
Setting options on the command line
|
||||
-----------------------------------
|
||||
Providing `-q, --query <queryString>` on the command line will set respectively override existing options. Example: `-q module=protobufjs`
|
||||
21
node_modules/protobufjs/cli/lib/tsd-jsdoc/plugin.js
generated
vendored
Normal file
21
node_modules/protobufjs/cli/lib/tsd-jsdoc/plugin.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
exports.defineTags = function(dictionary) {
|
||||
|
||||
dictionary.defineTag("template", {
|
||||
mustHaveValue: true,
|
||||
canHaveType: false,
|
||||
canHaveName: false,
|
||||
onTagged: function(doclet, tag) {
|
||||
(doclet.templates || (doclet.templates = [])).push(tag.text);
|
||||
}
|
||||
});
|
||||
|
||||
dictionary.defineTag("tstype", {
|
||||
mustHaveValue: true,
|
||||
canHaveType: false,
|
||||
canHaveName: false,
|
||||
onTagged: function(doclet, tag) {
|
||||
doclet.tsType = tag.text;
|
||||
}
|
||||
});
|
||||
};
|
||||
705
node_modules/protobufjs/cli/lib/tsd-jsdoc/publish.js
generated
vendored
Normal file
705
node_modules/protobufjs/cli/lib/tsd-jsdoc/publish.js
generated
vendored
Normal file
@@ -0,0 +1,705 @@
|
||||
"use strict";
|
||||
|
||||
var fs = require("fs");
|
||||
|
||||
// output stream
|
||||
var out = null;
|
||||
|
||||
// documentation data
|
||||
var data = null;
|
||||
|
||||
// already handled objects, by name
|
||||
var seen = {};
|
||||
|
||||
// indentation level
|
||||
var indent = 0;
|
||||
|
||||
// whether indent has been written for the current line yet
|
||||
var indentWritten = false;
|
||||
|
||||
// provided options
|
||||
var options = {};
|
||||
|
||||
// queued interfaces
|
||||
var queuedInterfaces = [];
|
||||
|
||||
// whether writing the first line
|
||||
var firstLine = true;
|
||||
|
||||
// JSDoc hook
|
||||
exports.publish = function publish(taffy, opts) {
|
||||
options = opts || {};
|
||||
|
||||
// query overrides options
|
||||
if (options.query)
|
||||
Object.keys(options.query).forEach(function(key) {
|
||||
if (key !== "query")
|
||||
switch (options[key] = options.query[key]) {
|
||||
case "true":
|
||||
options[key] = true;
|
||||
break;
|
||||
case "false":
|
||||
options[key] = false;
|
||||
break;
|
||||
case "null":
|
||||
options[key] = null;
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
// remove undocumented
|
||||
taffy({ undocumented: true }).remove();
|
||||
taffy({ ignore: true }).remove();
|
||||
taffy({ inherited: true }).remove();
|
||||
|
||||
// remove private
|
||||
if (!options.private)
|
||||
taffy({ access: "private" }).remove();
|
||||
|
||||
// setup output
|
||||
out = options.destination
|
||||
? fs.createWriteStream(options.destination)
|
||||
: process.stdout;
|
||||
|
||||
try {
|
||||
// setup environment
|
||||
data = taffy().get();
|
||||
indent = 0;
|
||||
indentWritten = false;
|
||||
firstLine = true;
|
||||
|
||||
// wrap everything in a module if configured
|
||||
if (options.module) {
|
||||
writeln("export = ", options.module, ";");
|
||||
writeln();
|
||||
writeln("declare namespace ", options.module, " {");
|
||||
writeln();
|
||||
++indent;
|
||||
}
|
||||
|
||||
// handle all
|
||||
getChildrenOf(undefined).forEach(function(child) {
|
||||
handleElement(child, null);
|
||||
});
|
||||
|
||||
// process queued
|
||||
while (queuedInterfaces.length) {
|
||||
var element = queuedInterfaces.shift();
|
||||
begin(element);
|
||||
writeInterface(element);
|
||||
writeln(";");
|
||||
}
|
||||
|
||||
// end wrap
|
||||
if (options.module) {
|
||||
--indent;
|
||||
writeln("}");
|
||||
}
|
||||
|
||||
// close file output
|
||||
if (out !== process.stdout)
|
||||
out.end();
|
||||
|
||||
} finally {
|
||||
// gc environment objects
|
||||
out = data = null;
|
||||
seen = options = {};
|
||||
queuedInterfaces = [];
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// Utility
|
||||
//
|
||||
|
||||
// writes one or multiple strings
|
||||
function write() {
|
||||
var s = Array.prototype.slice.call(arguments).join("");
|
||||
if (!indentWritten) {
|
||||
for (var i = 0; i < indent; ++i)
|
||||
s = " " + s;
|
||||
indentWritten = true;
|
||||
}
|
||||
out.write(s);
|
||||
firstLine = false;
|
||||
}
|
||||
|
||||
// writes zero or multiple strings, followed by a new line
|
||||
function writeln() {
|
||||
var s = Array.prototype.slice.call(arguments).join("");
|
||||
if (s.length)
|
||||
write(s, "\n");
|
||||
else if (!firstLine)
|
||||
out.write("\n");
|
||||
indentWritten = false;
|
||||
}
|
||||
|
||||
var keepTags = [
|
||||
"param",
|
||||
"returns",
|
||||
"throws",
|
||||
"see"
|
||||
];
|
||||
|
||||
// parses a comment into text and tags
|
||||
function parseComment(comment) {
|
||||
var lines = comment.replace(/^ *\/\*\* *|^ *\*\/| *\*\/ *$|^ *\* */mg, "").trim().split(/\r?\n|\r/g); // property.description has just "\r" ?!
|
||||
var desc;
|
||||
var text = [];
|
||||
var tags = null;
|
||||
for (var i = 0; i < lines.length; ++i) {
|
||||
var match = /^@(\w+)\b/.exec(lines[i]);
|
||||
if (match) {
|
||||
if (!tags) {
|
||||
tags = [];
|
||||
desc = text;
|
||||
}
|
||||
text = [];
|
||||
tags.push({ name: match[1], text: text });
|
||||
lines[i] = lines[i].substring(match[1].length + 1).trim();
|
||||
}
|
||||
if (lines[i].length || text.length)
|
||||
text.push(lines[i]);
|
||||
}
|
||||
return {
|
||||
text: desc || text,
|
||||
tags: tags || []
|
||||
};
|
||||
}
|
||||
|
||||
// writes a comment
|
||||
function writeComment(comment, otherwiseNewline) {
|
||||
if (!comment || options.comments === false) {
|
||||
if (otherwiseNewline)
|
||||
writeln();
|
||||
return;
|
||||
}
|
||||
if (typeof comment !== "object")
|
||||
comment = parseComment(comment);
|
||||
comment.tags = comment.tags.filter(function(tag) {
|
||||
return keepTags.indexOf(tag.name) > -1 && (tag.name !== "returns" || tag.text[0] !== "{undefined}");
|
||||
});
|
||||
writeln();
|
||||
if (!comment.tags.length && comment.text.length < 2) {
|
||||
writeln("/** " + comment.text[0] + " */");
|
||||
return;
|
||||
}
|
||||
writeln("/**");
|
||||
comment.text.forEach(function(line) {
|
||||
if (line.length)
|
||||
writeln(" * ", line);
|
||||
else
|
||||
writeln(" *");
|
||||
});
|
||||
comment.tags.forEach(function(tag) {
|
||||
var started = false;
|
||||
if (tag.text.length) {
|
||||
tag.text.forEach(function(line, i) {
|
||||
if (i > 0)
|
||||
write(" * ");
|
||||
else if (tag.name !== "throws")
|
||||
line = line.replace(/^\{[^\s]*} ?/, "");
|
||||
if (!line.length)
|
||||
return;
|
||||
if (!started) {
|
||||
write(" * @", tag.name, " ");
|
||||
started = true;
|
||||
}
|
||||
writeln(line);
|
||||
});
|
||||
}
|
||||
});
|
||||
writeln(" */");
|
||||
}
|
||||
|
||||
// recursively replaces all occurencies of re's match
|
||||
function replaceRecursive(name, re, fn) {
|
||||
var found;
|
||||
|
||||
function replacer() {
|
||||
found = true;
|
||||
return fn.apply(null, arguments);
|
||||
}
|
||||
|
||||
do {
|
||||
found = false;
|
||||
name = name.replace(re, replacer);
|
||||
} while (found);
|
||||
return name;
|
||||
}
|
||||
|
||||
// tests if an element is considered to be a class or class-like
|
||||
function isClassLike(element) {
|
||||
return isClass(element) || isInterface(element);
|
||||
}
|
||||
|
||||
// tests if an element is considered to be a class
|
||||
function isClass(element) {
|
||||
return element && element.kind === "class";
|
||||
}
|
||||
|
||||
// tests if an element is considered to be an interface
|
||||
function isInterface(element) {
|
||||
return element && (element.kind === "interface" || element.kind === "mixin");
|
||||
}
|
||||
|
||||
// tests if an element is considered to be a namespace
|
||||
function isNamespace(element) {
|
||||
return element && (element.kind === "namespace" || element.kind === "module");
|
||||
}
|
||||
|
||||
// gets all children of the specified parent
|
||||
function getChildrenOf(parent) {
|
||||
var memberof = parent ? parent.longname : undefined;
|
||||
return data.filter(function(element) {
|
||||
return element.memberof === memberof;
|
||||
});
|
||||
}
|
||||
|
||||
// gets the literal type of an element
|
||||
function getTypeOf(element) {
|
||||
if (element.tsType)
|
||||
return element.tsType.replace(/\r?\n|\r/g, "\n");
|
||||
var name = "any";
|
||||
var type = element.type;
|
||||
if (type && type.names && type.names.length) {
|
||||
if (type.names.length === 1)
|
||||
name = element.type.names[0].trim();
|
||||
else
|
||||
name = "(" + element.type.names.join("|") + ")";
|
||||
} else
|
||||
return name;
|
||||
|
||||
// Replace catchalls with any
|
||||
name = name.replace(/\*|\bmixed\b/g, "any");
|
||||
|
||||
// Ensure upper case Object for map expressions below
|
||||
name = name.replace(/\bobject\b/g, "Object");
|
||||
|
||||
// Correct Something.<Something> to Something<Something>
|
||||
name = replaceRecursive(name, /\b(?!Object|Array)([\w$]+)\.<([^>]*)>/gi, function($0, $1, $2) {
|
||||
return $1 + "<" + $2 + ">";
|
||||
});
|
||||
|
||||
// Replace Array.<string> with string[]
|
||||
name = replaceRecursive(name, /\bArray\.?<([^>]*)>/gi, function($0, $1) {
|
||||
return $1 + "[]";
|
||||
});
|
||||
|
||||
// Replace Object.<string,number> with { [k: string]: number }
|
||||
name = replaceRecursive(name, /\bObject\.?<([^,]*), *([^>]*)>/gi, function($0, $1, $2) {
|
||||
return "{ [k: " + $1 + "]: " + $2 + " }";
|
||||
});
|
||||
|
||||
// Replace functions (there are no signatures) with Function
|
||||
name = name.replace(/\bfunction(?:\(\))?\b/g, "Function");
|
||||
|
||||
// Convert plain Object back to just object
|
||||
name = name.replace(/\b(Object\b(?!\.))/g, function($0, $1) {
|
||||
return $1.toLowerCase();
|
||||
});
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
// begins writing the definition of the specified element
|
||||
function begin(element, is_interface) {
|
||||
if (!seen[element.longname]) {
|
||||
if (isClass(element)) {
|
||||
var comment = parseComment(element.comment);
|
||||
var classdesc = comment.tags.find(function(tag) { return tag.name === "classdesc"; });
|
||||
if (classdesc) {
|
||||
comment.text = classdesc.text;
|
||||
comment.tags = [];
|
||||
}
|
||||
writeComment(comment, true);
|
||||
} else
|
||||
writeComment(element.comment, is_interface || isClassLike(element) || isNamespace(element) || element.isEnum || element.scope === "global");
|
||||
seen[element.longname] = element;
|
||||
} else
|
||||
writeln();
|
||||
// ????: something changed in JSDoc 3.6.0? so that @exports + @enum does
|
||||
// no longer yield a 'global' scope, but is some sort of unscoped module
|
||||
// element now. The additional condition added below works around this.
|
||||
if ((element.scope === "global" || element.isEnum && element.scope === undefined) && !options.module)
|
||||
write("export ");
|
||||
}
|
||||
|
||||
// writes the function signature describing element
|
||||
function writeFunctionSignature(element, isConstructor, isTypeDef) {
|
||||
write("(");
|
||||
|
||||
var params = {};
|
||||
|
||||
// this type
|
||||
if (element.this)
|
||||
params["this"] = {
|
||||
type: element.this.replace(/^{|}$/g, ""),
|
||||
optional: false
|
||||
};
|
||||
|
||||
// parameter types
|
||||
if (element.params)
|
||||
element.params.forEach(function(param) {
|
||||
var path = param.name.split(/\./g);
|
||||
if (path.length === 1)
|
||||
params[param.name] = {
|
||||
type: getTypeOf(param),
|
||||
variable: param.variable === true,
|
||||
optional: param.optional === true,
|
||||
defaultValue: param.defaultvalue // Not used yet (TODO)
|
||||
};
|
||||
else // Property syntax (TODO)
|
||||
params[path[0]].type = "{ [k: string]: any }";
|
||||
});
|
||||
|
||||
var paramNames = Object.keys(params);
|
||||
paramNames.forEach(function(name, i) {
|
||||
var param = params[name];
|
||||
var type = param.type;
|
||||
if (param.variable) {
|
||||
name = "..." + name;
|
||||
type = param.type.charAt(0) === "(" ? "any[]" : param.type + "[]";
|
||||
}
|
||||
write(name, !param.variable && param.optional ? "?: " : ": ", type);
|
||||
if (i < paramNames.length - 1)
|
||||
write(", ");
|
||||
});
|
||||
|
||||
write(")");
|
||||
|
||||
// return type
|
||||
if (!isConstructor) {
|
||||
write(isTypeDef ? " => " : ": ");
|
||||
var typeName;
|
||||
if (element.returns && element.returns.length && (typeName = getTypeOf(element.returns[0])) !== "undefined")
|
||||
write(typeName);
|
||||
else
|
||||
write("void");
|
||||
}
|
||||
}
|
||||
|
||||
// writes (a typedef as) an interface
|
||||
function writeInterface(element) {
|
||||
write("interface ", element.name);
|
||||
writeInterfaceBody(element);
|
||||
writeln();
|
||||
}
|
||||
|
||||
function writeInterfaceBody(element) {
|
||||
writeln("{");
|
||||
++indent;
|
||||
if (element.tsType)
|
||||
writeln(element.tsType.replace(/\r?\n|\r/g, "\n"));
|
||||
else if (element.properties && element.properties.length)
|
||||
element.properties.forEach(writeProperty);
|
||||
--indent;
|
||||
write("}");
|
||||
}
|
||||
|
||||
function writeProperty(property, declare) {
|
||||
writeComment(property.description);
|
||||
if (declare)
|
||||
write("let ");
|
||||
write(property.name);
|
||||
if (property.optional)
|
||||
write("?");
|
||||
writeln(": ", getTypeOf(property), ";");
|
||||
}
|
||||
|
||||
//
|
||||
// Handlers
|
||||
//
|
||||
|
||||
// handles a single element of any understood type
|
||||
function handleElement(element, parent) {
|
||||
if (element.scope === "inner")
|
||||
return false;
|
||||
|
||||
if (element.optional !== true && element.type && element.type.names && element.type.names.length) {
|
||||
for (var i = 0; i < element.type.names.length; i++) {
|
||||
if (element.type.names[i].toLowerCase() === "undefined") {
|
||||
// This element is actually optional. Set optional to true and
|
||||
// remove the 'undefined' type
|
||||
element.optional = true;
|
||||
element.type.names.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (seen[element.longname])
|
||||
return true;
|
||||
if (isClassLike(element))
|
||||
handleClass(element, parent);
|
||||
else switch (element.kind) {
|
||||
case "module":
|
||||
if (element.isEnum) {
|
||||
handleEnum(element, parent);
|
||||
break;
|
||||
}
|
||||
// eslint-disable-line no-fallthrough
|
||||
case "namespace":
|
||||
handleNamespace(element, parent);
|
||||
break;
|
||||
case "constant":
|
||||
case "member":
|
||||
handleMember(element, parent);
|
||||
break;
|
||||
case "function":
|
||||
handleFunction(element, parent);
|
||||
break;
|
||||
case "typedef":
|
||||
handleTypeDef(element, parent);
|
||||
break;
|
||||
case "package":
|
||||
break;
|
||||
}
|
||||
seen[element.longname] = element;
|
||||
return true;
|
||||
}
|
||||
|
||||
// handles (just) a namespace
|
||||
function handleNamespace(element/*, parent*/) {
|
||||
var children = getChildrenOf(element);
|
||||
if (!children.length)
|
||||
return;
|
||||
var first = true;
|
||||
if (element.properties)
|
||||
element.properties.forEach(function(property) {
|
||||
if (!/^[$\w]+$/.test(property.name)) // incompatible in namespace
|
||||
return;
|
||||
if (first) {
|
||||
begin(element);
|
||||
writeln("namespace ", element.name, " {");
|
||||
++indent;
|
||||
first = false;
|
||||
}
|
||||
writeProperty(property, true);
|
||||
});
|
||||
children.forEach(function(child) {
|
||||
if (child.scope === "inner" || seen[child.longname])
|
||||
return;
|
||||
if (first) {
|
||||
begin(element);
|
||||
writeln("namespace ", element.name, " {");
|
||||
++indent;
|
||||
first = false;
|
||||
}
|
||||
handleElement(child, element);
|
||||
});
|
||||
if (!first) {
|
||||
--indent;
|
||||
writeln("}");
|
||||
}
|
||||
}
|
||||
|
||||
// a filter function to remove any module references
|
||||
function notAModuleReference(ref) {
|
||||
return ref.indexOf("module:") === -1;
|
||||
}
|
||||
|
||||
// handles a class or class-like
|
||||
function handleClass(element, parent) {
|
||||
var is_interface = isInterface(element);
|
||||
begin(element, is_interface);
|
||||
if (is_interface)
|
||||
write("interface ");
|
||||
else {
|
||||
if (element.virtual)
|
||||
write("abstract ");
|
||||
write("class ");
|
||||
}
|
||||
write(element.name);
|
||||
if (element.templates && element.templates.length)
|
||||
write("<", element.templates.join(", "), ">");
|
||||
write(" ");
|
||||
|
||||
// extended classes
|
||||
if (element.augments) {
|
||||
var augments = element.augments.filter(notAModuleReference);
|
||||
if (augments.length)
|
||||
write("extends ", augments[0], " ");
|
||||
}
|
||||
|
||||
// implemented interfaces
|
||||
var impls = [];
|
||||
if (element.implements)
|
||||
Array.prototype.push.apply(impls, element.implements);
|
||||
if (element.mixes)
|
||||
Array.prototype.push.apply(impls, element.mixes);
|
||||
impls = impls.filter(notAModuleReference);
|
||||
if (impls.length)
|
||||
write("implements ", impls.join(", "), " ");
|
||||
|
||||
writeln("{");
|
||||
++indent;
|
||||
|
||||
if (element.tsType)
|
||||
writeln(element.tsType.replace(/\r?\n|\r/g, "\n"));
|
||||
|
||||
// constructor
|
||||
if (!is_interface && !element.virtual)
|
||||
handleFunction(element, parent, true);
|
||||
|
||||
// properties
|
||||
if (is_interface && element.properties)
|
||||
element.properties.forEach(function(property) {
|
||||
writeProperty(property);
|
||||
});
|
||||
|
||||
// class-compatible members
|
||||
var incompatible = [];
|
||||
getChildrenOf(element).forEach(function(child) {
|
||||
if (isClassLike(child) || child.kind === "module" || child.kind === "typedef" || child.isEnum) {
|
||||
incompatible.push(child);
|
||||
return;
|
||||
}
|
||||
handleElement(child, element);
|
||||
});
|
||||
|
||||
--indent;
|
||||
writeln("}");
|
||||
|
||||
// class-incompatible members
|
||||
if (incompatible.length) {
|
||||
writeln();
|
||||
if (element.scope === "global" && !options.module)
|
||||
write("export ");
|
||||
writeln("namespace ", element.name, " {");
|
||||
++indent;
|
||||
incompatible.forEach(function(child) {
|
||||
handleElement(child, element);
|
||||
});
|
||||
--indent;
|
||||
writeln("}");
|
||||
}
|
||||
}
|
||||
|
||||
// handles an enum
|
||||
function handleEnum(element) {
|
||||
begin(element);
|
||||
|
||||
var stringEnum = false;
|
||||
element.properties.forEach(function(property) {
|
||||
if (isNaN(property.defaultvalue)) {
|
||||
stringEnum = true;
|
||||
}
|
||||
});
|
||||
if (stringEnum) {
|
||||
writeln("type ", element.name, " =");
|
||||
++indent;
|
||||
element.properties.forEach(function(property, i) {
|
||||
write(i === 0 ? "" : "| ", JSON.stringify(property.defaultvalue));
|
||||
});
|
||||
--indent;
|
||||
writeln(";");
|
||||
} else {
|
||||
writeln("enum ", element.name, " {");
|
||||
++indent;
|
||||
element.properties.forEach(function(property, i) {
|
||||
write(property.name);
|
||||
if (property.defaultvalue !== undefined)
|
||||
write(" = ", JSON.stringify(property.defaultvalue));
|
||||
if (i < element.properties.length - 1)
|
||||
writeln(",");
|
||||
else
|
||||
writeln();
|
||||
});
|
||||
--indent;
|
||||
writeln("}");
|
||||
}
|
||||
}
|
||||
|
||||
// handles a namespace or class member
|
||||
function handleMember(element, parent) {
|
||||
if (element.isEnum) {
|
||||
handleEnum(element);
|
||||
return;
|
||||
}
|
||||
begin(element);
|
||||
|
||||
var inClass = isClassLike(parent);
|
||||
if (inClass) {
|
||||
write(element.access || "public", " ");
|
||||
if (element.scope === "static")
|
||||
write("static ");
|
||||
if (element.readonly)
|
||||
write("readonly ");
|
||||
} else
|
||||
write(element.kind === "constant" ? "const " : "let ");
|
||||
|
||||
write(element.name);
|
||||
if (element.optional)
|
||||
write("?");
|
||||
write(": ");
|
||||
|
||||
if (element.type && element.type.names && /^Object\b/i.test(element.type.names[0]) && element.properties) {
|
||||
writeln("{");
|
||||
++indent;
|
||||
element.properties.forEach(function(property, i) {
|
||||
writeln(JSON.stringify(property.name), ": ", getTypeOf(property), i < element.properties.length - 1 ? "," : "");
|
||||
});
|
||||
--indent;
|
||||
writeln("};");
|
||||
} else
|
||||
writeln(getTypeOf(element), ";");
|
||||
}
|
||||
|
||||
// handles a function or method
|
||||
function handleFunction(element, parent, isConstructor) {
|
||||
var insideClass = true;
|
||||
if (isConstructor) {
|
||||
writeComment(element.comment);
|
||||
write("constructor");
|
||||
} else {
|
||||
begin(element);
|
||||
insideClass = isClassLike(parent);
|
||||
if (insideClass) {
|
||||
write(element.access || "public", " ");
|
||||
if (element.scope === "static")
|
||||
write("static ");
|
||||
} else
|
||||
write("function ");
|
||||
write(element.name);
|
||||
if (element.templates && element.templates.length)
|
||||
write("<", element.templates.join(", "), ">");
|
||||
}
|
||||
writeFunctionSignature(element, isConstructor, false);
|
||||
writeln(";");
|
||||
if (!insideClass)
|
||||
handleNamespace(element);
|
||||
}
|
||||
|
||||
// handles a type definition (not a real type)
|
||||
function handleTypeDef(element, parent) {
|
||||
if (isInterface(element)) {
|
||||
if (isClassLike(parent))
|
||||
queuedInterfaces.push(element);
|
||||
else {
|
||||
begin(element);
|
||||
writeInterface(element);
|
||||
}
|
||||
} else {
|
||||
writeComment(element.comment, true);
|
||||
write("type ", element.name);
|
||||
if (element.templates && element.templates.length)
|
||||
write("<", element.templates.join(", "), ">");
|
||||
write(" = ");
|
||||
if (element.tsType)
|
||||
write(element.tsType.replace(/\r?\n|\r/g, "\n"));
|
||||
else {
|
||||
var type = getTypeOf(element);
|
||||
if (element.type && element.type.names.length === 1 && element.type.names[0] === "function")
|
||||
writeFunctionSignature(element, false, true);
|
||||
else if (type === "object") {
|
||||
if (element.properties && element.properties.length)
|
||||
writeInterfaceBody(element);
|
||||
else
|
||||
write("{}");
|
||||
} else
|
||||
write(type);
|
||||
}
|
||||
writeln(";");
|
||||
}
|
||||
}
|
||||
473
node_modules/protobufjs/cli/node_modules/.package-lock.json
generated
vendored
Normal file
473
node_modules/protobufjs/cli/node_modules/.package-lock.json
generated
vendored
Normal file
@@ -0,0 +1,473 @@
|
||||
{
|
||||
"name": "cli",
|
||||
"version": "6.9.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"..": {
|
||||
"name": "protobufjs",
|
||||
"version": "6.11.3",
|
||||
"extraneous": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@protobufjs/aspromise": "^1.1.2",
|
||||
"@protobufjs/base64": "^1.1.2",
|
||||
"@protobufjs/codegen": "^2.0.4",
|
||||
"@protobufjs/eventemitter": "^1.1.0",
|
||||
"@protobufjs/fetch": "^1.1.0",
|
||||
"@protobufjs/float": "^1.0.2",
|
||||
"@protobufjs/inquire": "^1.1.0",
|
||||
"@protobufjs/path": "^1.1.2",
|
||||
"@protobufjs/pool": "^1.1.0",
|
||||
"@protobufjs/utf8": "^1.1.0",
|
||||
"@types/long": "^4.0.1",
|
||||
"@types/node": ">=13.7.0",
|
||||
"long": "^4.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"pbjs": "bin/pbjs",
|
||||
"pbts": "bin/pbts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"benchmark": "^2.1.4",
|
||||
"browserify": "^17.0.0",
|
||||
"browserify-wrap": "^1.0.2",
|
||||
"bundle-collapser": "^1.3.0",
|
||||
"chalk": "^4.0.0",
|
||||
"escodegen": "^1.13.0",
|
||||
"eslint": "^8.15.0",
|
||||
"espree": "^7.0.0",
|
||||
"estraverse": "^5.1.0",
|
||||
"gh-pages": "^3.0.0",
|
||||
"git-raw-commits": "^2.0.3",
|
||||
"git-semver-tags": "^4.0.0",
|
||||
"glob": "^7.2.1",
|
||||
"google-protobuf": "^3.11.3",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-header": "^2.0.9",
|
||||
"gulp-if": "^3.0.0",
|
||||
"gulp-sourcemaps": "^2.6.5",
|
||||
"gulp-uglify": "^3.0.2",
|
||||
"jaguarjs-jsdoc": "github:dcodeIO/jaguarjs-jsdoc",
|
||||
"jsdoc": "^3.6.3",
|
||||
"minimist": "^1.2.0",
|
||||
"nyc": "^15.0.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"semver": "^7.1.2",
|
||||
"tape": "^5.0.0",
|
||||
"tmp": "^0.2.0",
|
||||
"tslint": "^6.0.0",
|
||||
"typescript": "^3.7.5",
|
||||
"uglify-js": "^3.7.7",
|
||||
"vinyl-buffer": "^1.0.1",
|
||||
"vinyl-fs": "^3.0.3",
|
||||
"vinyl-source-stream": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.18.13",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/linkify-it": {
|
||||
"version": "3.0.2",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/markdown-it": {
|
||||
"version": "12.2.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/linkify-it": "*",
|
||||
"@types/mdurl": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/mdurl": {
|
||||
"version": "1.0.2",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.8.0",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn-jsx": {
|
||||
"version": "5.3.2",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/argparse": {
|
||||
"version": "2.0.1",
|
||||
"license": "Python-2.0"
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
},
|
||||
"node_modules/bluebird": {
|
||||
"version": "3.7.2",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/catharsis": {
|
||||
"version": "0.9.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.15"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "2.1.0",
|
||||
"license": "BSD-2-Clause",
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/escape-string-regexp": {
|
||||
"version": "2.0.0",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/escodegen": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz",
|
||||
"integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==",
|
||||
"dependencies": {
|
||||
"esprima": "^4.0.1",
|
||||
"estraverse": "^5.2.0",
|
||||
"esutils": "^2.0.2"
|
||||
},
|
||||
"bin": {
|
||||
"escodegen": "bin/escodegen.js",
|
||||
"esgenerate": "bin/esgenerate.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"source-map": "~0.6.1"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-visitor-keys": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
|
||||
"integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/espree": {
|
||||
"version": "7.3.1",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
|
||||
"integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==",
|
||||
"dependencies": {
|
||||
"acorn": "^7.4.0",
|
||||
"acorn-jsx": "^5.3.1",
|
||||
"eslint-visitor-keys": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10.12.0 || >=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/espree/node_modules/acorn": {
|
||||
"version": "7.4.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
|
||||
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/esprima": {
|
||||
"version": "4.0.1",
|
||||
"license": "BSD-2-Clause",
|
||||
"bin": {
|
||||
"esparse": "bin/esparse.js",
|
||||
"esvalidate": "bin/esvalidate.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/estraverse": {
|
||||
"version": "5.3.0",
|
||||
"license": "BSD-2-Clause",
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/esutils": {
|
||||
"version": "2.0.3",
|
||||
"license": "BSD-2-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "7.2.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.1.1",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.10",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/inflight": {
|
||||
"version": "1.0.6",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/js2xmlparser": {
|
||||
"version": "4.0.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"xmlcreate": "^2.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/jsdoc": {
|
||||
"version": "3.6.11",
|
||||
"resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.11.tgz",
|
||||
"integrity": "sha512-8UCU0TYeIYD9KeLzEcAu2q8N/mx9O3phAGl32nmHlE0LpaJL71mMkP4d+QE5zWfNt50qheHtOZ0qoxVrsX5TUg==",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.9.4",
|
||||
"@types/markdown-it": "^12.2.3",
|
||||
"bluebird": "^3.7.2",
|
||||
"catharsis": "^0.9.0",
|
||||
"escape-string-regexp": "^2.0.0",
|
||||
"js2xmlparser": "^4.0.2",
|
||||
"klaw": "^3.0.0",
|
||||
"markdown-it": "^12.3.2",
|
||||
"markdown-it-anchor": "^8.4.1",
|
||||
"marked": "^4.0.10",
|
||||
"mkdirp": "^1.0.4",
|
||||
"requizzle": "^0.2.3",
|
||||
"strip-json-comments": "^3.1.0",
|
||||
"taffydb": "2.6.2",
|
||||
"underscore": "~1.13.2"
|
||||
},
|
||||
"bin": {
|
||||
"jsdoc": "jsdoc.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/klaw": {
|
||||
"version": "3.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.1.9"
|
||||
}
|
||||
},
|
||||
"node_modules/linkify-it": {
|
||||
"version": "3.0.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"uc.micro": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/markdown-it": {
|
||||
"version": "12.3.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1",
|
||||
"entities": "~2.1.0",
|
||||
"linkify-it": "^3.0.1",
|
||||
"mdurl": "^1.0.1",
|
||||
"uc.micro": "^1.0.5"
|
||||
},
|
||||
"bin": {
|
||||
"markdown-it": "bin/markdown-it.js"
|
||||
}
|
||||
},
|
||||
"node_modules/markdown-it-anchor": {
|
||||
"version": "8.6.4",
|
||||
"license": "Unlicense",
|
||||
"peerDependencies": {
|
||||
"@types/markdown-it": "*",
|
||||
"markdown-it": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/marked": {
|
||||
"version": "4.0.19",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"marked": "bin/marked.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/mdurl": {
|
||||
"version": "1.0.1",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/mkdirp": {
|
||||
"version": "1.0.4",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"mkdirp": "bin/cmd.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/requizzle": {
|
||||
"version": "0.2.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.14"
|
||||
}
|
||||
},
|
||||
"node_modules/rimraf": {
|
||||
"version": "3.0.2",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"rimraf": "bin.js"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"license": "BSD-3-Clause",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-json-comments": {
|
||||
"version": "3.1.1",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/taffydb": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz",
|
||||
"integrity": "sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA=="
|
||||
},
|
||||
"node_modules/tmp": {
|
||||
"version": "0.2.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"rimraf": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.17.0"
|
||||
}
|
||||
},
|
||||
"node_modules/uc.micro": {
|
||||
"version": "1.0.6",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/underscore": {
|
||||
"version": "1.13.4",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/xmlcreate": {
|
||||
"version": "2.0.4",
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
1073
node_modules/protobufjs/cli/node_modules/@babel/parser/CHANGELOG.md
generated
vendored
Normal file
1073
node_modules/protobufjs/cli/node_modules/@babel/parser/CHANGELOG.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
19
node_modules/protobufjs/cli/node_modules/@babel/parser/LICENSE
generated
vendored
Normal file
19
node_modules/protobufjs/cli/node_modules/@babel/parser/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (C) 2012-2014 by various contributors (see AUTHORS)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
19
node_modules/protobufjs/cli/node_modules/@babel/parser/README.md
generated
vendored
Normal file
19
node_modules/protobufjs/cli/node_modules/@babel/parser/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/parser
|
||||
|
||||
> A JavaScript parser
|
||||
|
||||
See our website [@babel/parser](https://babeljs.io/docs/en/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%20(babylon)%22+is%3Aopen) associated with this package.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/parser
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/parser --dev
|
||||
```
|
||||
15
node_modules/protobufjs/cli/node_modules/@babel/parser/bin/babel-parser.js
generated
vendored
Executable file
15
node_modules/protobufjs/cli/node_modules/@babel/parser/bin/babel-parser.js
generated
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env node
|
||||
/* eslint no-var: 0 */
|
||||
|
||||
var parser = require("..");
|
||||
var fs = require("fs");
|
||||
|
||||
var filename = process.argv[2];
|
||||
if (!filename) {
|
||||
console.error("no filename specified");
|
||||
} else {
|
||||
var file = fs.readFileSync(filename, "utf8");
|
||||
var ast = parser.parse(file);
|
||||
|
||||
console.log(JSON.stringify(ast, null, " "));
|
||||
}
|
||||
5
node_modules/protobufjs/cli/node_modules/@babel/parser/index.cjs
generated
vendored
Normal file
5
node_modules/protobufjs/cli/node_modules/@babel/parser/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
try {
|
||||
module.exports = require("./lib/index.cjs");
|
||||
} catch {
|
||||
module.exports = require("./lib/index.js");
|
||||
}
|
||||
16800
node_modules/protobufjs/cli/node_modules/@babel/parser/lib/index.js
generated
vendored
Normal file
16800
node_modules/protobufjs/cli/node_modules/@babel/parser/lib/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/protobufjs/cli/node_modules/@babel/parser/lib/index.js.map
generated
vendored
Normal file
1
node_modules/protobufjs/cli/node_modules/@babel/parser/lib/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
46
node_modules/protobufjs/cli/node_modules/@babel/parser/package.json
generated
vendored
Normal file
46
node_modules/protobufjs/cli/node_modules/@babel/parser/package.json
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "@babel/parser",
|
||||
"version": "7.18.13",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-parser",
|
||||
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"keywords": [
|
||||
"babel",
|
||||
"javascript",
|
||||
"parser",
|
||||
"tc39",
|
||||
"ecmascript",
|
||||
"@babel/parser"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-parser"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"types": "./typings/babel-parser.d.ts",
|
||||
"files": [
|
||||
"bin",
|
||||
"lib",
|
||||
"typings",
|
||||
"index.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/code-frame": "^7.18.6",
|
||||
"@babel/helper-check-duplicate-nodes": "^7.18.6",
|
||||
"@babel/helper-fixtures": "^7.18.6",
|
||||
"@babel/helper-string-parser": "^7.18.10",
|
||||
"@babel/helper-validator-identifier": "^7.18.6",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
"bin": "./bin/babel-parser.js",
|
||||
"type": "commonjs"
|
||||
}
|
||||
214
node_modules/protobufjs/cli/node_modules/@babel/parser/typings/babel-parser.d.ts
generated
vendored
Normal file
214
node_modules/protobufjs/cli/node_modules/@babel/parser/typings/babel-parser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,214 @@
|
||||
// Type definitions for @babel/parser
|
||||
// Project: https://github.com/babel/babel/tree/main/packages/babel-parser
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Avi Vahl <https://github.com/AviVahl>
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
/**
|
||||
* Parse the provided code as an entire ECMAScript program.
|
||||
*/
|
||||
export function parse(
|
||||
input: string,
|
||||
options?: ParserOptions
|
||||
): ParseResult<import("@babel/types").File>;
|
||||
|
||||
/**
|
||||
* Parse the provided code as a single expression.
|
||||
*/
|
||||
export function parseExpression(
|
||||
input: string,
|
||||
options?: ParserOptions
|
||||
): ParseResult<import("@babel/types").Expression>;
|
||||
|
||||
export interface ParserOptions {
|
||||
/**
|
||||
* By default, import and export declarations can only appear at a program's top level.
|
||||
* Setting this option to true allows them anywhere where a statement is allowed.
|
||||
*/
|
||||
allowImportExportEverywhere?: boolean;
|
||||
|
||||
/**
|
||||
* By default, await use is not allowed outside of an async function.
|
||||
* Set this to true to accept such code.
|
||||
*/
|
||||
allowAwaitOutsideFunction?: boolean;
|
||||
|
||||
/**
|
||||
* By default, a return statement at the top level raises an error.
|
||||
* Set this to true to accept such code.
|
||||
*/
|
||||
allowReturnOutsideFunction?: boolean;
|
||||
|
||||
allowSuperOutsideMethod?: boolean;
|
||||
|
||||
/**
|
||||
* By default, exported identifiers must refer to a declared variable.
|
||||
* Set this to true to allow export statements to reference undeclared variables.
|
||||
*/
|
||||
allowUndeclaredExports?: boolean;
|
||||
|
||||
/**
|
||||
* By default, Babel attaches comments to adjacent AST nodes.
|
||||
* When this option is set to false, comments are not attached.
|
||||
* It can provide up to 30% performance improvement when the input code has many comments.
|
||||
* @babel/eslint-parser will set it for you.
|
||||
* It is not recommended to use attachComment: false with Babel transform,
|
||||
* as doing so removes all the comments in output code, and renders annotations such as
|
||||
* /* istanbul ignore next *\/ nonfunctional.
|
||||
*/
|
||||
attachComment?: boolean;
|
||||
|
||||
/**
|
||||
* By default, Babel always throws an error when it finds some invalid code.
|
||||
* When this option is set to true, it will store the parsing error and
|
||||
* try to continue parsing the invalid input file.
|
||||
*/
|
||||
errorRecovery?: boolean;
|
||||
|
||||
/**
|
||||
* Indicate the mode the code should be parsed in.
|
||||
* Can be one of "script", "module", or "unambiguous". Defaults to "script".
|
||||
* "unambiguous" will make @babel/parser attempt to guess, based on the presence
|
||||
* of ES6 import or export statements.
|
||||
* Files with ES6 imports and exports are considered "module" and are otherwise "script".
|
||||
*/
|
||||
sourceType?: "script" | "module" | "unambiguous";
|
||||
|
||||
/**
|
||||
* Correlate output AST nodes with their source filename.
|
||||
* Useful when generating code and source maps from the ASTs of multiple input files.
|
||||
*/
|
||||
sourceFilename?: string;
|
||||
|
||||
/**
|
||||
* By default, the first line of code parsed is treated as line 1.
|
||||
* You can provide a line number to alternatively start with.
|
||||
* Useful for integration with other source tools.
|
||||
*/
|
||||
startLine?: number;
|
||||
|
||||
/**
|
||||
* By default, the parsed code is treated as if it starts from line 1, column 0.
|
||||
* You can provide a column number to alternatively start with.
|
||||
* Useful for integration with other source tools.
|
||||
*/
|
||||
startColumn?: number;
|
||||
|
||||
/**
|
||||
* Array containing the plugins that you want to enable.
|
||||
*/
|
||||
plugins?: ParserPlugin[];
|
||||
|
||||
/**
|
||||
* Should the parser work in strict mode.
|
||||
* Defaults to true if sourceType === 'module'. Otherwise, false.
|
||||
*/
|
||||
strictMode?: boolean;
|
||||
|
||||
/**
|
||||
* Adds a ranges property to each node: [node.start, node.end]
|
||||
*/
|
||||
ranges?: boolean;
|
||||
|
||||
/**
|
||||
* Adds all parsed tokens to a tokens property on the File node.
|
||||
*/
|
||||
tokens?: boolean;
|
||||
|
||||
/**
|
||||
* By default, the parser adds information about parentheses by setting
|
||||
* `extra.parenthesized` to `true` as needed.
|
||||
* When this option is `true` the parser creates `ParenthesizedExpression`
|
||||
* AST nodes instead of using the `extra` property.
|
||||
*/
|
||||
createParenthesizedExpressions?: boolean;
|
||||
}
|
||||
|
||||
export type ParserPlugin =
|
||||
| "asyncDoExpressions"
|
||||
| "asyncGenerators"
|
||||
| "bigInt"
|
||||
| "classPrivateMethods"
|
||||
| "classPrivateProperties"
|
||||
| "classProperties"
|
||||
| "classStaticBlock" // Enabled by default
|
||||
| "decimal"
|
||||
| "decorators"
|
||||
| "decorators-legacy"
|
||||
| "decoratorAutoAccessors"
|
||||
| "destructuringPrivate"
|
||||
| "doExpressions"
|
||||
| "dynamicImport"
|
||||
| "estree"
|
||||
| "exportDefaultFrom"
|
||||
| "exportNamespaceFrom" // deprecated
|
||||
| "flow"
|
||||
| "flowComments"
|
||||
| "functionBind"
|
||||
| "functionSent"
|
||||
| "importMeta"
|
||||
| "jsx"
|
||||
| "logicalAssignment"
|
||||
| "importAssertions"
|
||||
| "moduleBlocks"
|
||||
| "moduleStringNames"
|
||||
| "nullishCoalescingOperator"
|
||||
| "numericSeparator"
|
||||
| "objectRestSpread"
|
||||
| "optionalCatchBinding"
|
||||
| "optionalChaining"
|
||||
| "partialApplication"
|
||||
| "pipelineOperator"
|
||||
| "placeholders"
|
||||
| "privateIn" // Enabled by default
|
||||
| "regexpUnicodeSets"
|
||||
| "throwExpressions"
|
||||
| "topLevelAwait"
|
||||
| "typescript"
|
||||
| "v8intrinsic"
|
||||
| ParserPluginWithOptions;
|
||||
|
||||
export type ParserPluginWithOptions =
|
||||
| ["decorators", DecoratorsPluginOptions]
|
||||
| ["pipelineOperator", PipelineOperatorPluginOptions]
|
||||
| ["recordAndTuple", RecordAndTuplePluginOptions]
|
||||
| ["flow", FlowPluginOptions]
|
||||
| ["typescript", TypeScriptPluginOptions];
|
||||
|
||||
export interface DecoratorsPluginOptions {
|
||||
decoratorsBeforeExport?: boolean;
|
||||
}
|
||||
|
||||
export interface PipelineOperatorPluginOptions {
|
||||
proposal: "minimal" | "fsharp" | "hack" | "smart";
|
||||
topicToken?: "%" | "#" | "@@" | "^^" | "^";
|
||||
}
|
||||
|
||||
export interface RecordAndTuplePluginOptions {
|
||||
syntaxType: "bar" | "hash";
|
||||
}
|
||||
|
||||
export interface FlowPluginOptions {
|
||||
all?: boolean;
|
||||
enums?: boolean;
|
||||
}
|
||||
|
||||
export interface TypeScriptPluginOptions {
|
||||
dts?: boolean;
|
||||
disallowAmbiguousJSXLike?: boolean;
|
||||
}
|
||||
|
||||
export const tokTypes: {
|
||||
// todo(flow->ts) real token type
|
||||
[name: string]: any;
|
||||
};
|
||||
|
||||
export interface ParseError {
|
||||
code: string;
|
||||
reasonCode: string;
|
||||
}
|
||||
|
||||
type ParseResult<Result> = Result & {
|
||||
errors: ParseError[];
|
||||
};
|
||||
21
node_modules/protobufjs/cli/node_modules/@types/linkify-it/LICENSE
generated
vendored
Executable file
21
node_modules/protobufjs/cli/node_modules/@types/linkify-it/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
89
node_modules/protobufjs/cli/node_modules/@types/linkify-it/README.md
generated
vendored
Executable file
89
node_modules/protobufjs/cli/node_modules/@types/linkify-it/README.md
generated
vendored
Executable file
@@ -0,0 +1,89 @@
|
||||
# Installation
|
||||
> `npm install --save @types/linkify-it`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for linkify-it (https://github.com/markdown-it/linkify-it).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/linkify-it.
|
||||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/linkify-it/index.d.ts)
|
||||
````ts
|
||||
// Type definitions for linkify-it 3.0.2
|
||||
// Project: https://github.com/markdown-it/linkify-it
|
||||
// Definitions by: Lindsey Smith <https://github.com/praxxis>
|
||||
// Robert Coie <https://github.com/rapropos/typed-linkify-it>
|
||||
// Alex Plumb <https://github.com/alexplumb>
|
||||
// Rafa Gares <https://github.com/ragafus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
declare const LinkifyIt: {
|
||||
(
|
||||
schemas?: LinkifyIt.SchemaRules | LinkifyIt.Options,
|
||||
options?: LinkifyIt.Options
|
||||
): LinkifyIt.LinkifyIt;
|
||||
new (
|
||||
schemas?: LinkifyIt.SchemaRules | LinkifyIt.Options,
|
||||
options?: LinkifyIt.Options
|
||||
): LinkifyIt.LinkifyIt;
|
||||
};
|
||||
|
||||
declare namespace LinkifyIt {
|
||||
type Validate = (text: string, pos: number, self: LinkifyIt) => number | boolean;
|
||||
|
||||
interface FullRule {
|
||||
validate: string | RegExp | Validate;
|
||||
normalize?: ((match: Match) => void) | undefined;
|
||||
}
|
||||
|
||||
type Rule = string | FullRule;
|
||||
|
||||
interface SchemaRules {
|
||||
[schema: string]: Rule;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
fuzzyLink?: boolean | undefined;
|
||||
fuzzyIP?: boolean | undefined;
|
||||
fuzzyEmail?: boolean | undefined;
|
||||
}
|
||||
|
||||
interface Match {
|
||||
index: number;
|
||||
lastIndex: number;
|
||||
raw: string;
|
||||
schema: string;
|
||||
text: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface LinkifyIt {
|
||||
// Use overloads to provide contextual typing to `FullRule.normalize`, which is ambiguous with string.normalize
|
||||
// This appears unneeded to the unified-signatures lint rule.
|
||||
add(schema: string, rule: string): LinkifyIt;
|
||||
// tslint:disable-next-line: unified-signatures
|
||||
add(schema: string, rule: FullRule | null): LinkifyIt;
|
||||
match(text: string): Match[] | null;
|
||||
normalize(raw: string): string;
|
||||
pretest(text: string): boolean;
|
||||
set(options: Options): LinkifyIt;
|
||||
test(text: string): boolean;
|
||||
testSchemaAt(text: string, schemaName: string, pos: number): number;
|
||||
tlds(list: string | string[], keepOld?: boolean): LinkifyIt;
|
||||
re: {
|
||||
[key: string]: RegExp;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export = LinkifyIt;
|
||||
|
||||
````
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 06 Jul 2021 22:02:41 GMT
|
||||
* Dependencies: none
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Lindsey Smith](https://github.com/praxxis), [Robert Coie](https://github.com/rapropos/typed-linkify-it), [Alex Plumb](https://github.com/alexplumb), and [Rafa Gares](https://github.com/ragafus).
|
||||
69
node_modules/protobufjs/cli/node_modules/@types/linkify-it/index.d.ts
generated
vendored
Executable file
69
node_modules/protobufjs/cli/node_modules/@types/linkify-it/index.d.ts
generated
vendored
Executable file
@@ -0,0 +1,69 @@
|
||||
// Type definitions for linkify-it 3.0.2
|
||||
// Project: https://github.com/markdown-it/linkify-it
|
||||
// Definitions by: Lindsey Smith <https://github.com/praxxis>
|
||||
// Robert Coie <https://github.com/rapropos/typed-linkify-it>
|
||||
// Alex Plumb <https://github.com/alexplumb>
|
||||
// Rafa Gares <https://github.com/ragafus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
declare const LinkifyIt: {
|
||||
(
|
||||
schemas?: LinkifyIt.SchemaRules | LinkifyIt.Options,
|
||||
options?: LinkifyIt.Options
|
||||
): LinkifyIt.LinkifyIt;
|
||||
new (
|
||||
schemas?: LinkifyIt.SchemaRules | LinkifyIt.Options,
|
||||
options?: LinkifyIt.Options
|
||||
): LinkifyIt.LinkifyIt;
|
||||
};
|
||||
|
||||
declare namespace LinkifyIt {
|
||||
type Validate = (text: string, pos: number, self: LinkifyIt) => number | boolean;
|
||||
|
||||
interface FullRule {
|
||||
validate: string | RegExp | Validate;
|
||||
normalize?: ((match: Match) => void) | undefined;
|
||||
}
|
||||
|
||||
type Rule = string | FullRule;
|
||||
|
||||
interface SchemaRules {
|
||||
[schema: string]: Rule;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
fuzzyLink?: boolean | undefined;
|
||||
fuzzyIP?: boolean | undefined;
|
||||
fuzzyEmail?: boolean | undefined;
|
||||
}
|
||||
|
||||
interface Match {
|
||||
index: number;
|
||||
lastIndex: number;
|
||||
raw: string;
|
||||
schema: string;
|
||||
text: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface LinkifyIt {
|
||||
// Use overloads to provide contextual typing to `FullRule.normalize`, which is ambiguous with string.normalize
|
||||
// This appears unneeded to the unified-signatures lint rule.
|
||||
add(schema: string, rule: string): LinkifyIt;
|
||||
// tslint:disable-next-line: unified-signatures
|
||||
add(schema: string, rule: FullRule | null): LinkifyIt;
|
||||
match(text: string): Match[] | null;
|
||||
normalize(raw: string): string;
|
||||
pretest(text: string): boolean;
|
||||
set(options: Options): LinkifyIt;
|
||||
test(text: string): boolean;
|
||||
testSchemaAt(text: string, schemaName: string, pos: number): number;
|
||||
tlds(list: string | string[], keepOld?: boolean): LinkifyIt;
|
||||
re: {
|
||||
[key: string]: RegExp;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export = LinkifyIt;
|
||||
39
node_modules/protobufjs/cli/node_modules/@types/linkify-it/package.json
generated
vendored
Executable file
39
node_modules/protobufjs/cli/node_modules/@types/linkify-it/package.json
generated
vendored
Executable file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "@types/linkify-it",
|
||||
"version": "3.0.2",
|
||||
"description": "TypeScript definitions for linkify-it",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/linkify-it",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Lindsey Smith",
|
||||
"url": "https://github.com/praxxis",
|
||||
"githubUsername": "praxxis"
|
||||
},
|
||||
{
|
||||
"name": "Robert Coie",
|
||||
"url": "https://github.com/rapropos/typed-linkify-it"
|
||||
},
|
||||
{
|
||||
"name": "Alex Plumb",
|
||||
"url": "https://github.com/alexplumb",
|
||||
"githubUsername": "alexplumb"
|
||||
},
|
||||
{
|
||||
"name": "Rafa Gares",
|
||||
"url": "https://github.com/ragafus",
|
||||
"githubUsername": "ragafus"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/linkify-it"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "001e13e25578e89bdd72aba9710cc97e62dacb4982344e91c4d666aa7cfd642d",
|
||||
"typeScriptVersion": "3.6"
|
||||
}
|
||||
21
node_modules/protobufjs/cli/node_modules/@types/markdown-it/LICENSE
generated
vendored
Executable file
21
node_modules/protobufjs/cli/node_modules/@types/markdown-it/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
16
node_modules/protobufjs/cli/node_modules/@types/markdown-it/README.md
generated
vendored
Executable file
16
node_modules/protobufjs/cli/node_modules/@types/markdown-it/README.md
generated
vendored
Executable file
@@ -0,0 +1,16 @@
|
||||
# Installation
|
||||
> `npm install --save @types/markdown-it`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for markdown-it (https://github.com/markdown-it/markdown-it).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/markdown-it.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Thu, 07 Oct 2021 19:01:21 GMT
|
||||
* Dependencies: [@types/linkify-it](https://npmjs.com/package/@types/linkify-it), [@types/mdurl](https://npmjs.com/package/@types/mdurl)
|
||||
* Global values: `markdownit`
|
||||
|
||||
# Credits
|
||||
These definitions were written by [York Yao](https://github.com/plantain-00), [Robert Coie](https://github.com/rapropos), [duduluu](https://github.com/duduluu), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).
|
||||
13
node_modules/protobufjs/cli/node_modules/@types/markdown-it/index.d.ts
generated
vendored
Executable file
13
node_modules/protobufjs/cli/node_modules/@types/markdown-it/index.d.ts
generated
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
// Type definitions for markdown-it 12.2
|
||||
// Project: https://github.com/markdown-it/markdown-it
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Robert Coie <https://github.com/rapropos>
|
||||
// duduluu <https://github.com/duduluu>
|
||||
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import MarkdownIt = require('./lib');
|
||||
|
||||
export as namespace markdownit;
|
||||
|
||||
export = MarkdownIt;
|
||||
7
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/common/entities.d.ts
generated
vendored
Executable file
7
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/common/entities.d.ts
generated
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
interface MapType {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
declare const entities: MapType;
|
||||
|
||||
export = entities;
|
||||
3
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/common/html_blocks.d.ts
generated
vendored
Executable file
3
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/common/html_blocks.d.ts
generated
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
declare const htmlBlocks: string[];
|
||||
|
||||
export = htmlBlocks;
|
||||
8
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/common/html_re.d.ts
generated
vendored
Executable file
8
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/common/html_re.d.ts
generated
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
interface HtmlRE {
|
||||
HTML_TAG_RE: RegExp;
|
||||
HTML_OPEN_CLOSE_TAG_RE: RegExp;
|
||||
}
|
||||
|
||||
declare const htmlRE: HtmlRE;
|
||||
|
||||
export = htmlRE;
|
||||
70
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/common/utils.d.ts
generated
vendored
Executable file
70
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/common/utils.d.ts
generated
vendored
Executable file
@@ -0,0 +1,70 @@
|
||||
import * as mdurl from 'mdurl';
|
||||
// import ucmicro from 'uc.micro';
|
||||
|
||||
interface Utils {
|
||||
lib: {
|
||||
mdurl: typeof mdurl;
|
||||
};
|
||||
|
||||
/**
|
||||
* Merge objects
|
||||
*/
|
||||
assign(target: any, ...sources: any[]): any;
|
||||
|
||||
/**
|
||||
* Check if the type is string or not
|
||||
*/
|
||||
isString(obj: any): obj is string;
|
||||
|
||||
/**
|
||||
* has own property
|
||||
*/
|
||||
has(obj: any, key: keyof any): boolean;
|
||||
|
||||
unescapeMd(str: string): string;
|
||||
unescapeAll(str: string): string;
|
||||
|
||||
isValidEntityCode(code: number): boolean;
|
||||
fromCodePoint(code: number): string;
|
||||
escapeHtml(str: string): string;
|
||||
|
||||
/**
|
||||
* Remove element from array and put another array at those position.
|
||||
* Useful for some operations with tokens.
|
||||
* Return a new array.
|
||||
*/
|
||||
arrayReplaceAt<T>(src: T[], pos: number, newElements: T[]): T[];
|
||||
|
||||
isSpace(code: number): boolean;
|
||||
|
||||
/**
|
||||
* Zs (unicode class) || [\t\f\v\r\n]
|
||||
*/
|
||||
isWhiteSpace(code: number): boolean;
|
||||
|
||||
/**
|
||||
* Markdown ASCII punctuation characters.
|
||||
*
|
||||
* !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
|
||||
* http://spec.commonmark.org/0.15/#ascii-punctuation-character
|
||||
*
|
||||
* Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.
|
||||
*/
|
||||
isMdAsciiPunct(code: number): boolean;
|
||||
|
||||
/**
|
||||
* Currently without astral characters support.
|
||||
*/
|
||||
isPunctChar(ch: string): boolean;
|
||||
|
||||
escapeRE(str: string): string;
|
||||
|
||||
/**
|
||||
* Hepler to unify [reference labels].
|
||||
*/
|
||||
normalizeReference(str: string): string;
|
||||
}
|
||||
|
||||
declare const utils: Utils;
|
||||
|
||||
export = utils;
|
||||
13
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/helpers/index.d.ts
generated
vendored
Executable file
13
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/helpers/index.d.ts
generated
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import parseLinkLabel = require('./parse_link_label');
|
||||
import parseLinkDestination = require('./parse_link_destination');
|
||||
import parseLinkTitle = require('./parse_link_title');
|
||||
|
||||
interface Helpers {
|
||||
parseLinkLabel: typeof parseLinkLabel;
|
||||
parseLinkDestination: typeof parseLinkDestination;
|
||||
parseLinkTitle: typeof parseLinkTitle;
|
||||
}
|
||||
|
||||
declare const helpers: Helpers;
|
||||
|
||||
export = helpers;
|
||||
12
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts
generated
vendored
Executable file
12
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts
generated
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
declare namespace parseLinkDestination {
|
||||
interface ParseResult {
|
||||
ok: boolean;
|
||||
pos: number;
|
||||
lines: number;
|
||||
str: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare function parseLinkDestination(str: string, pos: number, max: number): parseLinkDestination.ParseResult;
|
||||
|
||||
export = parseLinkDestination;
|
||||
5
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts
generated
vendored
Executable file
5
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts
generated
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
import StateInline = require('../rules_inline/state_inline');
|
||||
|
||||
declare function parseLinkLabel(state: StateInline, start: number, disableNested?: boolean): number;
|
||||
|
||||
export = parseLinkLabel;
|
||||
5
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts
generated
vendored
Executable file
5
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts
generated
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
import Destination = require('./parse_link_destination');
|
||||
|
||||
declare function parseLinkTitle(str: string, pos: number, max: number): Destination.ParseResult;
|
||||
|
||||
export = parseLinkTitle;
|
||||
406
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/index.d.ts
generated
vendored
Executable file
406
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/index.d.ts
generated
vendored
Executable file
@@ -0,0 +1,406 @@
|
||||
import LinkifyIt = require('linkify-it');
|
||||
|
||||
import utils = require('./common/utils');
|
||||
import helpers = require('./helpers');
|
||||
import ParserBlock = require('./parser_block');
|
||||
import ParserCore = require('./parser_core');
|
||||
import ParserInline = require('./parser_inline');
|
||||
import Renderer = require('./renderer');
|
||||
import Token = require('./token');
|
||||
|
||||
declare namespace MarkdownIt {
|
||||
/**
|
||||
* MarkdownIt provides named presets as a convenience to quickly
|
||||
* enable/disable active syntax rules and options for common use cases.
|
||||
*
|
||||
* - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) -
|
||||
* configures parser to strict [CommonMark](http://commonmark.org/) mode.
|
||||
* - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) -
|
||||
* similar to GFM, used when no preset name given. Enables all available rules,
|
||||
* but still without html, typographer & autolinker.
|
||||
* - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) -
|
||||
* all rules disabled. Useful to quickly setup your config via `.enable()`.
|
||||
* For example, when you need only `bold` and `italic` markup and nothing else.
|
||||
*/
|
||||
type PresetName = 'default' | 'zero' | 'commonmark';
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* Set `true` to enable HTML tags in source. Be careful!
|
||||
* That's not safe! You may need external sanitizer to protect output from XSS.
|
||||
* It's better to extend features via plugins, instead of enabling HTML.
|
||||
* @default false
|
||||
*/
|
||||
html?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Set `true` to add '/' when closing single tags
|
||||
* (`<br />`). This is needed only for full CommonMark compatibility. In real
|
||||
* world you will need HTML output.
|
||||
* @default false
|
||||
*/
|
||||
xhtmlOut?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Set `true` to convert `\n` in paragraphs into `<br>`.
|
||||
* @default false
|
||||
*/
|
||||
breaks?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* CSS language class prefix for fenced blocks.
|
||||
* Can be useful for external highlighters.
|
||||
* @default 'language-'
|
||||
*/
|
||||
langPrefix?: string | undefined;
|
||||
|
||||
/**
|
||||
* Set `true` to autoconvert URL-like text to links.
|
||||
* @default false
|
||||
*/
|
||||
linkify?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Set `true` to enable [some language-neutral replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) +
|
||||
* quotes beautification (smartquotes).
|
||||
* @default false
|
||||
*/
|
||||
typographer?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Double + single quotes replacement
|
||||
* pairs, when typographer enabled and smartquotes on. For example, you can
|
||||
* use `'«»„“'` for Russian, `'„“‚‘'` for German, and
|
||||
* `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
|
||||
* @default '“”‘’'
|
||||
*/
|
||||
quotes?: string | string[];
|
||||
|
||||
/**
|
||||
* Highlighter function for fenced code blocks.
|
||||
* Highlighter `function (str, lang, attrs)` should return escaped HTML. It can
|
||||
* also return empty string if the source was not changed and should be escaped
|
||||
* externally. If result starts with <pre... internal wrapper is skipped.
|
||||
* @default null
|
||||
*/
|
||||
highlight?: ((str: string, lang: string, attrs: string) => string) | null | undefined;
|
||||
}
|
||||
|
||||
type PluginSimple = (md: MarkdownIt) => void;
|
||||
type PluginWithOptions<T = any> = (md: MarkdownIt, options?: T) => void;
|
||||
type PluginWithParams = (md: MarkdownIt, ...params: any[]) => void;
|
||||
}
|
||||
|
||||
interface MarkdownItConstructor {
|
||||
new (): MarkdownIt;
|
||||
new (presetName: MarkdownIt.PresetName, options?: MarkdownIt.Options): MarkdownIt;
|
||||
new (options: MarkdownIt.Options): MarkdownIt;
|
||||
(): MarkdownIt;
|
||||
(presetName: MarkdownIt.PresetName, options?: MarkdownIt.Options): MarkdownIt;
|
||||
(options: MarkdownIt.Options): MarkdownIt;
|
||||
}
|
||||
|
||||
interface MarkdownIt {
|
||||
/**
|
||||
* Instance of [[ParserInline]]. You may need it to add new rules when
|
||||
* writing plugins. For simple rules control use [[MarkdownIt.disable]] and
|
||||
* [[MarkdownIt.enable]].
|
||||
*/
|
||||
readonly inline: ParserInline;
|
||||
|
||||
/**
|
||||
* Instance of [[ParserBlock]]. You may need it to add new rules when
|
||||
* writing plugins. For simple rules control use [[MarkdownIt.disable]] and
|
||||
* [[MarkdownIt.enable]].
|
||||
*/
|
||||
readonly block: ParserBlock;
|
||||
|
||||
/**
|
||||
* Instance of [[Core]] chain executor. You may need it to add new rules when
|
||||
* writing plugins. For simple rules control use [[MarkdownIt.disable]] and
|
||||
* [[MarkdownIt.enable]].
|
||||
*/
|
||||
readonly core: ParserCore;
|
||||
|
||||
/**
|
||||
* Instance of [[Renderer]]. Use it to modify output look. Or to add rendering
|
||||
* rules for new token types, generated by plugins.
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* ```javascript
|
||||
* var md = require('markdown-it')();
|
||||
*
|
||||
* function myToken(tokens, idx, options, env, self) {
|
||||
* //...
|
||||
* return result;
|
||||
* };
|
||||
*
|
||||
* md.renderer.rules['my_token'] = myToken
|
||||
* ```
|
||||
*
|
||||
* See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
|
||||
*/
|
||||
readonly renderer: Renderer;
|
||||
|
||||
/**
|
||||
* [linkify-it](https://github.com/markdown-it/linkify-it) instance.
|
||||
* Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)
|
||||
* rule.
|
||||
*/
|
||||
readonly linkify: LinkifyIt.LinkifyIt;
|
||||
|
||||
/**
|
||||
* Link validation function. CommonMark allows too much in links. By default
|
||||
* we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
|
||||
* except some embedded image types.
|
||||
*
|
||||
* You can change this behaviour:
|
||||
*
|
||||
* ```javascript
|
||||
* var md = require('markdown-it')();
|
||||
* // enable everything
|
||||
* md.validateLink = function () { return true; }
|
||||
* ```
|
||||
*/
|
||||
validateLink(url: string): boolean;
|
||||
|
||||
/**
|
||||
* Function used to encode link url to a machine-readable format,
|
||||
* which includes url-encoding, punycode, etc.
|
||||
*/
|
||||
normalizeLink(url: string): string;
|
||||
|
||||
/**
|
||||
* Function used to decode link url to a human-readable format`
|
||||
*/
|
||||
normalizeLinkText(url: string): string;
|
||||
|
||||
readonly utils: typeof utils;
|
||||
|
||||
readonly helpers: typeof helpers;
|
||||
|
||||
readonly options: MarkdownIt.Options;
|
||||
|
||||
/**
|
||||
* *chainable*
|
||||
*
|
||||
* Set parser options (in the same format as in constructor). Probably, you
|
||||
* will never need it, but you can change options after constructor call.
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* ```javascript
|
||||
* var md = require('markdown-it')()
|
||||
* .set({ html: true, breaks: true })
|
||||
* .set({ typographer: true });
|
||||
* ```
|
||||
*
|
||||
* __Note:__ To achieve the best possible performance, don't modify a
|
||||
* `markdown-it` instance options on the fly. If you need multiple configurations
|
||||
* it's best to create multiple instances and initialize each with separate
|
||||
* config.
|
||||
*/
|
||||
set(options: MarkdownIt.Options): this;
|
||||
|
||||
/**
|
||||
* *chainable*, *internal*
|
||||
*
|
||||
* Batch load of all options and compenent settings. This is internal method,
|
||||
* and you probably will not need it. But if you with - see available presets
|
||||
* and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)
|
||||
*
|
||||
* We strongly recommend to use presets instead of direct config loads. That
|
||||
* will give better compatibility with next versions.
|
||||
*/
|
||||
configure(presets: MarkdownIt.PresetName): this;
|
||||
|
||||
/**
|
||||
* *chainable*
|
||||
*
|
||||
* Enable list or rules. It will automatically find appropriate components,
|
||||
* containing rules with given names. If rule not found, and `ignoreInvalid`
|
||||
* not set - throws exception.
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* ```javascript
|
||||
* var md = require('markdown-it')()
|
||||
* .enable(['sub', 'sup'])
|
||||
* .disable('smartquotes');
|
||||
* ```
|
||||
*
|
||||
* @param list rule name or list of rule names to enable
|
||||
* @param ignoreInvalid set `true` to ignore errors when rule not found.
|
||||
*/
|
||||
enable(list: string | string[], ignoreInvalid?: boolean): this;
|
||||
|
||||
/**
|
||||
* *chainable*
|
||||
*
|
||||
* The same as [[MarkdownIt.enable]], but turn specified rules off.
|
||||
*
|
||||
* @param list rule name or list of rule names to disable.
|
||||
* @param ignoreInvalid set `true` to ignore errors when rule not found.
|
||||
*/
|
||||
disable(list: string | string[], ignoreInvalid?: boolean): this;
|
||||
|
||||
/**
|
||||
* *chainable*
|
||||
*
|
||||
* Load specified plugin with given params into current parser instance.
|
||||
* It's just a sugar to call `plugin(md, params)` with curring.
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* ```javascript
|
||||
* var iterator = require('markdown-it-for-inline');
|
||||
* var md = require('markdown-it')()
|
||||
* .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
|
||||
* tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
use(plugin: MarkdownIt.PluginSimple): this;
|
||||
use<T = any>(plugin: MarkdownIt.PluginWithOptions<T>, options?: T): this;
|
||||
use(plugin: MarkdownIt.PluginWithParams, ...params: any[]): this;
|
||||
|
||||
/**
|
||||
* *internal*
|
||||
*
|
||||
* Parse input string and returns list of block tokens (special token type
|
||||
* "inline" will contain list of inline tokens). You should not call this
|
||||
* method directly, until you write custom renderer (for example, to produce
|
||||
* AST).
|
||||
*
|
||||
* `env` is used to pass data between "distributed" rules and return additional
|
||||
* metadata like reference info, needed for the renderer. It also can be used to
|
||||
* inject data in specific cases. Usually, you will be ok to pass `{}`,
|
||||
* and then pass updated object to renderer.
|
||||
*
|
||||
* @param src source string
|
||||
* @param env environment sandbox
|
||||
*/
|
||||
parse(src: string, env: any): Token[];
|
||||
|
||||
/**
|
||||
* Render markdown string into html. It does all magic for you :).
|
||||
*
|
||||
* `env` can be used to inject additional metadata (`{}` by default).
|
||||
* But you will not need it with high probability. See also comment
|
||||
* in [[MarkdownIt.parse]].
|
||||
*
|
||||
* @param src source string
|
||||
* @param env environment sandbox
|
||||
*/
|
||||
render(src: string, env?: any): string;
|
||||
|
||||
/**
|
||||
* *internal*
|
||||
*
|
||||
* The same as [[MarkdownIt.parse]] but skip all block rules. It returns the
|
||||
* block tokens list with the single `inline` element, containing parsed inline
|
||||
* tokens in `children` property. Also updates `env` object.
|
||||
*
|
||||
* @param src source string
|
||||
* @param env environment sandbox
|
||||
*/
|
||||
parseInline(src: string, env: any): Token[];
|
||||
|
||||
/**
|
||||
* Similar to [[MarkdownIt.render]] but for single paragraph content. Result
|
||||
* will NOT be wrapped into `<p>` tags.
|
||||
*
|
||||
* @param src source string
|
||||
* @param env environment sandbox
|
||||
*/
|
||||
renderInline(src: string, env?: any): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Main parser/renderer class.
|
||||
*
|
||||
* ##### Usage
|
||||
*
|
||||
* ```javascript
|
||||
* // node.js, "classic" way:
|
||||
* var MarkdownIt = require('markdown-it'),
|
||||
* md = new MarkdownIt();
|
||||
* var result = md.render('# markdown-it rulezz!');
|
||||
*
|
||||
* // node.js, the same, but with sugar:
|
||||
* var md = require('markdown-it')();
|
||||
* var result = md.render('# markdown-it rulezz!');
|
||||
*
|
||||
* // browser without AMD, added to "window" on script load
|
||||
* // Note, there are no dash.
|
||||
* var md = window.markdownit();
|
||||
* var result = md.render('# markdown-it rulezz!');
|
||||
* ```
|
||||
*
|
||||
* Single line rendering, without paragraph wrap:
|
||||
*
|
||||
* ```javascript
|
||||
* var md = require('markdown-it')();
|
||||
* var result = md.renderInline('__markdown-it__ rulezz!');
|
||||
* ```
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* ```javascript
|
||||
* // commonmark mode
|
||||
* var md = require('markdown-it')('commonmark');
|
||||
*
|
||||
* // default mode
|
||||
* var md = require('markdown-it')();
|
||||
*
|
||||
* // enable everything
|
||||
* var md = require('markdown-it')({
|
||||
* html: true,
|
||||
* linkify: true,
|
||||
* typographer: true
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* ##### Syntax highlighting
|
||||
*
|
||||
* ```js
|
||||
* var hljs = require('highlight.js') // https://highlightjs.org/
|
||||
*
|
||||
* var md = require('markdown-it')({
|
||||
* highlight: function (str, lang) {
|
||||
* if (lang && hljs.getLanguage(lang)) {
|
||||
* try {
|
||||
* return hljs.highlight(lang, str, true).value;
|
||||
* } catch (__) {}
|
||||
* }
|
||||
*
|
||||
* return ''; // use external default escaping
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Or with full wrapper override (if you need assign class to `<pre>`):
|
||||
*
|
||||
* ```javascript
|
||||
* var hljs = require('highlight.js') // https://highlightjs.org/
|
||||
*
|
||||
* // Actual default values
|
||||
* var md = require('markdown-it')({
|
||||
* highlight: function (str, lang) {
|
||||
* if (lang && hljs.getLanguage(lang)) {
|
||||
* try {
|
||||
* return '<pre class="hljs"><code>' +
|
||||
* hljs.highlight(lang, str, true).value +
|
||||
* '</code></pre>';
|
||||
* } catch (__) {}
|
||||
* }
|
||||
*
|
||||
* return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
declare const MarkdownIt: MarkdownItConstructor;
|
||||
|
||||
export = MarkdownIt;
|
||||
29
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/parser_block.d.ts
generated
vendored
Executable file
29
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/parser_block.d.ts
generated
vendored
Executable file
@@ -0,0 +1,29 @@
|
||||
import MarkdownIt = require('.');
|
||||
import Ruler = require('./ruler');
|
||||
import StateBlock = require('./rules_block/state_block');
|
||||
import Token = require('./token');
|
||||
|
||||
declare namespace ParserBlock {
|
||||
type RuleBlock = (state: StateBlock, startLine: number, endLine: number, silent: boolean) => boolean;
|
||||
}
|
||||
|
||||
declare class ParserBlock {
|
||||
/**
|
||||
* [[Ruler]] instance. Keep configuration of block rules.
|
||||
*/
|
||||
ruler: Ruler<ParserBlock.RuleBlock>;
|
||||
|
||||
/**
|
||||
* Generate tokens for input range
|
||||
*/
|
||||
tokenize(state: StateBlock, startLine: number, endLine: number): void;
|
||||
|
||||
/**
|
||||
* Process input string and push block tokens into `outTokens`
|
||||
*/
|
||||
parse(str: string, md: MarkdownIt, env: any, outTokens: Token[]): void;
|
||||
|
||||
State: typeof StateBlock;
|
||||
}
|
||||
|
||||
export = ParserBlock;
|
||||
19
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/parser_core.d.ts
generated
vendored
Executable file
19
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/parser_core.d.ts
generated
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
import Ruler = require('./ruler');
|
||||
import StateCore = require('./rules_core/state_core');
|
||||
|
||||
declare namespace Core {
|
||||
type RuleCore = (state: StateCore) => void;
|
||||
}
|
||||
|
||||
declare class Core {
|
||||
ruler: Ruler<Core.RuleCore>;
|
||||
|
||||
/**
|
||||
* Executes core chain rules.
|
||||
*/
|
||||
process(state: StateCore): void;
|
||||
|
||||
State: typeof StateCore;
|
||||
}
|
||||
|
||||
export = Core;
|
||||
42
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/parser_inline.d.ts
generated
vendored
Executable file
42
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/parser_inline.d.ts
generated
vendored
Executable file
@@ -0,0 +1,42 @@
|
||||
import MarkdownIt = require('.');
|
||||
import Ruler = require('./ruler');
|
||||
import Token = require('./token');
|
||||
import StateInline = require('./rules_inline/state_inline');
|
||||
|
||||
declare namespace ParserInline {
|
||||
type RuleInline = (state: StateInline, silent: boolean) => boolean;
|
||||
type RuleInline2 = (state: StateInline) => boolean;
|
||||
}
|
||||
|
||||
declare class ParserInline {
|
||||
/**
|
||||
* [[Ruler]] instance. Keep configuration of inline rules.
|
||||
*/
|
||||
ruler: Ruler<ParserInline.RuleInline>;
|
||||
|
||||
/**
|
||||
* [[Ruler]] instance. Second ruler used for post-processing
|
||||
* (e.g. in emphasis-like rules).
|
||||
*/
|
||||
ruler2: Ruler<ParserInline.RuleInline2>;
|
||||
|
||||
/**
|
||||
* Skip single token by running all rules in validation mode;
|
||||
* returns `true` if any rule reported success
|
||||
*/
|
||||
skipToken(state: StateInline): void;
|
||||
|
||||
/**
|
||||
* Generate tokens for input range
|
||||
*/
|
||||
tokenize(state: StateInline): void;
|
||||
|
||||
/**
|
||||
* Process input string and push inline tokens into `outTokens`
|
||||
*/
|
||||
parse(str: string, md: MarkdownIt, env: any, outTokens: Token[]): void;
|
||||
|
||||
State: typeof StateInline;
|
||||
}
|
||||
|
||||
export = ParserInline;
|
||||
96
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/renderer.d.ts
generated
vendored
Executable file
96
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/renderer.d.ts
generated
vendored
Executable file
@@ -0,0 +1,96 @@
|
||||
import MarkdownIt = require('.');
|
||||
import Token = require('./token');
|
||||
|
||||
declare namespace Renderer {
|
||||
type RenderRule = (tokens: Token[], idx: number, options: MarkdownIt.Options, env: any, self: Renderer) => string;
|
||||
|
||||
interface RenderRuleRecord {
|
||||
[type: string]: RenderRule | undefined;
|
||||
code_inline?: RenderRule | undefined;
|
||||
code_block?: RenderRule | undefined;
|
||||
fence?: RenderRule | undefined;
|
||||
image?: RenderRule | undefined;
|
||||
hardbreak?: RenderRule | undefined;
|
||||
softbreak?: RenderRule | undefined;
|
||||
text?: RenderRule | undefined;
|
||||
html_block?: RenderRule | undefined;
|
||||
html_inline?: RenderRule | undefined;
|
||||
}
|
||||
}
|
||||
|
||||
declare class Renderer {
|
||||
/**
|
||||
* Contains render rules for tokens. Can be updated and extended.
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* ```javascript
|
||||
* var md = require('markdown-it')();
|
||||
*
|
||||
* md.renderer.rules.strong_open = function () { return '<b>'; };
|
||||
* md.renderer.rules.strong_close = function () { return '</b>'; };
|
||||
*
|
||||
* var result = md.renderInline(...);
|
||||
* ```
|
||||
*
|
||||
* Each rule is called as independent static function with fixed signature:
|
||||
*
|
||||
* ```javascript
|
||||
* function my_token_render(tokens, idx, options, env, renderer) {
|
||||
* // ...
|
||||
* return renderedHTML;
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
|
||||
* for more details and examples.
|
||||
*/
|
||||
rules: Renderer.RenderRuleRecord;
|
||||
|
||||
/**
|
||||
* Render token attributes to string.
|
||||
*/
|
||||
renderAttrs(token: Token): string;
|
||||
|
||||
/**
|
||||
* Default token renderer. Can be overriden by custom function
|
||||
* in [[Renderer#rules]].
|
||||
*
|
||||
* @param tokens list of tokens
|
||||
* @param idx token index to render
|
||||
* @param options params of parser instance
|
||||
*/
|
||||
renderToken(tokens: Token[], idx: number, options: MarkdownIt.Options): string;
|
||||
|
||||
/**
|
||||
* The same as [[Renderer.render]], but for single token of `inline` type.
|
||||
*
|
||||
* @param tokens list on block tokens to renter
|
||||
* @param options params of parser instance
|
||||
* @param env additional data from parsed input (references, for example)
|
||||
*/
|
||||
renderInline(tokens: Token[], options: MarkdownIt.Options, env: any): string;
|
||||
|
||||
/**
|
||||
* Special kludge for image `alt` attributes to conform CommonMark spec.
|
||||
* Don't try to use it! Spec requires to show `alt` content with stripped markup,
|
||||
* instead of simple escaping.
|
||||
*
|
||||
* @param tokens list on block tokens to renter
|
||||
* @param options params of parser instance
|
||||
* @param env additional data from parsed input (references, for example)
|
||||
*/
|
||||
renderInlineAsText(tokens: Token[], options: MarkdownIt.Options, env: any): string;
|
||||
|
||||
/**
|
||||
* Takes token stream and generates HTML. Probably, you will never need to call
|
||||
* this method directly.
|
||||
*
|
||||
* @param tokens list on block tokens to renter
|
||||
* @param options params of parser instance
|
||||
* @param env additional data from parsed input (references, for example)
|
||||
*/
|
||||
render(tokens: Token[], options: MarkdownIt.Options, env: any): string;
|
||||
}
|
||||
|
||||
export = Renderer;
|
||||
167
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/ruler.d.ts
generated
vendored
Executable file
167
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/ruler.d.ts
generated
vendored
Executable file
@@ -0,0 +1,167 @@
|
||||
declare namespace Ruler {
|
||||
interface RuleOptions {
|
||||
/**
|
||||
* array with names of "alternate" chains.
|
||||
*/
|
||||
alt: string[];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* class Ruler
|
||||
*
|
||||
* Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and
|
||||
* [[MarkdownIt#inline]] to manage sequences of functions (rules):
|
||||
*
|
||||
* - keep rules in defined order
|
||||
* - assign the name to each rule
|
||||
* - enable/disable rules
|
||||
* - add/replace rules
|
||||
* - allow assign rules to additional named chains (in the same)
|
||||
* - cacheing lists of active rules
|
||||
*
|
||||
* You will not need use this class directly until write plugins. For simple
|
||||
* rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and
|
||||
* [[MarkdownIt.use]].
|
||||
*/
|
||||
declare class Ruler<T> {
|
||||
/**
|
||||
* Replace rule by name with new function & options. Throws error if name not
|
||||
* found.
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* Replace existing typographer replacement rule with new one:
|
||||
*
|
||||
* ```javascript
|
||||
* var md = require('markdown-it')();
|
||||
*
|
||||
* md.core.ruler.at('replacements', function replace(state) {
|
||||
* //...
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param name rule name to replace.
|
||||
* @param fn new rule function.
|
||||
* @param options new rule options (not mandatory).
|
||||
*/
|
||||
at(name: string, fn: T, options?: Ruler.RuleOptions): void;
|
||||
|
||||
/**
|
||||
* Add new rule to chain before one with given name. See also
|
||||
* [[Ruler.after]], [[Ruler.push]].
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* ```javascript
|
||||
* var md = require('markdown-it')();
|
||||
*
|
||||
* md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
|
||||
* //...
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param beforeName new rule will be added before this one.
|
||||
* @param ruleName name of added rule.
|
||||
* @param fn rule function.
|
||||
* @param options rule options (not mandatory).
|
||||
*/
|
||||
before(beforeName: string, ruleName: string, fn: T, options?: Ruler.RuleOptions): void;
|
||||
|
||||
/**
|
||||
* Add new rule to chain after one with given name. See also
|
||||
* [[Ruler.before]], [[Ruler.push]].
|
||||
*
|
||||
* ##### Options:
|
||||
*
|
||||
* - __alt__ - array with names of "alternate" chains.
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* ```javascript
|
||||
* var md = require('markdown-it')();
|
||||
*
|
||||
* md.inline.ruler.after('text', 'my_rule', function replace(state) {
|
||||
* //...
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param afterName new rule will be added after this one.
|
||||
* @param ruleName name of added rule.
|
||||
* @param fn rule function.
|
||||
* @param options rule options (not mandatory).
|
||||
*/
|
||||
after(afterName: string, ruleName: string, fn: T, options?: Ruler.RuleOptions): void;
|
||||
|
||||
/**
|
||||
* Push new rule to the end of chain. See also
|
||||
* [[Ruler.before]], [[Ruler.after]].
|
||||
*
|
||||
* ##### Options:
|
||||
*
|
||||
* - __alt__ - array with names of "alternate" chains.
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* ```javascript
|
||||
* var md = require('markdown-it')();
|
||||
*
|
||||
* md.core.ruler.push('my_rule', function replace(state) {
|
||||
* //...
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param ruleName name of added rule.
|
||||
* @param fn rule function.
|
||||
* @param options rule options (not mandatory).
|
||||
*/
|
||||
push(ruleName: string, fn: T, options?: Ruler.RuleOptions): void;
|
||||
|
||||
/**
|
||||
* Enable rules with given names. If any rule name not found - throw Error.
|
||||
* Errors can be disabled by second param.
|
||||
*
|
||||
* Returns list of found rule names (if no exception happened).
|
||||
*
|
||||
* See also [[Ruler.disable]], [[Ruler.enableOnly]].
|
||||
*
|
||||
* @param list list of rule names to enable.
|
||||
* @param ignoreInvalid set `true` to ignore errors when rule not found.
|
||||
*/
|
||||
enable(list: string | string[], ignoreInvalid?: boolean): string[];
|
||||
|
||||
/**
|
||||
* Enable rules with given names, and disable everything else. If any rule name
|
||||
* not found - throw Error. Errors can be disabled by second param.
|
||||
*
|
||||
* See also [[Ruler.disable]], [[Ruler.enable]].
|
||||
*
|
||||
* @param list list of rule names to enable (whitelist).
|
||||
* @param ignoreInvalid set `true` to ignore errors when rule not found.
|
||||
*/
|
||||
enableOnly(list: string | string[], ignoreInvalid?: boolean): string[];
|
||||
|
||||
/**
|
||||
* Disable rules with given names. If any rule name not found - throw Error.
|
||||
* Errors can be disabled by second param.
|
||||
*
|
||||
* Returns list of found rule names (if no exception happened).
|
||||
*
|
||||
* See also [[Ruler.enable]], [[Ruler.enableOnly]].
|
||||
*
|
||||
* @param list list of rule names to disable.
|
||||
* @param ignoreInvalid set `true` to ignore errors when rule not found.
|
||||
*/
|
||||
disable(list: string | string[], ignoreInvalid?: boolean): string[];
|
||||
|
||||
/**
|
||||
* Return array of active functions (rules) for given chain name. It analyzes
|
||||
* rules configuration, compiles caches if not exists and returns result.
|
||||
*
|
||||
* Default chain name is `''` (empty string). It can't be skipped. That's
|
||||
* done intentionally, to keep signature monomorphic for high speed.
|
||||
*/
|
||||
getRules(chainName: string): T[];
|
||||
}
|
||||
|
||||
export = Ruler;
|
||||
134
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts
generated
vendored
Executable file
134
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts
generated
vendored
Executable file
@@ -0,0 +1,134 @@
|
||||
import MarkdownIt = require('..');
|
||||
import Token = require('../token');
|
||||
|
||||
declare namespace StateBlock {
|
||||
type ParentType = 'blockquote' | 'list' | 'root' | 'paragraph' | 'reference';
|
||||
}
|
||||
|
||||
declare class StateBlock {
|
||||
constructor(src: string, md: MarkdownIt, env: any, tokens: Token[]);
|
||||
|
||||
src: string;
|
||||
|
||||
/**
|
||||
* link to parser instance
|
||||
*/
|
||||
md: MarkdownIt;
|
||||
|
||||
env: any;
|
||||
|
||||
//
|
||||
// Internal state vartiables
|
||||
//
|
||||
|
||||
tokens: Token[];
|
||||
|
||||
/**
|
||||
* line begin offsets for fast jumps
|
||||
*/
|
||||
bMarks: number[];
|
||||
/**
|
||||
* line end offsets for fast jumps
|
||||
*/
|
||||
eMarks: number[];
|
||||
/**
|
||||
* offsets of the first non-space characters (tabs not expanded)
|
||||
*/
|
||||
tShift: number[];
|
||||
/**
|
||||
* indents for each line (tabs expanded)
|
||||
*/
|
||||
sCount: number[];
|
||||
|
||||
/**
|
||||
* An amount of virtual spaces (tabs expanded) between beginning
|
||||
* of each line (bMarks) and real beginning of that line.
|
||||
*
|
||||
* It exists only as a hack because blockquotes override bMarks
|
||||
* losing information in the process.
|
||||
*
|
||||
* It's used only when expanding tabs, you can think about it as
|
||||
* an initial tab length, e.g. bsCount=21 applied to string `\t123`
|
||||
* means first tab should be expanded to 4-21%4 === 3 spaces.
|
||||
*/
|
||||
bsCount: number[];
|
||||
|
||||
// block parser variables
|
||||
|
||||
/**
|
||||
* required block content indent (for example, if we are
|
||||
* inside a list, it would be positioned after list marker)
|
||||
*/
|
||||
blkIndent: number;
|
||||
/**
|
||||
* line index in src
|
||||
*/
|
||||
line: number;
|
||||
/**
|
||||
* lines count
|
||||
*/
|
||||
lineMax: number;
|
||||
/**
|
||||
* loose/tight mode for lists
|
||||
*/
|
||||
tight: boolean;
|
||||
/**
|
||||
* indent of the current dd block (-1 if there isn't any)
|
||||
*/
|
||||
ddIndent: number;
|
||||
/**
|
||||
* indent of the current list block (-1 if there isn't any)
|
||||
*/
|
||||
listIndent: number;
|
||||
|
||||
/**
|
||||
* can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'
|
||||
* used in lists to determine if they interrupt a paragraph
|
||||
*/
|
||||
parentType: StateBlock.ParentType;
|
||||
|
||||
level: number;
|
||||
|
||||
/**
|
||||
* renderer
|
||||
*/
|
||||
result: string;
|
||||
|
||||
/**
|
||||
* Push new token to "stream".
|
||||
*/
|
||||
push(type: string, tag: string, nesting: Token.Nesting): Token;
|
||||
|
||||
isEmpty(line: number): boolean;
|
||||
|
||||
skipEmptyLines(from: number): number;
|
||||
|
||||
/**
|
||||
* Skip spaces from given position.
|
||||
*/
|
||||
skipSpaces(pos: number): number;
|
||||
|
||||
/**
|
||||
* Skip spaces from given position in reverse.
|
||||
*/
|
||||
skipSpacesBack(pos: number, min: number): number;
|
||||
|
||||
/**
|
||||
* Skip char codes from given position
|
||||
*/
|
||||
skipChars(pos: number, code: number): number;
|
||||
|
||||
/**
|
||||
* Skip char codes reverse from given position - 1
|
||||
*/
|
||||
skipCharsBack(pos: number, code: number, min: number): number;
|
||||
|
||||
/**
|
||||
* cut lines range from source.
|
||||
*/
|
||||
getLines(begin: number, end: number, indent: number, keepLastLF: boolean): string;
|
||||
|
||||
Token: typeof Token;
|
||||
}
|
||||
|
||||
export = StateBlock;
|
||||
20
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts
generated
vendored
Executable file
20
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts
generated
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
import MarkdownIt = require('..');
|
||||
import Token = require('../token');
|
||||
|
||||
declare class StateCore {
|
||||
constructor(src: string, md: MarkdownIt, env: any);
|
||||
|
||||
src: string;
|
||||
env: any;
|
||||
tokens: Token[];
|
||||
inlineMode: boolean;
|
||||
|
||||
/**
|
||||
* link to parser instance
|
||||
*/
|
||||
md: MarkdownIt;
|
||||
|
||||
Token: typeof Token;
|
||||
}
|
||||
|
||||
export = StateCore;
|
||||
78
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts
generated
vendored
Executable file
78
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts
generated
vendored
Executable file
@@ -0,0 +1,78 @@
|
||||
import MarkdownIt = require('..');
|
||||
import Token = require('../token');
|
||||
|
||||
declare namespace StateInline {
|
||||
interface Scanned {
|
||||
can_open: boolean;
|
||||
can_close: boolean;
|
||||
length: number;
|
||||
}
|
||||
|
||||
interface Delimiter {
|
||||
marker: number;
|
||||
length: number;
|
||||
jump: number;
|
||||
token: number;
|
||||
end: number;
|
||||
open: boolean;
|
||||
close: boolean;
|
||||
}
|
||||
|
||||
interface TokenMata {
|
||||
delimiters: Delimiter[];
|
||||
}
|
||||
}
|
||||
|
||||
declare class StateInline {
|
||||
constructor(src: string, md: MarkdownIt, env: any, outTokens: Token[]);
|
||||
|
||||
src: string;
|
||||
env: any;
|
||||
md: MarkdownIt;
|
||||
tokens: Token[];
|
||||
tokens_meta: Array<StateInline.TokenMata | null>;
|
||||
|
||||
pos: number;
|
||||
posMax: number;
|
||||
level: number;
|
||||
pending: string;
|
||||
pendingLevel: number;
|
||||
|
||||
/**
|
||||
* Stores { start: end } pairs. Useful for backtrack
|
||||
* optimization of pairs parse (emphasis, strikes).
|
||||
*/
|
||||
cache: any;
|
||||
|
||||
/**
|
||||
* List of emphasis-like delimiters for current tag
|
||||
*/
|
||||
delimiters: StateInline.Delimiter[];
|
||||
|
||||
// Stack of delimiter lists for upper level tags
|
||||
// _prev_delimiters: StateInline.Delimiter[][];
|
||||
|
||||
/**
|
||||
* Flush pending text
|
||||
*/
|
||||
pushPending(): Token;
|
||||
|
||||
/**
|
||||
* Push new token to "stream".
|
||||
* If pending text exists - flush it as text token
|
||||
*/
|
||||
push(type: string, tag: string, nesting: Token.Nesting): Token;
|
||||
|
||||
/**
|
||||
* Scan a sequence of emphasis-like markers, and determine whether
|
||||
* it can start an emphasis sequence or end an emphasis sequence.
|
||||
*
|
||||
* @param start position to scan from (it should point at a valid marker);
|
||||
* @param canSplitWord determine if these markers can be found inside a word
|
||||
*/
|
||||
scanDelims(start: number, canSplitWord: boolean): StateInline.Scanned;
|
||||
|
||||
Token: typeof Token;
|
||||
}
|
||||
|
||||
export = StateInline;
|
||||
111
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/token.d.ts
generated
vendored
Executable file
111
node_modules/protobufjs/cli/node_modules/@types/markdown-it/lib/token.d.ts
generated
vendored
Executable file
@@ -0,0 +1,111 @@
|
||||
declare namespace Token {
|
||||
type Nesting = 1 | 0 | -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new token and fill passed properties.
|
||||
*/
|
||||
declare class Token {
|
||||
constructor(type: string, tag: string, nesting: Token.Nesting);
|
||||
|
||||
/**
|
||||
* Type of the token, e.g. "paragraph_open"
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* HTML tag name, e.g. "p"
|
||||
*/
|
||||
tag: string;
|
||||
|
||||
/**
|
||||
* HTML attributes. Format: `[[name1, value1], [name2, value2]]`
|
||||
*/
|
||||
attrs: [string, string][] | null;
|
||||
|
||||
/**
|
||||
* Source map info. Format: `[line_begin, line_end]`
|
||||
*/
|
||||
map: [number, number] | null;
|
||||
|
||||
/**
|
||||
* Level change (number in {-1, 0, 1} set), where:
|
||||
*
|
||||
* - `1` means the tag is opening
|
||||
* - `0` means the tag is self-closing
|
||||
* - `-1` means the tag is closing
|
||||
*/
|
||||
nesting: 1 | 0 | -1;
|
||||
|
||||
/**
|
||||
* nesting level, the same as `state.level`
|
||||
*/
|
||||
level: number;
|
||||
|
||||
/**
|
||||
* An array of child nodes (inline and img tokens)
|
||||
*/
|
||||
children: Token[] | null;
|
||||
|
||||
/**
|
||||
* In a case of self-closing tag (code, html, fence, etc.),
|
||||
* it has contents of this tag.
|
||||
*/
|
||||
content: string;
|
||||
|
||||
/**
|
||||
* '*' or '_' for emphasis, fence string for fence, etc.
|
||||
*/
|
||||
markup: string;
|
||||
|
||||
/**
|
||||
* Fence info string
|
||||
*/
|
||||
info: string;
|
||||
|
||||
/**
|
||||
* A place for plugins to store an arbitrary data
|
||||
*/
|
||||
meta: any;
|
||||
|
||||
/**
|
||||
* True for block-level tokens, false for inline tokens.
|
||||
* Used in renderer to calculate line breaks
|
||||
*/
|
||||
block: boolean;
|
||||
|
||||
/**
|
||||
* If it's true, ignore this element when rendering. Used for tight lists
|
||||
* to hide paragraphs.
|
||||
*/
|
||||
hidden: boolean;
|
||||
|
||||
/**
|
||||
* Search attribute index by name.
|
||||
*/
|
||||
attrIndex(name: string): number;
|
||||
|
||||
/**
|
||||
* Add `[name, value]` attribute to list. Init attrs if necessary
|
||||
*/
|
||||
attrPush(attrData: [string, string]): void;
|
||||
|
||||
/**
|
||||
* Set `name` attribute to `value`. Override old value if exists.
|
||||
*/
|
||||
attrSet(name: string, value: string): void;
|
||||
|
||||
/**
|
||||
* Get the value of attribute `name`, or null if it does not exist.
|
||||
*/
|
||||
attrGet(name: string): string | null;
|
||||
|
||||
/**
|
||||
*
|
||||
* Join value to existing attribute via space. Or create new attribute if not
|
||||
* exists. Useful to operate with token classes.
|
||||
*/
|
||||
attrJoin(name: string, value: string): void;
|
||||
}
|
||||
|
||||
export = Token;
|
||||
43
node_modules/protobufjs/cli/node_modules/@types/markdown-it/package.json
generated
vendored
Executable file
43
node_modules/protobufjs/cli/node_modules/@types/markdown-it/package.json
generated
vendored
Executable file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "@types/markdown-it",
|
||||
"version": "12.2.3",
|
||||
"description": "TypeScript definitions for markdown-it",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/markdown-it",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "York Yao",
|
||||
"url": "https://github.com/plantain-00",
|
||||
"githubUsername": "plantain-00"
|
||||
},
|
||||
{
|
||||
"name": "Robert Coie",
|
||||
"url": "https://github.com/rapropos",
|
||||
"githubUsername": "rapropos"
|
||||
},
|
||||
{
|
||||
"name": "duduluu",
|
||||
"url": "https://github.com/duduluu",
|
||||
"githubUsername": "duduluu"
|
||||
},
|
||||
{
|
||||
"name": "Piotr Błażejewicz",
|
||||
"url": "https://github.com/peterblazejewicz",
|
||||
"githubUsername": "peterblazejewicz"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/markdown-it"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/linkify-it": "*",
|
||||
"@types/mdurl": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "36f0d70c931d35e9b42ff42d3fcfdf021860abdb23b8a6310e8db0afd2395a15",
|
||||
"typeScriptVersion": "3.7"
|
||||
}
|
||||
21
node_modules/protobufjs/cli/node_modules/@types/mdurl/LICENSE
generated
vendored
Normal file
21
node_modules/protobufjs/cli/node_modules/@types/mdurl/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
16
node_modules/protobufjs/cli/node_modules/@types/mdurl/README.md
generated
vendored
Normal file
16
node_modules/protobufjs/cli/node_modules/@types/mdurl/README.md
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# Installation
|
||||
> `npm install --save @types/mdurl`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for mdurl (https://github.com/markdown-it/mdurl#readme).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdurl
|
||||
|
||||
Additional Details
|
||||
* Last updated: Wed, 17 Oct 2018 20:11:23 GMT
|
||||
* Dependencies: none
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by Junyoung Choi <https://github.com/rokt33r>.
|
||||
7
node_modules/protobufjs/cli/node_modules/@types/mdurl/decode.d.ts
generated
vendored
Normal file
7
node_modules/protobufjs/cli/node_modules/@types/mdurl/decode.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
declare namespace decode {
|
||||
const defaultChars: string;
|
||||
const componentChars: string;
|
||||
}
|
||||
declare function decode(input: string, exclude?: string): string;
|
||||
|
||||
export = decode;
|
||||
7
node_modules/protobufjs/cli/node_modules/@types/mdurl/encode.d.ts
generated
vendored
Normal file
7
node_modules/protobufjs/cli/node_modules/@types/mdurl/encode.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
declare namespace encode {
|
||||
const defaultChars: string;
|
||||
const componentChars: string;
|
||||
}
|
||||
declare function encode(str: string, exclude?: string, keepEscaped?: boolean): string;
|
||||
|
||||
export = encode;
|
||||
5
node_modules/protobufjs/cli/node_modules/@types/mdurl/format.d.ts
generated
vendored
Normal file
5
node_modules/protobufjs/cli/node_modules/@types/mdurl/format.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Url } from './';
|
||||
|
||||
declare function format(url: Url): string;
|
||||
|
||||
export = format;
|
||||
26
node_modules/protobufjs/cli/node_modules/@types/mdurl/index.d.ts
generated
vendored
Normal file
26
node_modules/protobufjs/cli/node_modules/@types/mdurl/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
// Type definitions for mdurl 1.0
|
||||
// Project: https://github.com/markdown-it/mdurl#readme
|
||||
// Definitions by: Junyoung Choi <https://github.com/rokt33r>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
import encode = require('./encode');
|
||||
import decode = require('./decode');
|
||||
import parse = require('./parse');
|
||||
import format = require('./format');
|
||||
|
||||
export interface Url {
|
||||
protocol: string;
|
||||
slashes: string;
|
||||
auth: string;
|
||||
port: string;
|
||||
hostname: string;
|
||||
hash: string;
|
||||
search: string;
|
||||
pathname: string;
|
||||
}
|
||||
|
||||
export {
|
||||
encode,
|
||||
decode,
|
||||
parse,
|
||||
format
|
||||
};
|
||||
23
node_modules/protobufjs/cli/node_modules/@types/mdurl/package.json
generated
vendored
Normal file
23
node_modules/protobufjs/cli/node_modules/@types/mdurl/package.json
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@types/mdurl",
|
||||
"version": "1.0.2",
|
||||
"description": "TypeScript definitions for mdurl",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Junyoung Choi",
|
||||
"url": "https://github.com/rokt33r",
|
||||
"githubUsername": "rokt33r"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "55901ccf45e8744ad241fd6beb7750d1c1f77d7fe727ac575e234c1431eb5bca",
|
||||
"typeScriptVersion": "2.0"
|
||||
}
|
||||
5
node_modules/protobufjs/cli/node_modules/@types/mdurl/parse.d.ts
generated
vendored
Normal file
5
node_modules/protobufjs/cli/node_modules/@types/mdurl/parse.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Url } from './';
|
||||
|
||||
declare function parse(input: string, slashesDenoteHost?: boolean): Url;
|
||||
|
||||
export = parse;
|
||||
19
node_modules/protobufjs/cli/node_modules/acorn-jsx/LICENSE
generated
vendored
Normal file
19
node_modules/protobufjs/cli/node_modules/acorn-jsx/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (C) 2012-2017 by Ingvar Stepanyan
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
40
node_modules/protobufjs/cli/node_modules/acorn-jsx/README.md
generated
vendored
Normal file
40
node_modules/protobufjs/cli/node_modules/acorn-jsx/README.md
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
# Acorn-JSX
|
||||
|
||||
[](https://travis-ci.org/acornjs/acorn-jsx)
|
||||
[](https://www.npmjs.org/package/acorn-jsx)
|
||||
|
||||
This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript.
|
||||
|
||||
It was created as an experimental alternative, faster [React.js JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) parser. Later, it replaced the [official parser](https://github.com/facebookarchive/esprima) and these days is used by many prominent development tools.
|
||||
|
||||
## Transpiler
|
||||
|
||||
Please note that this tool only parses source code to JSX AST, which is useful for various language tools and services. If you want to transpile your code to regular ES5-compliant JavaScript with source map, check out [Babel](https://babeljs.io/) and [Buble](https://buble.surge.sh/) transpilers which use `acorn-jsx` under the hood.
|
||||
|
||||
## Usage
|
||||
|
||||
Requiring this module provides you with an Acorn plugin that you can use like this:
|
||||
|
||||
```javascript
|
||||
var acorn = require("acorn");
|
||||
var jsx = require("acorn-jsx");
|
||||
acorn.Parser.extend(jsx()).parse("my(<jsx/>, 'code');");
|
||||
```
|
||||
|
||||
Note that official spec doesn't support mix of XML namespaces and object-style access in tag names (#27) like in `<namespace:Object.Property />`, so it was deprecated in `acorn-jsx@3.0`. If you still want to opt-in to support of such constructions, you can pass the following option:
|
||||
|
||||
```javascript
|
||||
acorn.Parser.extend(jsx({ allowNamespacedObjects: true }))
|
||||
```
|
||||
|
||||
Also, since most apps use pure React transformer, a new option was introduced that allows to prohibit namespaces completely:
|
||||
|
||||
```javascript
|
||||
acorn.Parser.extend(jsx({ allowNamespaces: false }))
|
||||
```
|
||||
|
||||
Note that by default `allowNamespaces` is enabled for spec compliancy.
|
||||
|
||||
## License
|
||||
|
||||
This plugin is issued under the [MIT license](./LICENSE).
|
||||
12
node_modules/protobufjs/cli/node_modules/acorn-jsx/index.d.ts
generated
vendored
Normal file
12
node_modules/protobufjs/cli/node_modules/acorn-jsx/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Parser } from 'acorn'
|
||||
|
||||
declare const jsx: (options?: jsx.Options) => (BaseParser: typeof Parser) => typeof Parser;
|
||||
|
||||
declare namespace jsx {
|
||||
interface Options {
|
||||
allowNamespacedObjects?: boolean;
|
||||
allowNamespaces?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export = jsx;
|
||||
488
node_modules/protobufjs/cli/node_modules/acorn-jsx/index.js
generated
vendored
Normal file
488
node_modules/protobufjs/cli/node_modules/acorn-jsx/index.js
generated
vendored
Normal file
@@ -0,0 +1,488 @@
|
||||
'use strict';
|
||||
|
||||
const XHTMLEntities = require('./xhtml');
|
||||
|
||||
const hexNumber = /^[\da-fA-F]+$/;
|
||||
const decimalNumber = /^\d+$/;
|
||||
|
||||
// The map to `acorn-jsx` tokens from `acorn` namespace objects.
|
||||
const acornJsxMap = new WeakMap();
|
||||
|
||||
// Get the original tokens for the given `acorn` namespace object.
|
||||
function getJsxTokens(acorn) {
|
||||
acorn = acorn.Parser.acorn || acorn;
|
||||
let acornJsx = acornJsxMap.get(acorn);
|
||||
if (!acornJsx) {
|
||||
const tt = acorn.tokTypes;
|
||||
const TokContext = acorn.TokContext;
|
||||
const TokenType = acorn.TokenType;
|
||||
const tc_oTag = new TokContext('<tag', false);
|
||||
const tc_cTag = new TokContext('</tag', false);
|
||||
const tc_expr = new TokContext('<tag>...</tag>', true, true);
|
||||
const tokContexts = {
|
||||
tc_oTag: tc_oTag,
|
||||
tc_cTag: tc_cTag,
|
||||
tc_expr: tc_expr
|
||||
};
|
||||
const tokTypes = {
|
||||
jsxName: new TokenType('jsxName'),
|
||||
jsxText: new TokenType('jsxText', {beforeExpr: true}),
|
||||
jsxTagStart: new TokenType('jsxTagStart', {startsExpr: true}),
|
||||
jsxTagEnd: new TokenType('jsxTagEnd')
|
||||
};
|
||||
|
||||
tokTypes.jsxTagStart.updateContext = function() {
|
||||
this.context.push(tc_expr); // treat as beginning of JSX expression
|
||||
this.context.push(tc_oTag); // start opening tag context
|
||||
this.exprAllowed = false;
|
||||
};
|
||||
tokTypes.jsxTagEnd.updateContext = function(prevType) {
|
||||
let out = this.context.pop();
|
||||
if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) {
|
||||
this.context.pop();
|
||||
this.exprAllowed = this.curContext() === tc_expr;
|
||||
} else {
|
||||
this.exprAllowed = true;
|
||||
}
|
||||
};
|
||||
|
||||
acornJsx = { tokContexts: tokContexts, tokTypes: tokTypes };
|
||||
acornJsxMap.set(acorn, acornJsx);
|
||||
}
|
||||
|
||||
return acornJsx;
|
||||
}
|
||||
|
||||
// Transforms JSX element name to string.
|
||||
|
||||
function getQualifiedJSXName(object) {
|
||||
if (!object)
|
||||
return object;
|
||||
|
||||
if (object.type === 'JSXIdentifier')
|
||||
return object.name;
|
||||
|
||||
if (object.type === 'JSXNamespacedName')
|
||||
return object.namespace.name + ':' + object.name.name;
|
||||
|
||||
if (object.type === 'JSXMemberExpression')
|
||||
return getQualifiedJSXName(object.object) + '.' +
|
||||
getQualifiedJSXName(object.property);
|
||||
}
|
||||
|
||||
module.exports = function(options) {
|
||||
options = options || {};
|
||||
return function(Parser) {
|
||||
return plugin({
|
||||
allowNamespaces: options.allowNamespaces !== false,
|
||||
allowNamespacedObjects: !!options.allowNamespacedObjects
|
||||
}, Parser);
|
||||
};
|
||||
};
|
||||
|
||||
// This is `tokTypes` of the peer dep.
|
||||
// This can be different instances from the actual `tokTypes` this plugin uses.
|
||||
Object.defineProperty(module.exports, "tokTypes", {
|
||||
get: function get_tokTypes() {
|
||||
return getJsxTokens(require("acorn")).tokTypes;
|
||||
},
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
function plugin(options, Parser) {
|
||||
const acorn = Parser.acorn || require("acorn");
|
||||
const acornJsx = getJsxTokens(acorn);
|
||||
const tt = acorn.tokTypes;
|
||||
const tok = acornJsx.tokTypes;
|
||||
const tokContexts = acorn.tokContexts;
|
||||
const tc_oTag = acornJsx.tokContexts.tc_oTag;
|
||||
const tc_cTag = acornJsx.tokContexts.tc_cTag;
|
||||
const tc_expr = acornJsx.tokContexts.tc_expr;
|
||||
const isNewLine = acorn.isNewLine;
|
||||
const isIdentifierStart = acorn.isIdentifierStart;
|
||||
const isIdentifierChar = acorn.isIdentifierChar;
|
||||
|
||||
return class extends Parser {
|
||||
// Expose actual `tokTypes` and `tokContexts` to other plugins.
|
||||
static get acornJsx() {
|
||||
return acornJsx;
|
||||
}
|
||||
|
||||
// Reads inline JSX contents token.
|
||||
jsx_readToken() {
|
||||
let out = '', chunkStart = this.pos;
|
||||
for (;;) {
|
||||
if (this.pos >= this.input.length)
|
||||
this.raise(this.start, 'Unterminated JSX contents');
|
||||
let ch = this.input.charCodeAt(this.pos);
|
||||
|
||||
switch (ch) {
|
||||
case 60: // '<'
|
||||
case 123: // '{'
|
||||
if (this.pos === this.start) {
|
||||
if (ch === 60 && this.exprAllowed) {
|
||||
++this.pos;
|
||||
return this.finishToken(tok.jsxTagStart);
|
||||
}
|
||||
return this.getTokenFromCode(ch);
|
||||
}
|
||||
out += this.input.slice(chunkStart, this.pos);
|
||||
return this.finishToken(tok.jsxText, out);
|
||||
|
||||
case 38: // '&'
|
||||
out += this.input.slice(chunkStart, this.pos);
|
||||
out += this.jsx_readEntity();
|
||||
chunkStart = this.pos;
|
||||
break;
|
||||
|
||||
case 62: // '>'
|
||||
case 125: // '}'
|
||||
this.raise(
|
||||
this.pos,
|
||||
"Unexpected token `" + this.input[this.pos] + "`. Did you mean `" +
|
||||
(ch === 62 ? ">" : "}") + "` or " + "`{\"" + this.input[this.pos] + "\"}" + "`?"
|
||||
);
|
||||
|
||||
default:
|
||||
if (isNewLine(ch)) {
|
||||
out += this.input.slice(chunkStart, this.pos);
|
||||
out += this.jsx_readNewLine(true);
|
||||
chunkStart = this.pos;
|
||||
} else {
|
||||
++this.pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jsx_readNewLine(normalizeCRLF) {
|
||||
let ch = this.input.charCodeAt(this.pos);
|
||||
let out;
|
||||
++this.pos;
|
||||
if (ch === 13 && this.input.charCodeAt(this.pos) === 10) {
|
||||
++this.pos;
|
||||
out = normalizeCRLF ? '\n' : '\r\n';
|
||||
} else {
|
||||
out = String.fromCharCode(ch);
|
||||
}
|
||||
if (this.options.locations) {
|
||||
++this.curLine;
|
||||
this.lineStart = this.pos;
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
jsx_readString(quote) {
|
||||
let out = '', chunkStart = ++this.pos;
|
||||
for (;;) {
|
||||
if (this.pos >= this.input.length)
|
||||
this.raise(this.start, 'Unterminated string constant');
|
||||
let ch = this.input.charCodeAt(this.pos);
|
||||
if (ch === quote) break;
|
||||
if (ch === 38) { // '&'
|
||||
out += this.input.slice(chunkStart, this.pos);
|
||||
out += this.jsx_readEntity();
|
||||
chunkStart = this.pos;
|
||||
} else if (isNewLine(ch)) {
|
||||
out += this.input.slice(chunkStart, this.pos);
|
||||
out += this.jsx_readNewLine(false);
|
||||
chunkStart = this.pos;
|
||||
} else {
|
||||
++this.pos;
|
||||
}
|
||||
}
|
||||
out += this.input.slice(chunkStart, this.pos++);
|
||||
return this.finishToken(tt.string, out);
|
||||
}
|
||||
|
||||
jsx_readEntity() {
|
||||
let str = '', count = 0, entity;
|
||||
let ch = this.input[this.pos];
|
||||
if (ch !== '&')
|
||||
this.raise(this.pos, 'Entity must start with an ampersand');
|
||||
let startPos = ++this.pos;
|
||||
while (this.pos < this.input.length && count++ < 10) {
|
||||
ch = this.input[this.pos++];
|
||||
if (ch === ';') {
|
||||
if (str[0] === '#') {
|
||||
if (str[1] === 'x') {
|
||||
str = str.substr(2);
|
||||
if (hexNumber.test(str))
|
||||
entity = String.fromCharCode(parseInt(str, 16));
|
||||
} else {
|
||||
str = str.substr(1);
|
||||
if (decimalNumber.test(str))
|
||||
entity = String.fromCharCode(parseInt(str, 10));
|
||||
}
|
||||
} else {
|
||||
entity = XHTMLEntities[str];
|
||||
}
|
||||
break;
|
||||
}
|
||||
str += ch;
|
||||
}
|
||||
if (!entity) {
|
||||
this.pos = startPos;
|
||||
return '&';
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
// Read a JSX identifier (valid tag or attribute name).
|
||||
//
|
||||
// Optimized version since JSX identifiers can't contain
|
||||
// escape characters and so can be read as single slice.
|
||||
// Also assumes that first character was already checked
|
||||
// by isIdentifierStart in readToken.
|
||||
|
||||
jsx_readWord() {
|
||||
let ch, start = this.pos;
|
||||
do {
|
||||
ch = this.input.charCodeAt(++this.pos);
|
||||
} while (isIdentifierChar(ch) || ch === 45); // '-'
|
||||
return this.finishToken(tok.jsxName, this.input.slice(start, this.pos));
|
||||
}
|
||||
|
||||
// Parse next token as JSX identifier
|
||||
|
||||
jsx_parseIdentifier() {
|
||||
let node = this.startNode();
|
||||
if (this.type === tok.jsxName)
|
||||
node.name = this.value;
|
||||
else if (this.type.keyword)
|
||||
node.name = this.type.keyword;
|
||||
else
|
||||
this.unexpected();
|
||||
this.next();
|
||||
return this.finishNode(node, 'JSXIdentifier');
|
||||
}
|
||||
|
||||
// Parse namespaced identifier.
|
||||
|
||||
jsx_parseNamespacedName() {
|
||||
let startPos = this.start, startLoc = this.startLoc;
|
||||
let name = this.jsx_parseIdentifier();
|
||||
if (!options.allowNamespaces || !this.eat(tt.colon)) return name;
|
||||
var node = this.startNodeAt(startPos, startLoc);
|
||||
node.namespace = name;
|
||||
node.name = this.jsx_parseIdentifier();
|
||||
return this.finishNode(node, 'JSXNamespacedName');
|
||||
}
|
||||
|
||||
// Parses element name in any form - namespaced, member
|
||||
// or single identifier.
|
||||
|
||||
jsx_parseElementName() {
|
||||
if (this.type === tok.jsxTagEnd) return '';
|
||||
let startPos = this.start, startLoc = this.startLoc;
|
||||
let node = this.jsx_parseNamespacedName();
|
||||
if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !options.allowNamespacedObjects) {
|
||||
this.unexpected();
|
||||
}
|
||||
while (this.eat(tt.dot)) {
|
||||
let newNode = this.startNodeAt(startPos, startLoc);
|
||||
newNode.object = node;
|
||||
newNode.property = this.jsx_parseIdentifier();
|
||||
node = this.finishNode(newNode, 'JSXMemberExpression');
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
// Parses any type of JSX attribute value.
|
||||
|
||||
jsx_parseAttributeValue() {
|
||||
switch (this.type) {
|
||||
case tt.braceL:
|
||||
let node = this.jsx_parseExpressionContainer();
|
||||
if (node.expression.type === 'JSXEmptyExpression')
|
||||
this.raise(node.start, 'JSX attributes must only be assigned a non-empty expression');
|
||||
return node;
|
||||
|
||||
case tok.jsxTagStart:
|
||||
case tt.string:
|
||||
return this.parseExprAtom();
|
||||
|
||||
default:
|
||||
this.raise(this.start, 'JSX value should be either an expression or a quoted JSX text');
|
||||
}
|
||||
}
|
||||
|
||||
// JSXEmptyExpression is unique type since it doesn't actually parse anything,
|
||||
// and so it should start at the end of last read token (left brace) and finish
|
||||
// at the beginning of the next one (right brace).
|
||||
|
||||
jsx_parseEmptyExpression() {
|
||||
let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
|
||||
return this.finishNodeAt(node, 'JSXEmptyExpression', this.start, this.startLoc);
|
||||
}
|
||||
|
||||
// Parses JSX expression enclosed into curly brackets.
|
||||
|
||||
jsx_parseExpressionContainer() {
|
||||
let node = this.startNode();
|
||||
this.next();
|
||||
node.expression = this.type === tt.braceR
|
||||
? this.jsx_parseEmptyExpression()
|
||||
: this.parseExpression();
|
||||
this.expect(tt.braceR);
|
||||
return this.finishNode(node, 'JSXExpressionContainer');
|
||||
}
|
||||
|
||||
// Parses following JSX attribute name-value pair.
|
||||
|
||||
jsx_parseAttribute() {
|
||||
let node = this.startNode();
|
||||
if (this.eat(tt.braceL)) {
|
||||
this.expect(tt.ellipsis);
|
||||
node.argument = this.parseMaybeAssign();
|
||||
this.expect(tt.braceR);
|
||||
return this.finishNode(node, 'JSXSpreadAttribute');
|
||||
}
|
||||
node.name = this.jsx_parseNamespacedName();
|
||||
node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null;
|
||||
return this.finishNode(node, 'JSXAttribute');
|
||||
}
|
||||
|
||||
// Parses JSX opening tag starting after '<'.
|
||||
|
||||
jsx_parseOpeningElementAt(startPos, startLoc) {
|
||||
let node = this.startNodeAt(startPos, startLoc);
|
||||
node.attributes = [];
|
||||
let nodeName = this.jsx_parseElementName();
|
||||
if (nodeName) node.name = nodeName;
|
||||
while (this.type !== tt.slash && this.type !== tok.jsxTagEnd)
|
||||
node.attributes.push(this.jsx_parseAttribute());
|
||||
node.selfClosing = this.eat(tt.slash);
|
||||
this.expect(tok.jsxTagEnd);
|
||||
return this.finishNode(node, nodeName ? 'JSXOpeningElement' : 'JSXOpeningFragment');
|
||||
}
|
||||
|
||||
// Parses JSX closing tag starting after '</'.
|
||||
|
||||
jsx_parseClosingElementAt(startPos, startLoc) {
|
||||
let node = this.startNodeAt(startPos, startLoc);
|
||||
let nodeName = this.jsx_parseElementName();
|
||||
if (nodeName) node.name = nodeName;
|
||||
this.expect(tok.jsxTagEnd);
|
||||
return this.finishNode(node, nodeName ? 'JSXClosingElement' : 'JSXClosingFragment');
|
||||
}
|
||||
|
||||
// Parses entire JSX element, including it's opening tag
|
||||
// (starting after '<'), attributes, contents and closing tag.
|
||||
|
||||
jsx_parseElementAt(startPos, startLoc) {
|
||||
let node = this.startNodeAt(startPos, startLoc);
|
||||
let children = [];
|
||||
let openingElement = this.jsx_parseOpeningElementAt(startPos, startLoc);
|
||||
let closingElement = null;
|
||||
|
||||
if (!openingElement.selfClosing) {
|
||||
contents: for (;;) {
|
||||
switch (this.type) {
|
||||
case tok.jsxTagStart:
|
||||
startPos = this.start; startLoc = this.startLoc;
|
||||
this.next();
|
||||
if (this.eat(tt.slash)) {
|
||||
closingElement = this.jsx_parseClosingElementAt(startPos, startLoc);
|
||||
break contents;
|
||||
}
|
||||
children.push(this.jsx_parseElementAt(startPos, startLoc));
|
||||
break;
|
||||
|
||||
case tok.jsxText:
|
||||
children.push(this.parseExprAtom());
|
||||
break;
|
||||
|
||||
case tt.braceL:
|
||||
children.push(this.jsx_parseExpressionContainer());
|
||||
break;
|
||||
|
||||
default:
|
||||
this.unexpected();
|
||||
}
|
||||
}
|
||||
if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
|
||||
this.raise(
|
||||
closingElement.start,
|
||||
'Expected corresponding JSX closing tag for <' + getQualifiedJSXName(openingElement.name) + '>');
|
||||
}
|
||||
}
|
||||
let fragmentOrElement = openingElement.name ? 'Element' : 'Fragment';
|
||||
|
||||
node['opening' + fragmentOrElement] = openingElement;
|
||||
node['closing' + fragmentOrElement] = closingElement;
|
||||
node.children = children;
|
||||
if (this.type === tt.relational && this.value === "<") {
|
||||
this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag");
|
||||
}
|
||||
return this.finishNode(node, 'JSX' + fragmentOrElement);
|
||||
}
|
||||
|
||||
// Parse JSX text
|
||||
|
||||
jsx_parseText() {
|
||||
let node = this.parseLiteral(this.value);
|
||||
node.type = "JSXText";
|
||||
return node;
|
||||
}
|
||||
|
||||
// Parses entire JSX element from current position.
|
||||
|
||||
jsx_parseElement() {
|
||||
let startPos = this.start, startLoc = this.startLoc;
|
||||
this.next();
|
||||
return this.jsx_parseElementAt(startPos, startLoc);
|
||||
}
|
||||
|
||||
parseExprAtom(refShortHandDefaultPos) {
|
||||
if (this.type === tok.jsxText)
|
||||
return this.jsx_parseText();
|
||||
else if (this.type === tok.jsxTagStart)
|
||||
return this.jsx_parseElement();
|
||||
else
|
||||
return super.parseExprAtom(refShortHandDefaultPos);
|
||||
}
|
||||
|
||||
readToken(code) {
|
||||
let context = this.curContext();
|
||||
|
||||
if (context === tc_expr) return this.jsx_readToken();
|
||||
|
||||
if (context === tc_oTag || context === tc_cTag) {
|
||||
if (isIdentifierStart(code)) return this.jsx_readWord();
|
||||
|
||||
if (code == 62) {
|
||||
++this.pos;
|
||||
return this.finishToken(tok.jsxTagEnd);
|
||||
}
|
||||
|
||||
if ((code === 34 || code === 39) && context == tc_oTag)
|
||||
return this.jsx_readString(code);
|
||||
}
|
||||
|
||||
if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) {
|
||||
++this.pos;
|
||||
return this.finishToken(tok.jsxTagStart);
|
||||
}
|
||||
return super.readToken(code);
|
||||
}
|
||||
|
||||
updateContext(prevType) {
|
||||
if (this.type == tt.braceL) {
|
||||
var curContext = this.curContext();
|
||||
if (curContext == tc_oTag) this.context.push(tokContexts.b_expr);
|
||||
else if (curContext == tc_expr) this.context.push(tokContexts.b_tmpl);
|
||||
else super.updateContext(prevType);
|
||||
this.exprAllowed = true;
|
||||
} else if (this.type === tt.slash && prevType === tok.jsxTagStart) {
|
||||
this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore
|
||||
this.context.push(tc_cTag); // reconsider as closing tag context
|
||||
this.exprAllowed = false;
|
||||
} else {
|
||||
return super.updateContext(prevType);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
27
node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json
generated
vendored
Normal file
27
node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "acorn-jsx",
|
||||
"description": "Modern, fast React.js JSX parser",
|
||||
"homepage": "https://github.com/acornjs/acorn-jsx",
|
||||
"version": "5.3.2",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Ingvar Stepanyan",
|
||||
"email": "me@rreverser.com",
|
||||
"web": "http://rreverser.com/"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/acornjs/acorn-jsx"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "node test/run.js"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"acorn": "^8.0.1"
|
||||
}
|
||||
}
|
||||
255
node_modules/protobufjs/cli/node_modules/acorn-jsx/xhtml.js
generated
vendored
Normal file
255
node_modules/protobufjs/cli/node_modules/acorn-jsx/xhtml.js
generated
vendored
Normal file
@@ -0,0 +1,255 @@
|
||||
module.exports = {
|
||||
quot: '\u0022',
|
||||
amp: '&',
|
||||
apos: '\u0027',
|
||||
lt: '<',
|
||||
gt: '>',
|
||||
nbsp: '\u00A0',
|
||||
iexcl: '\u00A1',
|
||||
cent: '\u00A2',
|
||||
pound: '\u00A3',
|
||||
curren: '\u00A4',
|
||||
yen: '\u00A5',
|
||||
brvbar: '\u00A6',
|
||||
sect: '\u00A7',
|
||||
uml: '\u00A8',
|
||||
copy: '\u00A9',
|
||||
ordf: '\u00AA',
|
||||
laquo: '\u00AB',
|
||||
not: '\u00AC',
|
||||
shy: '\u00AD',
|
||||
reg: '\u00AE',
|
||||
macr: '\u00AF',
|
||||
deg: '\u00B0',
|
||||
plusmn: '\u00B1',
|
||||
sup2: '\u00B2',
|
||||
sup3: '\u00B3',
|
||||
acute: '\u00B4',
|
||||
micro: '\u00B5',
|
||||
para: '\u00B6',
|
||||
middot: '\u00B7',
|
||||
cedil: '\u00B8',
|
||||
sup1: '\u00B9',
|
||||
ordm: '\u00BA',
|
||||
raquo: '\u00BB',
|
||||
frac14: '\u00BC',
|
||||
frac12: '\u00BD',
|
||||
frac34: '\u00BE',
|
||||
iquest: '\u00BF',
|
||||
Agrave: '\u00C0',
|
||||
Aacute: '\u00C1',
|
||||
Acirc: '\u00C2',
|
||||
Atilde: '\u00C3',
|
||||
Auml: '\u00C4',
|
||||
Aring: '\u00C5',
|
||||
AElig: '\u00C6',
|
||||
Ccedil: '\u00C7',
|
||||
Egrave: '\u00C8',
|
||||
Eacute: '\u00C9',
|
||||
Ecirc: '\u00CA',
|
||||
Euml: '\u00CB',
|
||||
Igrave: '\u00CC',
|
||||
Iacute: '\u00CD',
|
||||
Icirc: '\u00CE',
|
||||
Iuml: '\u00CF',
|
||||
ETH: '\u00D0',
|
||||
Ntilde: '\u00D1',
|
||||
Ograve: '\u00D2',
|
||||
Oacute: '\u00D3',
|
||||
Ocirc: '\u00D4',
|
||||
Otilde: '\u00D5',
|
||||
Ouml: '\u00D6',
|
||||
times: '\u00D7',
|
||||
Oslash: '\u00D8',
|
||||
Ugrave: '\u00D9',
|
||||
Uacute: '\u00DA',
|
||||
Ucirc: '\u00DB',
|
||||
Uuml: '\u00DC',
|
||||
Yacute: '\u00DD',
|
||||
THORN: '\u00DE',
|
||||
szlig: '\u00DF',
|
||||
agrave: '\u00E0',
|
||||
aacute: '\u00E1',
|
||||
acirc: '\u00E2',
|
||||
atilde: '\u00E3',
|
||||
auml: '\u00E4',
|
||||
aring: '\u00E5',
|
||||
aelig: '\u00E6',
|
||||
ccedil: '\u00E7',
|
||||
egrave: '\u00E8',
|
||||
eacute: '\u00E9',
|
||||
ecirc: '\u00EA',
|
||||
euml: '\u00EB',
|
||||
igrave: '\u00EC',
|
||||
iacute: '\u00ED',
|
||||
icirc: '\u00EE',
|
||||
iuml: '\u00EF',
|
||||
eth: '\u00F0',
|
||||
ntilde: '\u00F1',
|
||||
ograve: '\u00F2',
|
||||
oacute: '\u00F3',
|
||||
ocirc: '\u00F4',
|
||||
otilde: '\u00F5',
|
||||
ouml: '\u00F6',
|
||||
divide: '\u00F7',
|
||||
oslash: '\u00F8',
|
||||
ugrave: '\u00F9',
|
||||
uacute: '\u00FA',
|
||||
ucirc: '\u00FB',
|
||||
uuml: '\u00FC',
|
||||
yacute: '\u00FD',
|
||||
thorn: '\u00FE',
|
||||
yuml: '\u00FF',
|
||||
OElig: '\u0152',
|
||||
oelig: '\u0153',
|
||||
Scaron: '\u0160',
|
||||
scaron: '\u0161',
|
||||
Yuml: '\u0178',
|
||||
fnof: '\u0192',
|
||||
circ: '\u02C6',
|
||||
tilde: '\u02DC',
|
||||
Alpha: '\u0391',
|
||||
Beta: '\u0392',
|
||||
Gamma: '\u0393',
|
||||
Delta: '\u0394',
|
||||
Epsilon: '\u0395',
|
||||
Zeta: '\u0396',
|
||||
Eta: '\u0397',
|
||||
Theta: '\u0398',
|
||||
Iota: '\u0399',
|
||||
Kappa: '\u039A',
|
||||
Lambda: '\u039B',
|
||||
Mu: '\u039C',
|
||||
Nu: '\u039D',
|
||||
Xi: '\u039E',
|
||||
Omicron: '\u039F',
|
||||
Pi: '\u03A0',
|
||||
Rho: '\u03A1',
|
||||
Sigma: '\u03A3',
|
||||
Tau: '\u03A4',
|
||||
Upsilon: '\u03A5',
|
||||
Phi: '\u03A6',
|
||||
Chi: '\u03A7',
|
||||
Psi: '\u03A8',
|
||||
Omega: '\u03A9',
|
||||
alpha: '\u03B1',
|
||||
beta: '\u03B2',
|
||||
gamma: '\u03B3',
|
||||
delta: '\u03B4',
|
||||
epsilon: '\u03B5',
|
||||
zeta: '\u03B6',
|
||||
eta: '\u03B7',
|
||||
theta: '\u03B8',
|
||||
iota: '\u03B9',
|
||||
kappa: '\u03BA',
|
||||
lambda: '\u03BB',
|
||||
mu: '\u03BC',
|
||||
nu: '\u03BD',
|
||||
xi: '\u03BE',
|
||||
omicron: '\u03BF',
|
||||
pi: '\u03C0',
|
||||
rho: '\u03C1',
|
||||
sigmaf: '\u03C2',
|
||||
sigma: '\u03C3',
|
||||
tau: '\u03C4',
|
||||
upsilon: '\u03C5',
|
||||
phi: '\u03C6',
|
||||
chi: '\u03C7',
|
||||
psi: '\u03C8',
|
||||
omega: '\u03C9',
|
||||
thetasym: '\u03D1',
|
||||
upsih: '\u03D2',
|
||||
piv: '\u03D6',
|
||||
ensp: '\u2002',
|
||||
emsp: '\u2003',
|
||||
thinsp: '\u2009',
|
||||
zwnj: '\u200C',
|
||||
zwj: '\u200D',
|
||||
lrm: '\u200E',
|
||||
rlm: '\u200F',
|
||||
ndash: '\u2013',
|
||||
mdash: '\u2014',
|
||||
lsquo: '\u2018',
|
||||
rsquo: '\u2019',
|
||||
sbquo: '\u201A',
|
||||
ldquo: '\u201C',
|
||||
rdquo: '\u201D',
|
||||
bdquo: '\u201E',
|
||||
dagger: '\u2020',
|
||||
Dagger: '\u2021',
|
||||
bull: '\u2022',
|
||||
hellip: '\u2026',
|
||||
permil: '\u2030',
|
||||
prime: '\u2032',
|
||||
Prime: '\u2033',
|
||||
lsaquo: '\u2039',
|
||||
rsaquo: '\u203A',
|
||||
oline: '\u203E',
|
||||
frasl: '\u2044',
|
||||
euro: '\u20AC',
|
||||
image: '\u2111',
|
||||
weierp: '\u2118',
|
||||
real: '\u211C',
|
||||
trade: '\u2122',
|
||||
alefsym: '\u2135',
|
||||
larr: '\u2190',
|
||||
uarr: '\u2191',
|
||||
rarr: '\u2192',
|
||||
darr: '\u2193',
|
||||
harr: '\u2194',
|
||||
crarr: '\u21B5',
|
||||
lArr: '\u21D0',
|
||||
uArr: '\u21D1',
|
||||
rArr: '\u21D2',
|
||||
dArr: '\u21D3',
|
||||
hArr: '\u21D4',
|
||||
forall: '\u2200',
|
||||
part: '\u2202',
|
||||
exist: '\u2203',
|
||||
empty: '\u2205',
|
||||
nabla: '\u2207',
|
||||
isin: '\u2208',
|
||||
notin: '\u2209',
|
||||
ni: '\u220B',
|
||||
prod: '\u220F',
|
||||
sum: '\u2211',
|
||||
minus: '\u2212',
|
||||
lowast: '\u2217',
|
||||
radic: '\u221A',
|
||||
prop: '\u221D',
|
||||
infin: '\u221E',
|
||||
ang: '\u2220',
|
||||
and: '\u2227',
|
||||
or: '\u2228',
|
||||
cap: '\u2229',
|
||||
cup: '\u222A',
|
||||
'int': '\u222B',
|
||||
there4: '\u2234',
|
||||
sim: '\u223C',
|
||||
cong: '\u2245',
|
||||
asymp: '\u2248',
|
||||
ne: '\u2260',
|
||||
equiv: '\u2261',
|
||||
le: '\u2264',
|
||||
ge: '\u2265',
|
||||
sub: '\u2282',
|
||||
sup: '\u2283',
|
||||
nsub: '\u2284',
|
||||
sube: '\u2286',
|
||||
supe: '\u2287',
|
||||
oplus: '\u2295',
|
||||
otimes: '\u2297',
|
||||
perp: '\u22A5',
|
||||
sdot: '\u22C5',
|
||||
lceil: '\u2308',
|
||||
rceil: '\u2309',
|
||||
lfloor: '\u230A',
|
||||
rfloor: '\u230B',
|
||||
lang: '\u2329',
|
||||
rang: '\u232A',
|
||||
loz: '\u25CA',
|
||||
spades: '\u2660',
|
||||
clubs: '\u2663',
|
||||
hearts: '\u2665',
|
||||
diams: '\u2666'
|
||||
};
|
||||
810
node_modules/protobufjs/cli/node_modules/acorn/CHANGELOG.md
generated
vendored
Normal file
810
node_modules/protobufjs/cli/node_modules/acorn/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,810 @@
|
||||
## 8.8.0 (2022-07-21)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Allow parentheses around spread args in destructuring object assignment.
|
||||
|
||||
Fix an issue where the tree contained `directive` properties in when parsing with a language version that doesn't support them.
|
||||
|
||||
### New features
|
||||
|
||||
Support hashbang comments by default in ECMAScript 2023 and later.
|
||||
|
||||
## 8.7.1 (2021-04-26)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Stop handling `"use strict"` directives in ECMAScript versions before 5.
|
||||
|
||||
Fix an issue where duplicate quoted export names in `export *` syntax were incorrectly checked.
|
||||
|
||||
Add missing type for `tokTypes`.
|
||||
|
||||
## 8.7.0 (2021-12-27)
|
||||
|
||||
### New features
|
||||
|
||||
Support quoted export names.
|
||||
|
||||
Upgrade to Unicode 14.
|
||||
|
||||
Add support for Unicode 13 properties in regular expressions.
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Use a loop to find line breaks, because the existing regexp search would overrun the end of the searched range and waste a lot of time in minified code.
|
||||
|
||||
## 8.6.0 (2021-11-18)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug where an object literal with multiple `__proto__` properties would incorrectly be accepted if a later property value held an assigment.
|
||||
|
||||
### New features
|
||||
|
||||
Support class private fields with the `in` operator.
|
||||
|
||||
## 8.5.0 (2021-09-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Improve context-dependent tokenization in a number of corner cases.
|
||||
|
||||
Fix location tracking after a 0x2028 or 0x2029 character in a string literal (which before did not increase the line number).
|
||||
|
||||
Fix an issue where arrow function bodies in for loop context would inappropriately consume `in` operators.
|
||||
|
||||
Fix wrong end locations stored on SequenceExpression nodes.
|
||||
|
||||
Implement restriction that `for`/`of` loop LHS can't start with `let`.
|
||||
|
||||
### New features
|
||||
|
||||
Add support for ES2022 class static blocks.
|
||||
|
||||
Allow multiple input files to be passed to the CLI tool.
|
||||
|
||||
## 8.4.1 (2021-06-24)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug where `allowAwaitOutsideFunction` would allow `await` in class field initializers, and setting `ecmaVersion` to 13 or higher would allow top-level await in non-module sources.
|
||||
|
||||
## 8.4.0 (2021-06-11)
|
||||
|
||||
### New features
|
||||
|
||||
A new option, `allowSuperOutsideMethod`, can be used to suppress the error when `super` is used in the wrong context.
|
||||
|
||||
## 8.3.0 (2021-05-31)
|
||||
|
||||
### New features
|
||||
|
||||
Default `allowAwaitOutsideFunction` to true for ECMAScript 2022 an higher.
|
||||
|
||||
Add support for the `d` ([indices](https://github.com/tc39/proposal-regexp-match-indices)) regexp flag.
|
||||
|
||||
## 8.2.4 (2021-05-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix spec conformity in corner case 'for await (async of ...)'.
|
||||
|
||||
## 8.2.3 (2021-05-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix an issue where the library couldn't parse 'for (async of ...)'.
|
||||
|
||||
Fix a bug in UTF-16 decoding that would read characters incorrectly in some circumstances.
|
||||
|
||||
## 8.2.2 (2021-04-29)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug where a class field initialized to an async arrow function wouldn't allow await inside it. Same issue existed for generator arrow functions with yield.
|
||||
|
||||
## 8.2.1 (2021-04-24)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a regression introduced in 8.2.0 where static or async class methods with keyword names fail to parse.
|
||||
|
||||
## 8.2.0 (2021-04-24)
|
||||
|
||||
### New features
|
||||
|
||||
Add support for ES2022 class fields and private methods.
|
||||
|
||||
## 8.1.1 (2021-04-12)
|
||||
|
||||
### Various
|
||||
|
||||
Stop shipping source maps in the NPM package.
|
||||
|
||||
## 8.1.0 (2021-03-09)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a spurious error in nested destructuring arrays.
|
||||
|
||||
### New features
|
||||
|
||||
Expose `allowAwaitOutsideFunction` in CLI interface.
|
||||
|
||||
Make `allowImportExportAnywhere` also apply to `import.meta`.
|
||||
|
||||
## 8.0.5 (2021-01-25)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Adjust package.json to work with Node 12.16.0 and 13.0-13.6.
|
||||
|
||||
## 8.0.4 (2020-10-05)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make `await x ** y` an error, following the spec.
|
||||
|
||||
Fix potentially exponential regular expression.
|
||||
|
||||
## 8.0.3 (2020-10-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a wasteful loop during `Parser` creation when setting `ecmaVersion` to `"latest"`.
|
||||
|
||||
## 8.0.2 (2020-09-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make the TypeScript types reflect the current allowed values for `ecmaVersion`.
|
||||
|
||||
Fix another regexp/division tokenizer issue.
|
||||
|
||||
## 8.0.1 (2020-08-12)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Provide the correct value in the `version` export.
|
||||
|
||||
## 8.0.0 (2020-08-12)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disallow expressions like `(a = b) = c`.
|
||||
|
||||
Make non-octal escape sequences a syntax error in strict mode.
|
||||
|
||||
### New features
|
||||
|
||||
The package can now be loaded directly as an ECMAScript module in node 13+.
|
||||
|
||||
Update to the set of Unicode properties from ES2021.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The `ecmaVersion` option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release.
|
||||
|
||||
Some changes to method signatures that may be used by plugins.
|
||||
|
||||
## 7.4.0 (2020-08-03)
|
||||
|
||||
### New features
|
||||
|
||||
Add support for logical assignment operators.
|
||||
|
||||
Add support for numeric separators.
|
||||
|
||||
## 7.3.1 (2020-06-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make the string in the `version` export match the actual library version.
|
||||
|
||||
## 7.3.0 (2020-06-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail.
|
||||
|
||||
### New features
|
||||
|
||||
Add support for optional chaining (`?.`).
|
||||
|
||||
## 7.2.0 (2020-05-09)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix precedence issue in parsing of async arrow functions.
|
||||
|
||||
### New features
|
||||
|
||||
Add support for nullish coalescing.
|
||||
|
||||
Add support for `import.meta`.
|
||||
|
||||
Support `export * as ...` syntax.
|
||||
|
||||
Upgrade to Unicode 13.
|
||||
|
||||
## 6.4.1 (2020-03-09)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
More carefully check for valid UTF16 surrogate pairs in regexp validator.
|
||||
|
||||
## 7.1.1 (2020-03-01)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Treat `\8` and `\9` as invalid escapes in template strings.
|
||||
|
||||
Allow unicode escapes in property names that are keywords.
|
||||
|
||||
Don't error on an exponential operator expression as argument to `await`.
|
||||
|
||||
More carefully check for valid UTF16 surrogate pairs in regexp validator.
|
||||
|
||||
## 7.1.0 (2019-09-24)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disallow trailing object literal commas when ecmaVersion is less than 5.
|
||||
|
||||
### New features
|
||||
|
||||
Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on.
|
||||
|
||||
## 7.0.0 (2019-08-13)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
Changes the node format for dynamic imports to use the `ImportExpression` node type, as defined in [ESTree](https://github.com/estree/estree/blob/master/es2020.md#importexpression).
|
||||
|
||||
Makes 10 (ES2019) the default value for the `ecmaVersion` option.
|
||||
|
||||
## 6.3.0 (2019-08-12)
|
||||
|
||||
### New features
|
||||
|
||||
`sourceType: "module"` can now be used even when `ecmaVersion` is less than 6, to parse module-style code that otherwise conforms to an older standard.
|
||||
|
||||
## 6.2.1 (2019-07-21)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
|
||||
|
||||
Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances.
|
||||
|
||||
## 6.2.0 (2019-07-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Improve valid assignment checking in `for`/`in` and `for`/`of` loops.
|
||||
|
||||
Disallow binding `let` in patterns.
|
||||
|
||||
### New features
|
||||
|
||||
Support bigint syntax with `ecmaVersion` >= 11.
|
||||
|
||||
Support dynamic `import` syntax with `ecmaVersion` >= 11.
|
||||
|
||||
Upgrade to Unicode version 12.
|
||||
|
||||
## 6.1.1 (2019-02-27)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug that caused parsing default exports of with names to fail.
|
||||
|
||||
## 6.1.0 (2019-02-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix scope checking when redefining a `var` as a lexical binding.
|
||||
|
||||
### New features
|
||||
|
||||
Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins.
|
||||
|
||||
## 6.0.7 (2019-02-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Check that exported bindings are defined.
|
||||
|
||||
Don't treat `\u180e` as a whitespace character.
|
||||
|
||||
Check for duplicate parameter names in methods.
|
||||
|
||||
Don't allow shorthand properties when they are generators or async methods.
|
||||
|
||||
Forbid binding `await` in async arrow function's parameter list.
|
||||
|
||||
## 6.0.6 (2019-01-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
The content of class declarations and expressions is now always parsed in strict mode.
|
||||
|
||||
Don't allow `let` or `const` to bind the variable name `let`.
|
||||
|
||||
Treat class declarations as lexical.
|
||||
|
||||
Don't allow a generator function declaration as the sole body of an `if` or `else`.
|
||||
|
||||
Ignore `"use strict"` when after an empty statement.
|
||||
|
||||
Allow string line continuations with special line terminator characters.
|
||||
|
||||
Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.
|
||||
|
||||
Fix bug with parsing `yield` in a `for` loop initializer.
|
||||
|
||||
Implement special cases around scope checking for functions.
|
||||
|
||||
## 6.0.5 (2019-01-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.
|
||||
|
||||
Don't treat `let` as a keyword when the next token is `{` on the next line.
|
||||
|
||||
Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on.
|
||||
|
||||
## 6.0.4 (2018-11-05)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Further improvements to tokenizing regular expressions in corner cases.
|
||||
|
||||
## 6.0.3 (2018-11-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
|
||||
|
||||
Remove stray symlink in the package tarball.
|
||||
|
||||
## 6.0.2 (2018-09-26)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
|
||||
|
||||
## 6.0.1 (2018-09-14)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix wrong value in `version` export.
|
||||
|
||||
## 6.0.0 (2018-09-14)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Better handle variable-redefinition checks for catch bindings and functions directly under if statements.
|
||||
|
||||
Forbid `new.target` in top-level arrow functions.
|
||||
|
||||
Fix issue with parsing a regexp after `yield` in some contexts.
|
||||
|
||||
### New features
|
||||
|
||||
The package now comes with TypeScript definitions.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The default value of the `ecmaVersion` option is now 9 (2018).
|
||||
|
||||
Plugins work differently, and will have to be rewritten to work with this version.
|
||||
|
||||
The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`).
|
||||
|
||||
## 5.7.3 (2018-09-10)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix failure to tokenize regexps after expressions like `x.of`.
|
||||
|
||||
Better error message for unterminated template literals.
|
||||
|
||||
## 5.7.2 (2018-08-24)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Properly handle `allowAwaitOutsideFunction` in for statements.
|
||||
|
||||
Treat function declarations at the top level of modules like let bindings.
|
||||
|
||||
Don't allow async function declarations as the only statement under a label.
|
||||
|
||||
## 5.7.0 (2018-06-15)
|
||||
|
||||
### New features
|
||||
|
||||
Upgraded to Unicode 11.
|
||||
|
||||
## 5.6.0 (2018-05-31)
|
||||
|
||||
### New features
|
||||
|
||||
Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
|
||||
|
||||
Allow binding-less catch statements when ECMAVersion >= 10.
|
||||
|
||||
Add `allowAwaitOutsideFunction` option for parsing top-level `await`.
|
||||
|
||||
## 5.5.3 (2018-03-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps.
|
||||
|
||||
## 5.5.2 (2018-03-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0.
|
||||
|
||||
## 5.5.1 (2018-03-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix misleading error message for octal escapes in template strings.
|
||||
|
||||
## 5.5.0 (2018-02-27)
|
||||
|
||||
### New features
|
||||
|
||||
The identifier character categorization is now based on Unicode version 10.
|
||||
|
||||
Acorn will now validate the content of regular expressions, including new ES9 features.
|
||||
|
||||
## 5.4.0 (2018-02-01)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disallow duplicate or escaped flags on regular expressions.
|
||||
|
||||
Disallow octal escapes in strings in strict mode.
|
||||
|
||||
### New features
|
||||
|
||||
Add support for async iteration.
|
||||
|
||||
Add support for object spread and rest.
|
||||
|
||||
## 5.3.0 (2017-12-28)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix parsing of floating point literals with leading zeroes in loose mode.
|
||||
|
||||
Allow duplicate property names in object patterns.
|
||||
|
||||
Don't allow static class methods named `prototype`.
|
||||
|
||||
Disallow async functions directly under `if` or `else`.
|
||||
|
||||
Parse right-hand-side of `for`/`of` as an assignment expression.
|
||||
|
||||
Stricter parsing of `for`/`in`.
|
||||
|
||||
Don't allow unicode escapes in contextual keywords.
|
||||
|
||||
### New features
|
||||
|
||||
Parsing class members was factored into smaller methods to allow plugins to hook into it.
|
||||
|
||||
## 5.2.1 (2017-10-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a token context corruption bug.
|
||||
|
||||
## 5.2.0 (2017-10-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix token context tracking for `class` and `function` in property-name position.
|
||||
|
||||
Make sure `%*` isn't parsed as a valid operator.
|
||||
|
||||
Allow shorthand properties `get` and `set` to be followed by default values.
|
||||
|
||||
Disallow `super` when not in callee or object position.
|
||||
|
||||
### New features
|
||||
|
||||
Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements.
|
||||
|
||||
## 5.1.2 (2017-09-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disable parsing of legacy HTML-style comments in modules.
|
||||
|
||||
Fix parsing of async methods whose names are keywords.
|
||||
|
||||
## 5.1.1 (2017-07-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix problem with disambiguating regexp and division after a class.
|
||||
|
||||
## 5.1.0 (2017-07-05)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.
|
||||
|
||||
Parse zero-prefixed numbers with non-octal digits as decimal.
|
||||
|
||||
Allow object/array patterns in rest parameters.
|
||||
|
||||
Don't error when `yield` is used as a property name.
|
||||
|
||||
Allow `async` as a shorthand object property.
|
||||
|
||||
### New features
|
||||
|
||||
Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
|
||||
|
||||
## 5.0.3 (2017-04-01)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix spurious duplicate variable definition errors for named functions.
|
||||
|
||||
## 5.0.2 (2017-03-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error.
|
||||
|
||||
## 5.0.0 (2017-03-28)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Raise an error for duplicated lexical bindings.
|
||||
|
||||
Fix spurious error when an assignement expression occurred after a spread expression.
|
||||
|
||||
Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.
|
||||
|
||||
Allow labels in front or `var` declarations, even in strict mode.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`.
|
||||
|
||||
## 4.0.11 (2017-02-07)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Allow all forms of member expressions to be parenthesized as lvalue.
|
||||
|
||||
## 4.0.10 (2017-02-07)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Don't expect semicolons after default-exported functions or classes, even when they are expressions.
|
||||
|
||||
Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode.
|
||||
|
||||
## 4.0.9 (2017-02-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again.
|
||||
|
||||
## 4.0.8 (2017-02-03)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet.
|
||||
|
||||
## 4.0.7 (2017-02-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Accept invalidly rejected code like `(x).y = 2` again.
|
||||
|
||||
Don't raise an error when a function _inside_ strict code has a non-simple parameter list.
|
||||
|
||||
## 4.0.6 (2017-02-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check.
|
||||
|
||||
## 4.0.5 (2017-02-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disallow parenthesized pattern expressions.
|
||||
|
||||
Allow keywords as export names.
|
||||
|
||||
Don't allow the `async` keyword to be parenthesized.
|
||||
|
||||
Properly raise an error when a keyword contains a character escape.
|
||||
|
||||
Allow `"use strict"` to appear after other string literal expressions.
|
||||
|
||||
Disallow labeled declarations.
|
||||
|
||||
## 4.0.4 (2016-12-19)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix crash when `export` was followed by a keyword that can't be
|
||||
exported.
|
||||
|
||||
## 4.0.3 (2016-08-16)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.
|
||||
|
||||
Properly parse properties named `async` in ES2017 mode.
|
||||
|
||||
Fix bug where reserved words were broken in ES2017 mode.
|
||||
|
||||
## 4.0.2 (2016-08-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Don't ignore period or 'e' characters after octal numbers.
|
||||
|
||||
Fix broken parsing for call expressions in default parameter values of arrow functions.
|
||||
|
||||
## 4.0.1 (2016-08-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix false positives in duplicated export name errors.
|
||||
|
||||
## 4.0.0 (2016-08-07)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The default `ecmaVersion` option value is now 7.
|
||||
|
||||
A number of internal method signatures changed, so plugins might need to be updated.
|
||||
|
||||
### Bug fixes
|
||||
|
||||
The parser now raises errors on duplicated export names.
|
||||
|
||||
`arguments` and `eval` can now be used in shorthand properties.
|
||||
|
||||
Duplicate parameter names in non-simple argument lists now always produce an error.
|
||||
|
||||
### New features
|
||||
|
||||
The `ecmaVersion` option now also accepts year-style version numbers
|
||||
(2015, etc).
|
||||
|
||||
Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
|
||||
|
||||
Support for trailing commas in call expressions when `ecmaVersion` is >= 8.
|
||||
|
||||
## 3.3.0 (2016-07-25)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug in tokenizing of regexp operator after a function declaration.
|
||||
|
||||
Fix parser crash when parsing an array pattern with a hole.
|
||||
|
||||
### New features
|
||||
|
||||
Implement check against complex argument lists in functions that enable strict mode in ES7.
|
||||
|
||||
## 3.2.0 (2016-06-07)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Improve handling of lack of unicode regexp support in host
|
||||
environment.
|
||||
|
||||
Properly reject shorthand properties whose name is a keyword.
|
||||
|
||||
### New features
|
||||
|
||||
Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object.
|
||||
|
||||
## 3.1.0 (2016-04-18)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Properly tokenize the division operator directly after a function expression.
|
||||
|
||||
Allow trailing comma in destructuring arrays.
|
||||
|
||||
## 3.0.4 (2016-02-25)
|
||||
|
||||
### Fixes
|
||||
|
||||
Allow update expressions as left-hand-side of the ES7 exponential operator.
|
||||
|
||||
## 3.0.2 (2016-02-10)
|
||||
|
||||
### Fixes
|
||||
|
||||
Fix bug that accidentally made `undefined` a reserved word when parsing ES7.
|
||||
|
||||
## 3.0.0 (2016-02-10)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The default value of the `ecmaVersion` option is now 6 (used to be 5).
|
||||
|
||||
Support for comprehension syntax (which was dropped from the draft spec) has been removed.
|
||||
|
||||
### Fixes
|
||||
|
||||
`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code.
|
||||
|
||||
A parenthesized class or function expression after `export default` is now parsed correctly.
|
||||
|
||||
### New features
|
||||
|
||||
When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).
|
||||
|
||||
The identifier character ranges are now based on Unicode 8.0.0.
|
||||
|
||||
Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled.
|
||||
|
||||
## 2.7.0 (2016-01-04)
|
||||
|
||||
### Fixes
|
||||
|
||||
Stop allowing rest parameters in setters.
|
||||
|
||||
Disallow `y` rexexp flag in ES5.
|
||||
|
||||
Disallow `\00` and `\000` escapes in strict mode.
|
||||
|
||||
Raise an error when an import name is a reserved word.
|
||||
|
||||
## 2.6.2 (2015-11-10)
|
||||
|
||||
### Fixes
|
||||
|
||||
Don't crash when no options object is passed.
|
||||
|
||||
## 2.6.0 (2015-11-09)
|
||||
|
||||
### Fixes
|
||||
|
||||
Add `await` as a reserved word in module sources.
|
||||
|
||||
Disallow `yield` in a parameter default value for a generator.
|
||||
|
||||
Forbid using a comma after a rest pattern in an array destructuring.
|
||||
|
||||
### New features
|
||||
|
||||
Support parsing stdin in command-line tool.
|
||||
|
||||
## 2.5.0 (2015-10-27)
|
||||
|
||||
### Fixes
|
||||
|
||||
Fix tokenizer support in the command-line tool.
|
||||
|
||||
Stop allowing `new.target` outside of functions.
|
||||
|
||||
Remove legacy `guard` and `guardedHandler` properties from try nodes.
|
||||
|
||||
Stop allowing multiple `__proto__` properties on an object literal in strict mode.
|
||||
|
||||
Don't allow rest parameters to be non-identifier patterns.
|
||||
|
||||
Check for duplicate paramter names in arrow functions.
|
||||
21
node_modules/protobufjs/cli/node_modules/acorn/LICENSE
generated
vendored
Normal file
21
node_modules/protobufjs/cli/node_modules/acorn/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2012-2022 by various contributors (see AUTHORS)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
273
node_modules/protobufjs/cli/node_modules/acorn/README.md
generated
vendored
Normal file
273
node_modules/protobufjs/cli/node_modules/acorn/README.md
generated
vendored
Normal file
@@ -0,0 +1,273 @@
|
||||
# Acorn
|
||||
|
||||
A tiny, fast JavaScript parser written in JavaScript.
|
||||
|
||||
## Community
|
||||
|
||||
Acorn is open source software released under an
|
||||
[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE).
|
||||
|
||||
You are welcome to
|
||||
[report bugs](https://github.com/acornjs/acorn/issues) or create pull
|
||||
requests on [github](https://github.com/acornjs/acorn). For questions
|
||||
and discussion, please use the
|
||||
[Tern discussion forum](https://discuss.ternjs.net).
|
||||
|
||||
## Installation
|
||||
|
||||
The easiest way to install acorn is from [`npm`](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
npm install acorn
|
||||
```
|
||||
|
||||
Alternately, you can download the source and build acorn yourself:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/acornjs/acorn.git
|
||||
cd acorn
|
||||
npm install
|
||||
```
|
||||
|
||||
## Interface
|
||||
|
||||
**parse**`(input, options)` is the main interface to the library. The
|
||||
`input` parameter is a string, `options` must be an object setting
|
||||
some of the options listed below. The return value will be an abstract
|
||||
syntax tree object as specified by the [ESTree
|
||||
spec](https://github.com/estree/estree).
|
||||
|
||||
```javascript
|
||||
let acorn = require("acorn");
|
||||
console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}));
|
||||
```
|
||||
|
||||
When encountering a syntax error, the parser will raise a
|
||||
`SyntaxError` object with a meaningful message. The error object will
|
||||
have a `pos` property that indicates the string offset at which the
|
||||
error occurred, and a `loc` object that contains a `{line, column}`
|
||||
object referring to that same position.
|
||||
|
||||
Options are provided by in a second argument, which should be an
|
||||
object containing any of these fields (only `ecmaVersion` is
|
||||
required):
|
||||
|
||||
- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
|
||||
either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019),
|
||||
11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` (the
|
||||
latest the library supports). This influences support for strict
|
||||
mode, the set of reserved words, and support for new syntax
|
||||
features.
|
||||
|
||||
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
|
||||
implemented by Acorn. Other proposed new features must be
|
||||
implemented through plugins.
|
||||
|
||||
- **sourceType**: Indicate the mode the code should be parsed in. Can be
|
||||
either `"script"` or `"module"`. This influences global strict mode
|
||||
and parsing of `import` and `export` declarations.
|
||||
|
||||
**NOTE**: If set to `"module"`, then static `import` / `export` syntax
|
||||
will be valid, even if `ecmaVersion` is less than 6.
|
||||
|
||||
- **onInsertedSemicolon**: If given a callback, that callback will be
|
||||
called whenever a missing semicolon is inserted by the parser. The
|
||||
callback will be given the character offset of the point where the
|
||||
semicolon is inserted as argument, and if `locations` is on, also a
|
||||
`{line, column}` object representing this position.
|
||||
|
||||
- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing
|
||||
commas.
|
||||
|
||||
- **allowReserved**: If `false`, using a reserved word will generate
|
||||
an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher
|
||||
versions. When given the value `"never"`, reserved words and
|
||||
keywords can also not be used as property names (as in Internet
|
||||
Explorer's old parser).
|
||||
|
||||
- **allowReturnOutsideFunction**: By default, a return statement at
|
||||
the top level raises an error. Set this to `true` to accept such
|
||||
code.
|
||||
|
||||
- **allowImportExportEverywhere**: By default, `import` and `export`
|
||||
declarations can only appear at a program's top level. Setting this
|
||||
option to `true` allows them anywhere where a statement is allowed,
|
||||
and also allows `import.meta` expressions to appear in scripts
|
||||
(when `sourceType` is not `"module"`).
|
||||
|
||||
- **allowAwaitOutsideFunction**: If `false`, `await` expressions can
|
||||
only appear inside `async` functions. Defaults to `true` for
|
||||
`ecmaVersion` 2022 and later, `false` for lower versions. Setting this option to
|
||||
`true` allows to have top-level `await` expressions. They are
|
||||
still not allowed in non-`async` functions, though.
|
||||
|
||||
- **allowSuperOutsideMethod**: By default, `super` outside a method
|
||||
raises an error. Set this to `true` to accept such code.
|
||||
|
||||
- **allowHashBang**: When this is enabled, if the code starts with the
|
||||
characters `#!` (as in a shellscript), the first line will be
|
||||
treated as a comment. Defaults to true when `ecmaVersion` >= 2023.
|
||||
|
||||
- **locations**: When `true`, each node has a `loc` object attached
|
||||
with `start` and `end` subobjects, each of which contains the
|
||||
one-based line and zero-based column numbers in `{line, column}`
|
||||
form. Default is `false`.
|
||||
|
||||
- **onToken**: If a function is passed for this option, each found
|
||||
token will be passed in same format as tokens returned from
|
||||
`tokenizer().getToken()`.
|
||||
|
||||
If array is passed, each found token is pushed to it.
|
||||
|
||||
Note that you are not allowed to call the parser from the
|
||||
callback—that will corrupt its internal state.
|
||||
|
||||
- **onComment**: If a function is passed for this option, whenever a
|
||||
comment is encountered the function will be called with the
|
||||
following parameters:
|
||||
|
||||
- `block`: `true` if the comment is a block comment, false if it
|
||||
is a line comment.
|
||||
- `text`: The content of the comment.
|
||||
- `start`: Character offset of the start of the comment.
|
||||
- `end`: Character offset of the end of the comment.
|
||||
|
||||
When the `locations` options is on, the `{line, column}` locations
|
||||
of the comment’s start and end are passed as two additional
|
||||
parameters.
|
||||
|
||||
If array is passed for this option, each found comment is pushed
|
||||
to it as object in Esprima format:
|
||||
|
||||
```javascript
|
||||
{
|
||||
"type": "Line" | "Block",
|
||||
"value": "comment text",
|
||||
"start": Number,
|
||||
"end": Number,
|
||||
// If `locations` option is on:
|
||||
"loc": {
|
||||
"start": {line: Number, column: Number}
|
||||
"end": {line: Number, column: Number}
|
||||
},
|
||||
// If `ranges` option is on:
|
||||
"range": [Number, Number]
|
||||
}
|
||||
```
|
||||
|
||||
Note that you are not allowed to call the parser from the
|
||||
callback—that will corrupt its internal state.
|
||||
|
||||
- **ranges**: Nodes have their start and end characters offsets
|
||||
recorded in `start` and `end` properties (directly on the node,
|
||||
rather than the `loc` object, which holds line/column data. To also
|
||||
add a
|
||||
[semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678)
|
||||
`range` property holding a `[start, end]` array with the same
|
||||
numbers, set the `ranges` option to `true`.
|
||||
|
||||
- **program**: It is possible to parse multiple files into a single
|
||||
AST by passing the tree produced by parsing the first file as the
|
||||
`program` option in subsequent parses. This will add the toplevel
|
||||
forms of the parsed file to the "Program" (top) node of an existing
|
||||
parse tree.
|
||||
|
||||
- **sourceFile**: When the `locations` option is `true`, you can pass
|
||||
this option to add a `source` attribute in every node’s `loc`
|
||||
object. Note that the contents of this option are not examined or
|
||||
processed in any way; you are free to use whatever format you
|
||||
choose.
|
||||
|
||||
- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property
|
||||
will be added (regardless of the `location` option) directly to the
|
||||
nodes, rather than the `loc` object.
|
||||
|
||||
- **preserveParens**: If this option is `true`, parenthesized expressions
|
||||
are represented by (non-standard) `ParenthesizedExpression` nodes
|
||||
that have a single `expression` property containing the expression
|
||||
inside parentheses.
|
||||
|
||||
**parseExpressionAt**`(input, offset, options)` will parse a single
|
||||
expression in a string, and return its AST. It will not complain if
|
||||
there is more of the string left after the expression.
|
||||
|
||||
**tokenizer**`(input, options)` returns an object with a `getToken`
|
||||
method that can be called repeatedly to get the next token, a `{start,
|
||||
end, type, value}` object (with added `loc` property when the
|
||||
`locations` option is enabled and `range` property when the `ranges`
|
||||
option is enabled). When the token's type is `tokTypes.eof`, you
|
||||
should stop calling the method, since it will keep returning that same
|
||||
token forever.
|
||||
|
||||
In ES6 environment, returned result can be used as any other
|
||||
protocol-compliant iterable:
|
||||
|
||||
```javascript
|
||||
for (let token of acorn.tokenizer(str)) {
|
||||
// iterate over the tokens
|
||||
}
|
||||
|
||||
// transform code to array of tokens:
|
||||
var tokens = [...acorn.tokenizer(str)];
|
||||
```
|
||||
|
||||
**tokTypes** holds an object mapping names to the token type objects
|
||||
that end up in the `type` properties of tokens.
|
||||
|
||||
**getLineInfo**`(input, offset)` can be used to get a `{line,
|
||||
column}` object for a given program string and offset.
|
||||
|
||||
### The `Parser` class
|
||||
|
||||
Instances of the **`Parser`** class contain all the state and logic
|
||||
that drives a parse. It has static methods `parse`,
|
||||
`parseExpressionAt`, and `tokenizer` that match the top-level
|
||||
functions by the same name.
|
||||
|
||||
When extending the parser with plugins, you need to call these methods
|
||||
on the extended version of the class. To extend a parser with plugins,
|
||||
you can use its static `extend` method.
|
||||
|
||||
```javascript
|
||||
var acorn = require("acorn");
|
||||
var jsx = require("acorn-jsx");
|
||||
var JSXParser = acorn.Parser.extend(jsx());
|
||||
JSXParser.parse("foo(<bar/>)", {ecmaVersion: 2020});
|
||||
```
|
||||
|
||||
The `extend` method takes any number of plugin values, and returns a
|
||||
new `Parser` class that includes the extra parser logic provided by
|
||||
the plugins.
|
||||
|
||||
## Command line interface
|
||||
|
||||
The `bin/acorn` utility can be used to parse a file from the command
|
||||
line. It accepts as arguments its input file and the following
|
||||
options:
|
||||
|
||||
- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version
|
||||
to parse. Default is version 9.
|
||||
|
||||
- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.
|
||||
|
||||
- `--locations`: Attaches a "loc" object to each node with "start" and
|
||||
"end" subobjects, each of which contains the one-based line and
|
||||
zero-based column numbers in `{line, column}` form.
|
||||
|
||||
- `--allow-hash-bang`: If the code starts with the characters #! (as
|
||||
in a shellscript), the first line will be treated as a comment.
|
||||
|
||||
- `--allow-await-outside-function`: Allows top-level `await` expressions.
|
||||
See the `allowAwaitOutsideFunction` option for more information.
|
||||
|
||||
- `--compact`: No whitespace is used in the AST output.
|
||||
|
||||
- `--silent`: Do not output the AST, just return the exit status.
|
||||
|
||||
- `--help`: Print the usage information and quit.
|
||||
|
||||
The utility spits out the syntax tree as JSON data.
|
||||
|
||||
## Existing plugins
|
||||
|
||||
- [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx)
|
||||
4
node_modules/protobufjs/cli/node_modules/acorn/bin/acorn
generated
vendored
Executable file
4
node_modules/protobufjs/cli/node_modules/acorn/bin/acorn
generated
vendored
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict"
|
||||
|
||||
require("../dist/bin.js")
|
||||
252
node_modules/protobufjs/cli/node_modules/acorn/dist/acorn.d.ts
generated
vendored
Normal file
252
node_modules/protobufjs/cli/node_modules/acorn/dist/acorn.d.ts
generated
vendored
Normal file
@@ -0,0 +1,252 @@
|
||||
export as namespace acorn
|
||||
export = acorn
|
||||
|
||||
declare namespace acorn {
|
||||
function parse(input: string, options: Options): Node
|
||||
|
||||
function parseExpressionAt(input: string, pos: number, options: Options): Node
|
||||
|
||||
function tokenizer(input: string, options: Options): {
|
||||
getToken(): Token
|
||||
[Symbol.iterator](): Iterator<Token>
|
||||
}
|
||||
|
||||
type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest'
|
||||
|
||||
interface Options {
|
||||
ecmaVersion: ecmaVersion
|
||||
sourceType?: 'script' | 'module'
|
||||
onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
|
||||
onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
|
||||
allowReserved?: boolean | 'never'
|
||||
allowReturnOutsideFunction?: boolean
|
||||
allowImportExportEverywhere?: boolean
|
||||
allowAwaitOutsideFunction?: boolean
|
||||
allowSuperOutsideMethod?: boolean
|
||||
allowHashBang?: boolean
|
||||
locations?: boolean
|
||||
onToken?: ((token: Token) => any) | Token[]
|
||||
onComment?: ((
|
||||
isBlock: boolean, text: string, start: number, end: number, startLoc?: Position,
|
||||
endLoc?: Position
|
||||
) => void) | Comment[]
|
||||
ranges?: boolean
|
||||
program?: Node
|
||||
sourceFile?: string
|
||||
directSourceFile?: string
|
||||
preserveParens?: boolean
|
||||
}
|
||||
|
||||
class Parser {
|
||||
// state.js
|
||||
lineStart: number;
|
||||
options: Options;
|
||||
curLine: number;
|
||||
start: number;
|
||||
end: number;
|
||||
input: string;
|
||||
type: TokenType;
|
||||
|
||||
// state.js
|
||||
constructor(options: Options, input: string, startPos?: number)
|
||||
parse(this: Parser): Node
|
||||
|
||||
// tokenize.js
|
||||
next(): void;
|
||||
nextToken(): void;
|
||||
|
||||
// statement.js
|
||||
parseTopLevel(node: Node): Node;
|
||||
|
||||
// node.js
|
||||
finishNode(node: Node, type: string): Node;
|
||||
finishNodeAt(node: Node, type: string, pos: number, loc: Position): Node;
|
||||
|
||||
// location.js
|
||||
raise(pos: number, message: string) : void;
|
||||
raiseRecoverable?(pos: number, message: string) : void;
|
||||
|
||||
// parseutils.js
|
||||
unexpected(pos: number) : void;
|
||||
|
||||
// index.js
|
||||
static acorn: typeof acorn;
|
||||
|
||||
// state.js
|
||||
static parse(this: typeof Parser, input: string, options: Options): Node
|
||||
static parseExpressionAt(this: typeof Parser, input: string, pos: number, options: Options): Node
|
||||
static tokenizer(this: typeof Parser, input: string, options: Options): {
|
||||
getToken(): Token
|
||||
[Symbol.iterator](): Iterator<Token>
|
||||
}
|
||||
static extend(this: typeof Parser, ...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser
|
||||
}
|
||||
|
||||
interface Position { line: number; column: number; offset: number }
|
||||
|
||||
const defaultOptions: Options
|
||||
|
||||
function getLineInfo(input: string, offset: number): Position
|
||||
|
||||
class SourceLocation {
|
||||
start: Position
|
||||
end: Position
|
||||
source?: string | null
|
||||
constructor(p: Parser, start: Position, end: Position)
|
||||
}
|
||||
|
||||
class Node {
|
||||
type: string
|
||||
start: number
|
||||
end: number
|
||||
loc?: SourceLocation
|
||||
sourceFile?: string
|
||||
range?: [number, number]
|
||||
constructor(parser: Parser, pos: number, loc?: SourceLocation)
|
||||
}
|
||||
|
||||
class TokenType {
|
||||
label: string
|
||||
keyword: string
|
||||
beforeExpr: boolean
|
||||
startsExpr: boolean
|
||||
isLoop: boolean
|
||||
isAssign: boolean
|
||||
prefix: boolean
|
||||
postfix: boolean
|
||||
binop: number
|
||||
updateContext?: (prevType: TokenType) => void
|
||||
constructor(label: string, conf?: any)
|
||||
}
|
||||
|
||||
const tokTypes: {
|
||||
num: TokenType
|
||||
regexp: TokenType
|
||||
string: TokenType
|
||||
name: TokenType
|
||||
privateId: TokenType
|
||||
eof: TokenType
|
||||
bracketL: TokenType
|
||||
bracketR: TokenType
|
||||
braceL: TokenType
|
||||
braceR: TokenType
|
||||
parenL: TokenType
|
||||
parenR: TokenType
|
||||
comma: TokenType
|
||||
semi: TokenType
|
||||
colon: TokenType
|
||||
dot: TokenType
|
||||
question: TokenType
|
||||
questionDot: TokenType
|
||||
arrow: TokenType
|
||||
template: TokenType
|
||||
invalidTemplate: TokenType
|
||||
ellipsis: TokenType
|
||||
backQuote: TokenType
|
||||
dollarBraceL: TokenType
|
||||
eq: TokenType
|
||||
assign: TokenType
|
||||
incDec: TokenType
|
||||
prefix: TokenType
|
||||
logicalOR: TokenType
|
||||
logicalAND: TokenType
|
||||
bitwiseOR: TokenType
|
||||
bitwiseXOR: TokenType
|
||||
bitwiseAND: TokenType
|
||||
equality: TokenType
|
||||
relational: TokenType
|
||||
bitShift: TokenType
|
||||
plusMin: TokenType
|
||||
modulo: TokenType
|
||||
star: TokenType
|
||||
slash: TokenType
|
||||
starstar: TokenType
|
||||
coalesce: TokenType
|
||||
_break: TokenType
|
||||
_case: TokenType
|
||||
_catch: TokenType
|
||||
_continue: TokenType
|
||||
_debugger: TokenType
|
||||
_default: TokenType
|
||||
_do: TokenType
|
||||
_else: TokenType
|
||||
_finally: TokenType
|
||||
_for: TokenType
|
||||
_function: TokenType
|
||||
_if: TokenType
|
||||
_return: TokenType
|
||||
_switch: TokenType
|
||||
_throw: TokenType
|
||||
_try: TokenType
|
||||
_var: TokenType
|
||||
_const: TokenType
|
||||
_while: TokenType
|
||||
_with: TokenType
|
||||
_new: TokenType
|
||||
_this: TokenType
|
||||
_super: TokenType
|
||||
_class: TokenType
|
||||
_extends: TokenType
|
||||
_export: TokenType
|
||||
_import: TokenType
|
||||
_null: TokenType
|
||||
_true: TokenType
|
||||
_false: TokenType
|
||||
_in: TokenType
|
||||
_instanceof: TokenType
|
||||
_typeof: TokenType
|
||||
_void: TokenType
|
||||
_delete: TokenType
|
||||
}
|
||||
|
||||
class TokContext {
|
||||
constructor(token: string, isExpr: boolean, preserveSpace: boolean, override?: (p: Parser) => void)
|
||||
}
|
||||
|
||||
const tokContexts: {
|
||||
b_stat: TokContext
|
||||
b_expr: TokContext
|
||||
b_tmpl: TokContext
|
||||
p_stat: TokContext
|
||||
p_expr: TokContext
|
||||
q_tmpl: TokContext
|
||||
f_expr: TokContext
|
||||
f_stat: TokContext
|
||||
f_expr_gen: TokContext
|
||||
f_gen: TokContext
|
||||
}
|
||||
|
||||
function isIdentifierStart(code: number, astral?: boolean): boolean
|
||||
|
||||
function isIdentifierChar(code: number, astral?: boolean): boolean
|
||||
|
||||
interface AbstractToken {
|
||||
}
|
||||
|
||||
interface Comment extends AbstractToken {
|
||||
type: string
|
||||
value: string
|
||||
start: number
|
||||
end: number
|
||||
loc?: SourceLocation
|
||||
range?: [number, number]
|
||||
}
|
||||
|
||||
class Token {
|
||||
type: TokenType
|
||||
value: any
|
||||
start: number
|
||||
end: number
|
||||
loc?: SourceLocation
|
||||
range?: [number, number]
|
||||
constructor(p: Parser)
|
||||
}
|
||||
|
||||
function isNewLine(code: number): boolean
|
||||
|
||||
const lineBreak: RegExp
|
||||
|
||||
const lineBreakG: RegExp
|
||||
|
||||
const version: string
|
||||
}
|
||||
5605
node_modules/protobufjs/cli/node_modules/acorn/dist/acorn.js
generated
vendored
Normal file
5605
node_modules/protobufjs/cli/node_modules/acorn/dist/acorn.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5574
node_modules/protobufjs/cli/node_modules/acorn/dist/acorn.mjs
generated
vendored
Normal file
5574
node_modules/protobufjs/cli/node_modules/acorn/dist/acorn.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
node_modules/protobufjs/cli/node_modules/acorn/dist/acorn.mjs.d.ts
generated
vendored
Normal file
2
node_modules/protobufjs/cli/node_modules/acorn/dist/acorn.mjs.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import * as acorn from "./acorn";
|
||||
export = acorn;
|
||||
91
node_modules/protobufjs/cli/node_modules/acorn/dist/bin.js
generated
vendored
Normal file
91
node_modules/protobufjs/cli/node_modules/acorn/dist/bin.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var acorn = require('./acorn.js');
|
||||
|
||||
function _interopNamespace(e) {
|
||||
if (e && e.__esModule) return e;
|
||||
var n = Object.create(null);
|
||||
if (e) {
|
||||
Object.keys(e).forEach(function (k) {
|
||||
if (k !== 'default') {
|
||||
var d = Object.getOwnPropertyDescriptor(e, k);
|
||||
Object.defineProperty(n, k, d.get ? d : {
|
||||
enumerable: true,
|
||||
get: function () { return e[k]; }
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
n["default"] = e;
|
||||
return Object.freeze(n);
|
||||
}
|
||||
|
||||
var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn);
|
||||
|
||||
var inputFilePaths = [], forceFileName = false, fileMode = false, silent = false, compact = false, tokenize = false;
|
||||
var options = {};
|
||||
|
||||
function help(status) {
|
||||
var print = (status === 0) ? console.log : console.error;
|
||||
print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|...|--ecma2015|--ecma2016|--ecma2017|--ecma2018|...]");
|
||||
print(" [--tokenize] [--locations] [--allow-hash-bang] [--allow-await-outside-function] [--compact] [--silent] [--module] [--help] [--] [<infile>...]");
|
||||
process.exit(status);
|
||||
}
|
||||
|
||||
for (var i = 2; i < process.argv.length; ++i) {
|
||||
var arg = process.argv[i];
|
||||
if (arg[0] !== "-" || arg === "-") { inputFilePaths.push(arg); }
|
||||
else if (arg === "--") {
|
||||
inputFilePaths.push.apply(inputFilePaths, process.argv.slice(i + 1));
|
||||
forceFileName = true;
|
||||
break
|
||||
} else if (arg === "--locations") { options.locations = true; }
|
||||
else if (arg === "--allow-hash-bang") { options.allowHashBang = true; }
|
||||
else if (arg === "--allow-await-outside-function") { options.allowAwaitOutsideFunction = true; }
|
||||
else if (arg === "--silent") { silent = true; }
|
||||
else if (arg === "--compact") { compact = true; }
|
||||
else if (arg === "--help") { help(0); }
|
||||
else if (arg === "--tokenize") { tokenize = true; }
|
||||
else if (arg === "--module") { options.sourceType = "module"; }
|
||||
else {
|
||||
var match = arg.match(/^--ecma(\d+)$/);
|
||||
if (match)
|
||||
{ options.ecmaVersion = +match[1]; }
|
||||
else
|
||||
{ help(1); }
|
||||
}
|
||||
}
|
||||
|
||||
function run(codeList) {
|
||||
var result = [], fileIdx = 0;
|
||||
try {
|
||||
codeList.forEach(function (code, idx) {
|
||||
fileIdx = idx;
|
||||
if (!tokenize) {
|
||||
result = acorn__namespace.parse(code, options);
|
||||
options.program = result;
|
||||
} else {
|
||||
var tokenizer = acorn__namespace.tokenizer(code, options), token;
|
||||
do {
|
||||
token = tokenizer.getToken();
|
||||
result.push(token);
|
||||
} while (token.type !== acorn__namespace.tokTypes.eof)
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(fileMode ? e.message.replace(/\(\d+:\d+\)$/, function (m) { return m.slice(0, 1) + inputFilePaths[fileIdx] + " " + m.slice(1); }) : e.message);
|
||||
process.exit(1);
|
||||
}
|
||||
if (!silent) { console.log(JSON.stringify(result, null, compact ? null : 2)); }
|
||||
}
|
||||
|
||||
if (fileMode = inputFilePaths.length && (forceFileName || !inputFilePaths.includes("-") || inputFilePaths.length !== 1)) {
|
||||
run(inputFilePaths.map(function (path) { return fs.readFileSync(path, "utf8"); }));
|
||||
} else {
|
||||
var code = "";
|
||||
process.stdin.resume();
|
||||
process.stdin.on("data", function (chunk) { return code += chunk; });
|
||||
process.stdin.on("end", function () { return run([code]); });
|
||||
}
|
||||
50
node_modules/protobufjs/cli/node_modules/acorn/package.json
generated
vendored
Normal file
50
node_modules/protobufjs/cli/node_modules/acorn/package.json
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "acorn",
|
||||
"description": "ECMAScript parser",
|
||||
"homepage": "https://github.com/acornjs/acorn",
|
||||
"main": "dist/acorn.js",
|
||||
"types": "dist/acorn.d.ts",
|
||||
"module": "dist/acorn.mjs",
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"import": "./dist/acorn.mjs",
|
||||
"require": "./dist/acorn.js",
|
||||
"default": "./dist/acorn.js"
|
||||
},
|
||||
"./dist/acorn.js"
|
||||
],
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"version": "8.8.0",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
},
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Marijn Haverbeke",
|
||||
"email": "marijnh@gmail.com",
|
||||
"web": "https://marijnhaverbeke.nl"
|
||||
},
|
||||
{
|
||||
"name": "Ingvar Stepanyan",
|
||||
"email": "me@rreverser.com",
|
||||
"web": "https://rreverser.com/"
|
||||
},
|
||||
{
|
||||
"name": "Adrian Heine",
|
||||
"web": "http://adrianheine.de"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/acornjs/acorn.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"prepare": "cd ..; npm run build:main"
|
||||
},
|
||||
"bin": {
|
||||
"acorn": "./bin/acorn"
|
||||
}
|
||||
}
|
||||
216
node_modules/protobufjs/cli/node_modules/argparse/CHANGELOG.md
generated
vendored
Normal file
216
node_modules/protobufjs/cli/node_modules/argparse/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
|
||||
## [2.0.1] - 2020-08-29
|
||||
### Fixed
|
||||
- Fix issue with `process.argv` when used with interpreters (`coffee`, `ts-node`, etc.), #150.
|
||||
|
||||
|
||||
## [2.0.0] - 2020-08-14
|
||||
### Changed
|
||||
- Full rewrite. Now port from python 3.9.0 & more precise following.
|
||||
See [doc](./doc) for difference and migration info.
|
||||
- node.js 10+ required
|
||||
- Removed most of local docs in favour of original ones.
|
||||
|
||||
|
||||
## [1.0.10] - 2018-02-15
|
||||
### Fixed
|
||||
- Use .concat instead of + for arrays, #122.
|
||||
|
||||
|
||||
## [1.0.9] - 2016-09-29
|
||||
### Changed
|
||||
- Rerelease after 1.0.8 - deps cleanup.
|
||||
|
||||
|
||||
## [1.0.8] - 2016-09-29
|
||||
### Changed
|
||||
- Maintenance (deps bump, fix node 6.5+ tests, coverage report).
|
||||
|
||||
|
||||
## [1.0.7] - 2016-03-17
|
||||
### Changed
|
||||
- Teach `addArgument` to accept string arg names. #97, @tomxtobin.
|
||||
|
||||
|
||||
## [1.0.6] - 2016-02-06
|
||||
### Changed
|
||||
- Maintenance: moved to eslint & updated CS.
|
||||
|
||||
|
||||
## [1.0.5] - 2016-02-05
|
||||
### Changed
|
||||
- Removed lodash dependency to significantly reduce install size.
|
||||
Thanks to @mourner.
|
||||
|
||||
|
||||
## [1.0.4] - 2016-01-17
|
||||
### Changed
|
||||
- Maintenance: lodash update to 4.0.0.
|
||||
|
||||
|
||||
## [1.0.3] - 2015-10-27
|
||||
### Fixed
|
||||
- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple.
|
||||
|
||||
|
||||
## [1.0.2] - 2015-03-22
|
||||
### Changed
|
||||
- Relaxed lodash version dependency.
|
||||
|
||||
|
||||
## [1.0.1] - 2015-02-20
|
||||
### Changed
|
||||
- Changed dependencies to be compatible with ancient nodejs.
|
||||
|
||||
|
||||
## [1.0.0] - 2015-02-19
|
||||
### Changed
|
||||
- Maintenance release.
|
||||
- Replaced `underscore` with `lodash`.
|
||||
- Bumped version to 1.0.0 to better reflect semver meaning.
|
||||
- HISTORY.md -> CHANGELOG.md
|
||||
|
||||
|
||||
## [0.1.16] - 2013-12-01
|
||||
### Changed
|
||||
- Maintenance release. Updated dependencies and docs.
|
||||
|
||||
|
||||
## [0.1.15] - 2013-05-13
|
||||
### Fixed
|
||||
- Fixed #55, @trebor89
|
||||
|
||||
|
||||
## [0.1.14] - 2013-05-12
|
||||
### Fixed
|
||||
- Fixed #62, @maxtaco
|
||||
|
||||
|
||||
## [0.1.13] - 2013-04-08
|
||||
### Changed
|
||||
- Added `.npmignore` to reduce package size
|
||||
|
||||
|
||||
## [0.1.12] - 2013-02-10
|
||||
### Fixed
|
||||
- Fixed conflictHandler (#46), @hpaulj
|
||||
|
||||
|
||||
## [0.1.11] - 2013-02-07
|
||||
### Added
|
||||
- Added 70+ tests (ported from python), @hpaulj
|
||||
- Added conflictHandler, @applepicke
|
||||
- Added fromfilePrefixChar, @hpaulj
|
||||
|
||||
### Fixed
|
||||
- Multiple bugfixes, @hpaulj
|
||||
|
||||
|
||||
## [0.1.10] - 2012-12-30
|
||||
### Added
|
||||
- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion)
|
||||
support, thanks to @hpaulj
|
||||
|
||||
### Fixed
|
||||
- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj
|
||||
|
||||
|
||||
## [0.1.9] - 2012-12-27
|
||||
### Fixed
|
||||
- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj
|
||||
- Fixed default value behavior with `*` positionals, thanks to @hpaulj
|
||||
- Improve `getDefault()` behavior, thanks to @hpaulj
|
||||
- Improve negative argument parsing, thanks to @hpaulj
|
||||
|
||||
|
||||
## [0.1.8] - 2012-12-01
|
||||
### Fixed
|
||||
- Fixed parser parents (issue #19), thanks to @hpaulj
|
||||
- Fixed negative argument parse (issue #20), thanks to @hpaulj
|
||||
|
||||
|
||||
## [0.1.7] - 2012-10-14
|
||||
### Fixed
|
||||
- Fixed 'choices' argument parse (issue #16)
|
||||
- Fixed stderr output (issue #15)
|
||||
|
||||
|
||||
## [0.1.6] - 2012-09-09
|
||||
### Fixed
|
||||
- Fixed check for conflict of options (thanks to @tomxtobin)
|
||||
|
||||
|
||||
## [0.1.5] - 2012-09-03
|
||||
### Fixed
|
||||
- Fix parser #setDefaults method (thanks to @tomxtobin)
|
||||
|
||||
|
||||
## [0.1.4] - 2012-07-30
|
||||
### Fixed
|
||||
- Fixed pseudo-argument support (thanks to @CGamesPlay)
|
||||
- Fixed addHelp default (should be true), if not set (thanks to @benblank)
|
||||
|
||||
|
||||
## [0.1.3] - 2012-06-27
|
||||
### Fixed
|
||||
- Fixed formatter api name: Formatter -> HelpFormatter
|
||||
|
||||
|
||||
## [0.1.2] - 2012-05-29
|
||||
### Fixed
|
||||
- Removed excess whitespace in help
|
||||
- Fixed error reporting, when parcer with subcommands
|
||||
called with empty arguments
|
||||
|
||||
### Added
|
||||
- Added basic tests
|
||||
|
||||
|
||||
## [0.1.1] - 2012-05-23
|
||||
### Fixed
|
||||
- Fixed line wrapping in help formatter
|
||||
- Added better error reporting on invalid arguments
|
||||
|
||||
|
||||
## [0.1.0] - 2012-05-16
|
||||
### Added
|
||||
- First release.
|
||||
|
||||
|
||||
[2.0.1]: https://github.com/nodeca/argparse/compare/2.0.0...2.0.1
|
||||
[2.0.0]: https://github.com/nodeca/argparse/compare/1.0.10...2.0.0
|
||||
[1.0.10]: https://github.com/nodeca/argparse/compare/1.0.9...1.0.10
|
||||
[1.0.9]: https://github.com/nodeca/argparse/compare/1.0.8...1.0.9
|
||||
[1.0.8]: https://github.com/nodeca/argparse/compare/1.0.7...1.0.8
|
||||
[1.0.7]: https://github.com/nodeca/argparse/compare/1.0.6...1.0.7
|
||||
[1.0.6]: https://github.com/nodeca/argparse/compare/1.0.5...1.0.6
|
||||
[1.0.5]: https://github.com/nodeca/argparse/compare/1.0.4...1.0.5
|
||||
[1.0.4]: https://github.com/nodeca/argparse/compare/1.0.3...1.0.4
|
||||
[1.0.3]: https://github.com/nodeca/argparse/compare/1.0.2...1.0.3
|
||||
[1.0.2]: https://github.com/nodeca/argparse/compare/1.0.1...1.0.2
|
||||
[1.0.1]: https://github.com/nodeca/argparse/compare/1.0.0...1.0.1
|
||||
[1.0.0]: https://github.com/nodeca/argparse/compare/0.1.16...1.0.0
|
||||
[0.1.16]: https://github.com/nodeca/argparse/compare/0.1.15...0.1.16
|
||||
[0.1.15]: https://github.com/nodeca/argparse/compare/0.1.14...0.1.15
|
||||
[0.1.14]: https://github.com/nodeca/argparse/compare/0.1.13...0.1.14
|
||||
[0.1.13]: https://github.com/nodeca/argparse/compare/0.1.12...0.1.13
|
||||
[0.1.12]: https://github.com/nodeca/argparse/compare/0.1.11...0.1.12
|
||||
[0.1.11]: https://github.com/nodeca/argparse/compare/0.1.10...0.1.11
|
||||
[0.1.10]: https://github.com/nodeca/argparse/compare/0.1.9...0.1.10
|
||||
[0.1.9]: https://github.com/nodeca/argparse/compare/0.1.8...0.1.9
|
||||
[0.1.8]: https://github.com/nodeca/argparse/compare/0.1.7...0.1.8
|
||||
[0.1.7]: https://github.com/nodeca/argparse/compare/0.1.6...0.1.7
|
||||
[0.1.6]: https://github.com/nodeca/argparse/compare/0.1.5...0.1.6
|
||||
[0.1.5]: https://github.com/nodeca/argparse/compare/0.1.4...0.1.5
|
||||
[0.1.4]: https://github.com/nodeca/argparse/compare/0.1.3...0.1.4
|
||||
[0.1.3]: https://github.com/nodeca/argparse/compare/0.1.2...0.1.3
|
||||
[0.1.2]: https://github.com/nodeca/argparse/compare/0.1.1...0.1.2
|
||||
[0.1.1]: https://github.com/nodeca/argparse/compare/0.1.0...0.1.1
|
||||
[0.1.0]: https://github.com/nodeca/argparse/releases/tag/0.1.0
|
||||
254
node_modules/protobufjs/cli/node_modules/argparse/LICENSE
generated
vendored
Normal file
254
node_modules/protobufjs/cli/node_modules/argparse/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,254 @@
|
||||
A. HISTORY OF THE SOFTWARE
|
||||
==========================
|
||||
|
||||
Python was created in the early 1990s by Guido van Rossum at Stichting
|
||||
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
|
||||
as a successor of a language called ABC. Guido remains Python's
|
||||
principal author, although it includes many contributions from others.
|
||||
|
||||
In 1995, Guido continued his work on Python at the Corporation for
|
||||
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
|
||||
in Reston, Virginia where he released several versions of the
|
||||
software.
|
||||
|
||||
In May 2000, Guido and the Python core development team moved to
|
||||
BeOpen.com to form the BeOpen PythonLabs team. In October of the same
|
||||
year, the PythonLabs team moved to Digital Creations, which became
|
||||
Zope Corporation. In 2001, the Python Software Foundation (PSF, see
|
||||
https://www.python.org/psf/) was formed, a non-profit organization
|
||||
created specifically to own Python-related Intellectual Property.
|
||||
Zope Corporation was a sponsoring member of the PSF.
|
||||
|
||||
All Python releases are Open Source (see http://www.opensource.org for
|
||||
the Open Source Definition). Historically, most, but not all, Python
|
||||
releases have also been GPL-compatible; the table below summarizes
|
||||
the various releases.
|
||||
|
||||
Release Derived Year Owner GPL-
|
||||
from compatible? (1)
|
||||
|
||||
0.9.0 thru 1.2 1991-1995 CWI yes
|
||||
1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
|
||||
1.6 1.5.2 2000 CNRI no
|
||||
2.0 1.6 2000 BeOpen.com no
|
||||
1.6.1 1.6 2001 CNRI yes (2)
|
||||
2.1 2.0+1.6.1 2001 PSF no
|
||||
2.0.1 2.0+1.6.1 2001 PSF yes
|
||||
2.1.1 2.1+2.0.1 2001 PSF yes
|
||||
2.1.2 2.1.1 2002 PSF yes
|
||||
2.1.3 2.1.2 2002 PSF yes
|
||||
2.2 and above 2.1.1 2001-now PSF yes
|
||||
|
||||
Footnotes:
|
||||
|
||||
(1) GPL-compatible doesn't mean that we're distributing Python under
|
||||
the GPL. All Python licenses, unlike the GPL, let you distribute
|
||||
a modified version without making your changes open source. The
|
||||
GPL-compatible licenses make it possible to combine Python with
|
||||
other software that is released under the GPL; the others don't.
|
||||
|
||||
(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
|
||||
because its license has a choice of law clause. According to
|
||||
CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
|
||||
is "not incompatible" with the GPL.
|
||||
|
||||
Thanks to the many outside volunteers who have worked under Guido's
|
||||
direction to make these releases possible.
|
||||
|
||||
|
||||
B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
|
||||
===============================================================
|
||||
|
||||
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
|
||||
--------------------------------------------
|
||||
|
||||
1. This LICENSE AGREEMENT is between the Python Software Foundation
|
||||
("PSF"), and the Individual or Organization ("Licensee") accessing and
|
||||
otherwise using this software ("Python") in source or binary form and
|
||||
its associated documentation.
|
||||
|
||||
2. Subject to the terms and conditions of this License Agreement, PSF hereby
|
||||
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
|
||||
analyze, test, perform and/or display publicly, prepare derivative works,
|
||||
distribute, and otherwise use Python alone or in any derivative version,
|
||||
provided, however, that PSF's License Agreement and PSF's notice of copyright,
|
||||
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation;
|
||||
All Rights Reserved" are retained in Python alone or in any derivative version
|
||||
prepared by Licensee.
|
||||
|
||||
3. In the event Licensee prepares a derivative work that is based on
|
||||
or incorporates Python or any part thereof, and wants to make
|
||||
the derivative work available to others as provided herein, then
|
||||
Licensee hereby agrees to include in any such work a brief summary of
|
||||
the changes made to Python.
|
||||
|
||||
4. PSF is making Python available to Licensee on an "AS IS"
|
||||
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
|
||||
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
|
||||
INFRINGE ANY THIRD PARTY RIGHTS.
|
||||
|
||||
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
|
||||
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
|
||||
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
|
||||
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
|
||||
|
||||
6. This License Agreement will automatically terminate upon a material
|
||||
breach of its terms and conditions.
|
||||
|
||||
7. Nothing in this License Agreement shall be deemed to create any
|
||||
relationship of agency, partnership, or joint venture between PSF and
|
||||
Licensee. This License Agreement does not grant permission to use PSF
|
||||
trademarks or trade name in a trademark sense to endorse or promote
|
||||
products or services of Licensee, or any third party.
|
||||
|
||||
8. By copying, installing or otherwise using Python, Licensee
|
||||
agrees to be bound by the terms and conditions of this License
|
||||
Agreement.
|
||||
|
||||
|
||||
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
|
||||
-------------------------------------------
|
||||
|
||||
BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
|
||||
|
||||
1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
|
||||
office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
|
||||
Individual or Organization ("Licensee") accessing and otherwise using
|
||||
this software in source or binary form and its associated
|
||||
documentation ("the Software").
|
||||
|
||||
2. Subject to the terms and conditions of this BeOpen Python License
|
||||
Agreement, BeOpen hereby grants Licensee a non-exclusive,
|
||||
royalty-free, world-wide license to reproduce, analyze, test, perform
|
||||
and/or display publicly, prepare derivative works, distribute, and
|
||||
otherwise use the Software alone or in any derivative version,
|
||||
provided, however, that the BeOpen Python License is retained in the
|
||||
Software, alone or in any derivative version prepared by Licensee.
|
||||
|
||||
3. BeOpen is making the Software available to Licensee on an "AS IS"
|
||||
basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
|
||||
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
|
||||
INFRINGE ANY THIRD PARTY RIGHTS.
|
||||
|
||||
4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
|
||||
SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
|
||||
AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
|
||||
DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
|
||||
|
||||
5. This License Agreement will automatically terminate upon a material
|
||||
breach of its terms and conditions.
|
||||
|
||||
6. This License Agreement shall be governed by and interpreted in all
|
||||
respects by the law of the State of California, excluding conflict of
|
||||
law provisions. Nothing in this License Agreement shall be deemed to
|
||||
create any relationship of agency, partnership, or joint venture
|
||||
between BeOpen and Licensee. This License Agreement does not grant
|
||||
permission to use BeOpen trademarks or trade names in a trademark
|
||||
sense to endorse or promote products or services of Licensee, or any
|
||||
third party. As an exception, the "BeOpen Python" logos available at
|
||||
http://www.pythonlabs.com/logos.html may be used according to the
|
||||
permissions granted on that web page.
|
||||
|
||||
7. By copying, installing or otherwise using the software, Licensee
|
||||
agrees to be bound by the terms and conditions of this License
|
||||
Agreement.
|
||||
|
||||
|
||||
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
|
||||
---------------------------------------
|
||||
|
||||
1. This LICENSE AGREEMENT is between the Corporation for National
|
||||
Research Initiatives, having an office at 1895 Preston White Drive,
|
||||
Reston, VA 20191 ("CNRI"), and the Individual or Organization
|
||||
("Licensee") accessing and otherwise using Python 1.6.1 software in
|
||||
source or binary form and its associated documentation.
|
||||
|
||||
2. Subject to the terms and conditions of this License Agreement, CNRI
|
||||
hereby grants Licensee a nonexclusive, royalty-free, world-wide
|
||||
license to reproduce, analyze, test, perform and/or display publicly,
|
||||
prepare derivative works, distribute, and otherwise use Python 1.6.1
|
||||
alone or in any derivative version, provided, however, that CNRI's
|
||||
License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
|
||||
1995-2001 Corporation for National Research Initiatives; All Rights
|
||||
Reserved" are retained in Python 1.6.1 alone or in any derivative
|
||||
version prepared by Licensee. Alternately, in lieu of CNRI's License
|
||||
Agreement, Licensee may substitute the following text (omitting the
|
||||
quotes): "Python 1.6.1 is made available subject to the terms and
|
||||
conditions in CNRI's License Agreement. This Agreement together with
|
||||
Python 1.6.1 may be located on the Internet using the following
|
||||
unique, persistent identifier (known as a handle): 1895.22/1013. This
|
||||
Agreement may also be obtained from a proxy server on the Internet
|
||||
using the following URL: http://hdl.handle.net/1895.22/1013".
|
||||
|
||||
3. In the event Licensee prepares a derivative work that is based on
|
||||
or incorporates Python 1.6.1 or any part thereof, and wants to make
|
||||
the derivative work available to others as provided herein, then
|
||||
Licensee hereby agrees to include in any such work a brief summary of
|
||||
the changes made to Python 1.6.1.
|
||||
|
||||
4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
|
||||
basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
|
||||
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
|
||||
INFRINGE ANY THIRD PARTY RIGHTS.
|
||||
|
||||
5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
|
||||
1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
|
||||
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
|
||||
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
|
||||
|
||||
6. This License Agreement will automatically terminate upon a material
|
||||
breach of its terms and conditions.
|
||||
|
||||
7. This License Agreement shall be governed by the federal
|
||||
intellectual property law of the United States, including without
|
||||
limitation the federal copyright law, and, to the extent such
|
||||
U.S. federal law does not apply, by the law of the Commonwealth of
|
||||
Virginia, excluding Virginia's conflict of law provisions.
|
||||
Notwithstanding the foregoing, with regard to derivative works based
|
||||
on Python 1.6.1 that incorporate non-separable material that was
|
||||
previously distributed under the GNU General Public License (GPL), the
|
||||
law of the Commonwealth of Virginia shall govern this License
|
||||
Agreement only as to issues arising under or with respect to
|
||||
Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
|
||||
License Agreement shall be deemed to create any relationship of
|
||||
agency, partnership, or joint venture between CNRI and Licensee. This
|
||||
License Agreement does not grant permission to use CNRI trademarks or
|
||||
trade name in a trademark sense to endorse or promote products or
|
||||
services of Licensee, or any third party.
|
||||
|
||||
8. By clicking on the "ACCEPT" button where indicated, or by copying,
|
||||
installing or otherwise using Python 1.6.1, Licensee agrees to be
|
||||
bound by the terms and conditions of this License Agreement.
|
||||
|
||||
ACCEPT
|
||||
|
||||
|
||||
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
|
||||
--------------------------------------------------
|
||||
|
||||
Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
|
||||
The Netherlands. All rights reserved.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the name of Stichting Mathematisch
|
||||
Centrum or CWI not be used in advertising or publicity pertaining to
|
||||
distribution of the software without specific, written prior
|
||||
permission.
|
||||
|
||||
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
|
||||
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
|
||||
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
||||
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
84
node_modules/protobufjs/cli/node_modules/argparse/README.md
generated
vendored
Normal file
84
node_modules/protobufjs/cli/node_modules/argparse/README.md
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
argparse
|
||||
========
|
||||
|
||||
[](http://travis-ci.org/nodeca/argparse)
|
||||
[](https://www.npmjs.org/package/argparse)
|
||||
|
||||
CLI arguments parser for node.js, with [sub-commands](https://docs.python.org/3.9/library/argparse.html#sub-commands) support. Port of python's [argparse](http://docs.python.org/dev/library/argparse.html) (version [3.9.0](https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py)).
|
||||
|
||||
**Difference with original.**
|
||||
|
||||
- JS has no keyword arguments support.
|
||||
- Pass options instead: `new ArgumentParser({ description: 'example', add_help: true })`.
|
||||
- JS has no python's types `int`, `float`, ...
|
||||
- Use string-typed names: `.add_argument('-b', { type: 'int', help: 'help' })`.
|
||||
- `%r` format specifier uses `require('util').inspect()`.
|
||||
|
||||
More details in [doc](./doc).
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
`test.js` file:
|
||||
|
||||
```javascript
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
const { ArgumentParser } = require('argparse');
|
||||
const { version } = require('./package.json');
|
||||
|
||||
const parser = new ArgumentParser({
|
||||
description: 'Argparse example'
|
||||
});
|
||||
|
||||
parser.add_argument('-v', '--version', { action: 'version', version });
|
||||
parser.add_argument('-f', '--foo', { help: 'foo bar' });
|
||||
parser.add_argument('-b', '--bar', { help: 'bar foo' });
|
||||
parser.add_argument('--baz', { help: 'baz bar' });
|
||||
|
||||
console.dir(parser.parse_args());
|
||||
```
|
||||
|
||||
Display help:
|
||||
|
||||
```
|
||||
$ ./test.js -h
|
||||
usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ]
|
||||
|
||||
Argparse example
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-v, --version show program's version number and exit
|
||||
-f FOO, --foo FOO foo bar
|
||||
-b BAR, --bar BAR bar foo
|
||||
--baz BAZ baz bar
|
||||
```
|
||||
|
||||
Parse arguments:
|
||||
|
||||
```
|
||||
$ ./test.js -f=3 --bar=4 --baz 5
|
||||
{ foo: '3', bar: '4', baz: '5' }
|
||||
```
|
||||
|
||||
|
||||
API docs
|
||||
--------
|
||||
|
||||
Since this is a port with minimal divergence, there's no separate documentation.
|
||||
Use original one instead, with notes about difference.
|
||||
|
||||
1. [Original doc](https://docs.python.org/3.9/library/argparse.html).
|
||||
2. [Original tutorial](https://docs.python.org/3.9/howto/argparse.html).
|
||||
3. [Difference with python](./doc).
|
||||
|
||||
|
||||
argparse for enterprise
|
||||
-----------------------
|
||||
|
||||
Available as part of the Tidelift Subscription
|
||||
|
||||
The maintainers of argparse and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-argparse?utm_source=npm-argparse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
3707
node_modules/protobufjs/cli/node_modules/argparse/argparse.js
generated
vendored
Normal file
3707
node_modules/protobufjs/cli/node_modules/argparse/argparse.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
67
node_modules/protobufjs/cli/node_modules/argparse/lib/sub.js
generated
vendored
Normal file
67
node_modules/protobufjs/cli/node_modules/argparse/lib/sub.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
// Limited implementation of python % string operator, supports only %s and %r for now
|
||||
// (other formats are not used here, but may appear in custom templates)
|
||||
|
||||
'use strict'
|
||||
|
||||
const { inspect } = require('util')
|
||||
|
||||
|
||||
module.exports = function sub(pattern, ...values) {
|
||||
let regex = /%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g
|
||||
|
||||
let result = pattern.replace(regex, function (_, is_literal, is_left_align, is_padded, name, format) {
|
||||
if (is_literal) return '%'
|
||||
|
||||
let padded_count = 0
|
||||
if (is_padded) {
|
||||
if (values.length === 0) throw new TypeError('not enough arguments for format string')
|
||||
padded_count = values.shift()
|
||||
if (!Number.isInteger(padded_count)) throw new TypeError('* wants int')
|
||||
}
|
||||
|
||||
let str
|
||||
if (name !== undefined) {
|
||||
let dict = values[0]
|
||||
if (typeof dict !== 'object' || dict === null) throw new TypeError('format requires a mapping')
|
||||
if (!(name in dict)) throw new TypeError(`no such key: '${name}'`)
|
||||
str = dict[name]
|
||||
} else {
|
||||
if (values.length === 0) throw new TypeError('not enough arguments for format string')
|
||||
str = values.shift()
|
||||
}
|
||||
|
||||
switch (format) {
|
||||
case 's':
|
||||
str = String(str)
|
||||
break
|
||||
case 'r':
|
||||
str = inspect(str)
|
||||
break
|
||||
case 'd':
|
||||
case 'i':
|
||||
if (typeof str !== 'number') {
|
||||
throw new TypeError(`%${format} format: a number is required, not ${typeof str}`)
|
||||
}
|
||||
str = String(str.toFixed(0))
|
||||
break
|
||||
default:
|
||||
throw new TypeError(`unsupported format character '${format}'`)
|
||||
}
|
||||
|
||||
if (padded_count > 0) {
|
||||
return is_left_align ? str.padEnd(padded_count) : str.padStart(padded_count)
|
||||
} else {
|
||||
return str
|
||||
}
|
||||
})
|
||||
|
||||
if (values.length) {
|
||||
if (values.length === 1 && typeof values[0] === 'object' && values[0] !== null) {
|
||||
// mapping
|
||||
} else {
|
||||
throw new TypeError('not all arguments converted during string formatting')
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
440
node_modules/protobufjs/cli/node_modules/argparse/lib/textwrap.js
generated
vendored
Normal file
440
node_modules/protobufjs/cli/node_modules/argparse/lib/textwrap.js
generated
vendored
Normal file
@@ -0,0 +1,440 @@
|
||||
// Partial port of python's argparse module, version 3.9.0 (only wrap and fill functions):
|
||||
// https://github.com/python/cpython/blob/v3.9.0b4/Lib/textwrap.py
|
||||
|
||||
'use strict'
|
||||
|
||||
/*
|
||||
* Text wrapping and filling.
|
||||
*/
|
||||
|
||||
// Copyright (C) 1999-2001 Gregory P. Ward.
|
||||
// Copyright (C) 2002, 2003 Python Software Foundation.
|
||||
// Copyright (C) 2020 argparse.js authors
|
||||
// Originally written by Greg Ward <gward@python.net>
|
||||
|
||||
// Hardcode the recognized whitespace characters to the US-ASCII
|
||||
// whitespace characters. The main reason for doing this is that
|
||||
// some Unicode spaces (like \u00a0) are non-breaking whitespaces.
|
||||
//
|
||||
// This less funky little regex just split on recognized spaces. E.g.
|
||||
// "Hello there -- you goof-ball, use the -b option!"
|
||||
// splits into
|
||||
// Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/
|
||||
const wordsep_simple_re = /([\t\n\x0b\x0c\r ]+)/
|
||||
|
||||
class TextWrapper {
|
||||
/*
|
||||
* Object for wrapping/filling text. The public interface consists of
|
||||
* the wrap() and fill() methods; the other methods are just there for
|
||||
* subclasses to override in order to tweak the default behaviour.
|
||||
* If you want to completely replace the main wrapping algorithm,
|
||||
* you'll probably have to override _wrap_chunks().
|
||||
*
|
||||
* Several instance attributes control various aspects of wrapping:
|
||||
* width (default: 70)
|
||||
* the maximum width of wrapped lines (unless break_long_words
|
||||
* is false)
|
||||
* initial_indent (default: "")
|
||||
* string that will be prepended to the first line of wrapped
|
||||
* output. Counts towards the line's width.
|
||||
* subsequent_indent (default: "")
|
||||
* string that will be prepended to all lines save the first
|
||||
* of wrapped output; also counts towards each line's width.
|
||||
* expand_tabs (default: true)
|
||||
* Expand tabs in input text to spaces before further processing.
|
||||
* Each tab will become 0 .. 'tabsize' spaces, depending on its position
|
||||
* in its line. If false, each tab is treated as a single character.
|
||||
* tabsize (default: 8)
|
||||
* Expand tabs in input text to 0 .. 'tabsize' spaces, unless
|
||||
* 'expand_tabs' is false.
|
||||
* replace_whitespace (default: true)
|
||||
* Replace all whitespace characters in the input text by spaces
|
||||
* after tab expansion. Note that if expand_tabs is false and
|
||||
* replace_whitespace is true, every tab will be converted to a
|
||||
* single space!
|
||||
* fix_sentence_endings (default: false)
|
||||
* Ensure that sentence-ending punctuation is always followed
|
||||
* by two spaces. Off by default because the algorithm is
|
||||
* (unavoidably) imperfect.
|
||||
* break_long_words (default: true)
|
||||
* Break words longer than 'width'. If false, those words will not
|
||||
* be broken, and some lines might be longer than 'width'.
|
||||
* break_on_hyphens (default: true)
|
||||
* Allow breaking hyphenated words. If true, wrapping will occur
|
||||
* preferably on whitespaces and right after hyphens part of
|
||||
* compound words.
|
||||
* drop_whitespace (default: true)
|
||||
* Drop leading and trailing whitespace from lines.
|
||||
* max_lines (default: None)
|
||||
* Truncate wrapped lines.
|
||||
* placeholder (default: ' [...]')
|
||||
* Append to the last line of truncated text.
|
||||
*/
|
||||
|
||||
constructor(options = {}) {
|
||||
let {
|
||||
width = 70,
|
||||
initial_indent = '',
|
||||
subsequent_indent = '',
|
||||
expand_tabs = true,
|
||||
replace_whitespace = true,
|
||||
fix_sentence_endings = false,
|
||||
break_long_words = true,
|
||||
drop_whitespace = true,
|
||||
break_on_hyphens = true,
|
||||
tabsize = 8,
|
||||
max_lines = undefined,
|
||||
placeholder=' [...]'
|
||||
} = options
|
||||
|
||||
this.width = width
|
||||
this.initial_indent = initial_indent
|
||||
this.subsequent_indent = subsequent_indent
|
||||
this.expand_tabs = expand_tabs
|
||||
this.replace_whitespace = replace_whitespace
|
||||
this.fix_sentence_endings = fix_sentence_endings
|
||||
this.break_long_words = break_long_words
|
||||
this.drop_whitespace = drop_whitespace
|
||||
this.break_on_hyphens = break_on_hyphens
|
||||
this.tabsize = tabsize
|
||||
this.max_lines = max_lines
|
||||
this.placeholder = placeholder
|
||||
}
|
||||
|
||||
|
||||
// -- Private methods -----------------------------------------------
|
||||
// (possibly useful for subclasses to override)
|
||||
|
||||
_munge_whitespace(text) {
|
||||
/*
|
||||
* _munge_whitespace(text : string) -> string
|
||||
*
|
||||
* Munge whitespace in text: expand tabs and convert all other
|
||||
* whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz"
|
||||
* becomes " foo bar baz".
|
||||
*/
|
||||
if (this.expand_tabs) {
|
||||
text = text.replace(/\t/g, ' '.repeat(this.tabsize)) // not strictly correct in js
|
||||
}
|
||||
if (this.replace_whitespace) {
|
||||
text = text.replace(/[\t\n\x0b\x0c\r]/g, ' ')
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
_split(text) {
|
||||
/*
|
||||
* _split(text : string) -> [string]
|
||||
*
|
||||
* Split the text to wrap into indivisible chunks. Chunks are
|
||||
* not quite the same as words; see _wrap_chunks() for full
|
||||
* details. As an example, the text
|
||||
* Look, goof-ball -- use the -b option!
|
||||
* breaks into the following chunks:
|
||||
* 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',
|
||||
* 'use', ' ', 'the', ' ', '-b', ' ', 'option!'
|
||||
* if break_on_hyphens is True, or in:
|
||||
* 'Look,', ' ', 'goof-ball', ' ', '--', ' ',
|
||||
* 'use', ' ', 'the', ' ', '-b', ' ', option!'
|
||||
* otherwise.
|
||||
*/
|
||||
let chunks = text.split(wordsep_simple_re)
|
||||
chunks = chunks.filter(Boolean)
|
||||
return chunks
|
||||
}
|
||||
|
||||
_handle_long_word(reversed_chunks, cur_line, cur_len, width) {
|
||||
/*
|
||||
* _handle_long_word(chunks : [string],
|
||||
* cur_line : [string],
|
||||
* cur_len : int, width : int)
|
||||
*
|
||||
* Handle a chunk of text (most likely a word, not whitespace) that
|
||||
* is too long to fit in any line.
|
||||
*/
|
||||
// Figure out when indent is larger than the specified width, and make
|
||||
// sure at least one character is stripped off on every pass
|
||||
let space_left
|
||||
if (width < 1) {
|
||||
space_left = 1
|
||||
} else {
|
||||
space_left = width - cur_len
|
||||
}
|
||||
|
||||
// If we're allowed to break long words, then do so: put as much
|
||||
// of the next chunk onto the current line as will fit.
|
||||
if (this.break_long_words) {
|
||||
cur_line.push(reversed_chunks[reversed_chunks.length - 1].slice(0, space_left))
|
||||
reversed_chunks[reversed_chunks.length - 1] = reversed_chunks[reversed_chunks.length - 1].slice(space_left)
|
||||
|
||||
// Otherwise, we have to preserve the long word intact. Only add
|
||||
// it to the current line if there's nothing already there --
|
||||
// that minimizes how much we violate the width constraint.
|
||||
} else if (!cur_line) {
|
||||
cur_line.push(...reversed_chunks.pop())
|
||||
}
|
||||
|
||||
// If we're not allowed to break long words, and there's already
|
||||
// text on the current line, do nothing. Next time through the
|
||||
// main loop of _wrap_chunks(), we'll wind up here again, but
|
||||
// cur_len will be zero, so the next line will be entirely
|
||||
// devoted to the long word that we can't handle right now.
|
||||
}
|
||||
|
||||
_wrap_chunks(chunks) {
|
||||
/*
|
||||
* _wrap_chunks(chunks : [string]) -> [string]
|
||||
*
|
||||
* Wrap a sequence of text chunks and return a list of lines of
|
||||
* length 'self.width' or less. (If 'break_long_words' is false,
|
||||
* some lines may be longer than this.) Chunks correspond roughly
|
||||
* to words and the whitespace between them: each chunk is
|
||||
* indivisible (modulo 'break_long_words'), but a line break can
|
||||
* come between any two chunks. Chunks should not have internal
|
||||
* whitespace; ie. a chunk is either all whitespace or a "word".
|
||||
* Whitespace chunks will be removed from the beginning and end of
|
||||
* lines, but apart from that whitespace is preserved.
|
||||
*/
|
||||
let lines = []
|
||||
let indent
|
||||
if (this.width <= 0) {
|
||||
throw Error(`invalid width ${this.width} (must be > 0)`)
|
||||
}
|
||||
if (this.max_lines !== undefined) {
|
||||
if (this.max_lines > 1) {
|
||||
indent = this.subsequent_indent
|
||||
} else {
|
||||
indent = this.initial_indent
|
||||
}
|
||||
if (indent.length + this.placeholder.trimStart().length > this.width) {
|
||||
throw Error('placeholder too large for max width')
|
||||
}
|
||||
}
|
||||
|
||||
// Arrange in reverse order so items can be efficiently popped
|
||||
// from a stack of chucks.
|
||||
chunks = chunks.reverse()
|
||||
|
||||
while (chunks.length > 0) {
|
||||
|
||||
// Start the list of chunks that will make up the current line.
|
||||
// cur_len is just the length of all the chunks in cur_line.
|
||||
let cur_line = []
|
||||
let cur_len = 0
|
||||
|
||||
// Figure out which static string will prefix this line.
|
||||
let indent
|
||||
if (lines) {
|
||||
indent = this.subsequent_indent
|
||||
} else {
|
||||
indent = this.initial_indent
|
||||
}
|
||||
|
||||
// Maximum width for this line.
|
||||
let width = this.width - indent.length
|
||||
|
||||
// First chunk on line is whitespace -- drop it, unless this
|
||||
// is the very beginning of the text (ie. no lines started yet).
|
||||
if (this.drop_whitespace && chunks[chunks.length - 1].trim() === '' && lines.length > 0) {
|
||||
chunks.pop()
|
||||
}
|
||||
|
||||
while (chunks.length > 0) {
|
||||
let l = chunks[chunks.length - 1].length
|
||||
|
||||
// Can at least squeeze this chunk onto the current line.
|
||||
if (cur_len + l <= width) {
|
||||
cur_line.push(chunks.pop())
|
||||
cur_len += l
|
||||
|
||||
// Nope, this line is full.
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// The current line is full, and the next chunk is too big to
|
||||
// fit on *any* line (not just this one).
|
||||
if (chunks.length && chunks[chunks.length - 1].length > width) {
|
||||
this._handle_long_word(chunks, cur_line, cur_len, width)
|
||||
cur_len = cur_line.map(l => l.length).reduce((a, b) => a + b, 0)
|
||||
}
|
||||
|
||||
// If the last chunk on this line is all whitespace, drop it.
|
||||
if (this.drop_whitespace && cur_line.length > 0 && cur_line[cur_line.length - 1].trim() === '') {
|
||||
cur_len -= cur_line[cur_line.length - 1].length
|
||||
cur_line.pop()
|
||||
}
|
||||
|
||||
if (cur_line) {
|
||||
if (this.max_lines === undefined ||
|
||||
lines.length + 1 < this.max_lines ||
|
||||
(chunks.length === 0 ||
|
||||
this.drop_whitespace &&
|
||||
chunks.length === 1 &&
|
||||
!chunks[0].trim()) && cur_len <= width) {
|
||||
// Convert current line back to a string and store it in
|
||||
// list of all lines (return value).
|
||||
lines.push(indent + cur_line.join(''))
|
||||
} else {
|
||||
let had_break = false
|
||||
while (cur_line) {
|
||||
if (cur_line[cur_line.length - 1].trim() &&
|
||||
cur_len + this.placeholder.length <= width) {
|
||||
cur_line.push(this.placeholder)
|
||||
lines.push(indent + cur_line.join(''))
|
||||
had_break = true
|
||||
break
|
||||
}
|
||||
cur_len -= cur_line[-1].length
|
||||
cur_line.pop()
|
||||
}
|
||||
if (!had_break) {
|
||||
if (lines) {
|
||||
let prev_line = lines[lines.length - 1].trimEnd()
|
||||
if (prev_line.length + this.placeholder.length <=
|
||||
this.width) {
|
||||
lines[lines.length - 1] = prev_line + this.placeholder
|
||||
break
|
||||
}
|
||||
}
|
||||
lines.push(indent + this.placeholder.lstrip())
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
_split_chunks(text) {
|
||||
text = this._munge_whitespace(text)
|
||||
return this._split(text)
|
||||
}
|
||||
|
||||
// -- Public interface ----------------------------------------------
|
||||
|
||||
wrap(text) {
|
||||
/*
|
||||
* wrap(text : string) -> [string]
|
||||
*
|
||||
* Reformat the single paragraph in 'text' so it fits in lines of
|
||||
* no more than 'self.width' columns, and return a list of wrapped
|
||||
* lines. Tabs in 'text' are expanded with string.expandtabs(),
|
||||
* and all other whitespace characters (including newline) are
|
||||
* converted to space.
|
||||
*/
|
||||
let chunks = this._split_chunks(text)
|
||||
// not implemented in js
|
||||
//if (this.fix_sentence_endings) {
|
||||
// this._fix_sentence_endings(chunks)
|
||||
//}
|
||||
return this._wrap_chunks(chunks)
|
||||
}
|
||||
|
||||
fill(text) {
|
||||
/*
|
||||
* fill(text : string) -> string
|
||||
*
|
||||
* Reformat the single paragraph in 'text' to fit in lines of no
|
||||
* more than 'self.width' columns, and return a new string
|
||||
* containing the entire wrapped paragraph.
|
||||
*/
|
||||
return this.wrap(text).join('\n')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Convenience interface ---------------------------------------------
|
||||
|
||||
function wrap(text, options = {}) {
|
||||
/*
|
||||
* Wrap a single paragraph of text, returning a list of wrapped lines.
|
||||
*
|
||||
* Reformat the single paragraph in 'text' so it fits in lines of no
|
||||
* more than 'width' columns, and return a list of wrapped lines. By
|
||||
* default, tabs in 'text' are expanded with string.expandtabs(), and
|
||||
* all other whitespace characters (including newline) are converted to
|
||||
* space. See TextWrapper class for available keyword args to customize
|
||||
* wrapping behaviour.
|
||||
*/
|
||||
let { width = 70, ...kwargs } = options
|
||||
let w = new TextWrapper(Object.assign({ width }, kwargs))
|
||||
return w.wrap(text)
|
||||
}
|
||||
|
||||
function fill(text, options = {}) {
|
||||
/*
|
||||
* Fill a single paragraph of text, returning a new string.
|
||||
*
|
||||
* Reformat the single paragraph in 'text' to fit in lines of no more
|
||||
* than 'width' columns, and return a new string containing the entire
|
||||
* wrapped paragraph. As with wrap(), tabs are expanded and other
|
||||
* whitespace characters converted to space. See TextWrapper class for
|
||||
* available keyword args to customize wrapping behaviour.
|
||||
*/
|
||||
let { width = 70, ...kwargs } = options
|
||||
let w = new TextWrapper(Object.assign({ width }, kwargs))
|
||||
return w.fill(text)
|
||||
}
|
||||
|
||||
// -- Loosely related functionality -------------------------------------
|
||||
|
||||
let _whitespace_only_re = /^[ \t]+$/mg
|
||||
let _leading_whitespace_re = /(^[ \t]*)(?:[^ \t\n])/mg
|
||||
|
||||
function dedent(text) {
|
||||
/*
|
||||
* Remove any common leading whitespace from every line in `text`.
|
||||
*
|
||||
* This can be used to make triple-quoted strings line up with the left
|
||||
* edge of the display, while still presenting them in the source code
|
||||
* in indented form.
|
||||
*
|
||||
* Note that tabs and spaces are both treated as whitespace, but they
|
||||
* are not equal: the lines " hello" and "\\thello" are
|
||||
* considered to have no common leading whitespace.
|
||||
*
|
||||
* Entirely blank lines are normalized to a newline character.
|
||||
*/
|
||||
// Look for the longest leading string of spaces and tabs common to
|
||||
// all lines.
|
||||
let margin = undefined
|
||||
text = text.replace(_whitespace_only_re, '')
|
||||
let indents = text.match(_leading_whitespace_re) || []
|
||||
for (let indent of indents) {
|
||||
indent = indent.slice(0, -1)
|
||||
|
||||
if (margin === undefined) {
|
||||
margin = indent
|
||||
|
||||
// Current line more deeply indented than previous winner:
|
||||
// no change (previous winner is still on top).
|
||||
} else if (indent.startsWith(margin)) {
|
||||
// pass
|
||||
|
||||
// Current line consistent with and no deeper than previous winner:
|
||||
// it's the new winner.
|
||||
} else if (margin.startsWith(indent)) {
|
||||
margin = indent
|
||||
|
||||
// Find the largest common whitespace between current line and previous
|
||||
// winner.
|
||||
} else {
|
||||
for (let i = 0; i < margin.length && i < indent.length; i++) {
|
||||
if (margin[i] !== indent[i]) {
|
||||
margin = margin.slice(0, i)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (margin) {
|
||||
text = text.replace(new RegExp('^' + margin, 'mg'), '')
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
module.exports = { wrap, fill, dedent }
|
||||
31
node_modules/protobufjs/cli/node_modules/argparse/package.json
generated
vendored
Normal file
31
node_modules/protobufjs/cli/node_modules/argparse/package.json
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "argparse",
|
||||
"description": "CLI arguments parser. Native port of python's argparse.",
|
||||
"version": "2.0.1",
|
||||
"keywords": [
|
||||
"cli",
|
||||
"parser",
|
||||
"argparse",
|
||||
"option",
|
||||
"args"
|
||||
],
|
||||
"main": "argparse.js",
|
||||
"files": [
|
||||
"argparse.js",
|
||||
"lib/"
|
||||
],
|
||||
"license": "Python-2.0",
|
||||
"repository": "nodeca/argparse",
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"test": "npm run lint && nyc mocha",
|
||||
"coverage": "npm run test && nyc report --reporter html"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "^7.11.0",
|
||||
"@babel/plugin-syntax-class-properties": "^7.10.4",
|
||||
"eslint": "^7.5.0",
|
||||
"mocha": "^8.0.1",
|
||||
"nyc": "^15.1.0"
|
||||
}
|
||||
}
|
||||
2
node_modules/protobufjs/cli/node_modules/balanced-match/.github/FUNDING.yml
generated
vendored
Normal file
2
node_modules/protobufjs/cli/node_modules/balanced-match/.github/FUNDING.yml
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
tidelift: "npm/balanced-match"
|
||||
patreon: juliangruber
|
||||
21
node_modules/protobufjs/cli/node_modules/balanced-match/LICENSE.md
generated
vendored
Normal file
21
node_modules/protobufjs/cli/node_modules/balanced-match/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
97
node_modules/protobufjs/cli/node_modules/balanced-match/README.md
generated
vendored
Normal file
97
node_modules/protobufjs/cli/node_modules/balanced-match/README.md
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
# balanced-match
|
||||
|
||||
Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well!
|
||||
|
||||
[](http://travis-ci.org/juliangruber/balanced-match)
|
||||
[](https://www.npmjs.org/package/balanced-match)
|
||||
|
||||
[](https://ci.testling.com/juliangruber/balanced-match)
|
||||
|
||||
## Example
|
||||
|
||||
Get the first matching pair of braces:
|
||||
|
||||
```js
|
||||
var balanced = require('balanced-match');
|
||||
|
||||
console.log(balanced('{', '}', 'pre{in{nested}}post'));
|
||||
console.log(balanced('{', '}', 'pre{first}between{second}post'));
|
||||
console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'));
|
||||
```
|
||||
|
||||
The matches are:
|
||||
|
||||
```bash
|
||||
$ node example.js
|
||||
{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
|
||||
{ start: 3,
|
||||
end: 9,
|
||||
pre: 'pre',
|
||||
body: 'first',
|
||||
post: 'between{second}post' }
|
||||
{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### var m = balanced(a, b, str)
|
||||
|
||||
For the first non-nested matching pair of `a` and `b` in `str`, return an
|
||||
object with those keys:
|
||||
|
||||
* **start** the index of the first match of `a`
|
||||
* **end** the index of the matching `b`
|
||||
* **pre** the preamble, `a` and `b` not included
|
||||
* **body** the match, `a` and `b` not included
|
||||
* **post** the postscript, `a` and `b` not included
|
||||
|
||||
If there's no match, `undefined` will be returned.
|
||||
|
||||
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
|
||||
|
||||
### var r = balanced.range(a, b, str)
|
||||
|
||||
For the first non-nested matching pair of `a` and `b` in `str`, return an
|
||||
array with indexes: `[ <a index>, <b index> ]`.
|
||||
|
||||
If there's no match, `undefined` will be returned.
|
||||
|
||||
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
```bash
|
||||
npm install balanced-match
|
||||
```
|
||||
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the
|
||||
[Tidelift security contact](https://tidelift.com/security).
|
||||
Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
## License
|
||||
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
62
node_modules/protobufjs/cli/node_modules/balanced-match/index.js
generated
vendored
Normal file
62
node_modules/protobufjs/cli/node_modules/balanced-match/index.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
'use strict';
|
||||
module.exports = balanced;
|
||||
function balanced(a, b, str) {
|
||||
if (a instanceof RegExp) a = maybeMatch(a, str);
|
||||
if (b instanceof RegExp) b = maybeMatch(b, str);
|
||||
|
||||
var r = range(a, b, str);
|
||||
|
||||
return r && {
|
||||
start: r[0],
|
||||
end: r[1],
|
||||
pre: str.slice(0, r[0]),
|
||||
body: str.slice(r[0] + a.length, r[1]),
|
||||
post: str.slice(r[1] + b.length)
|
||||
};
|
||||
}
|
||||
|
||||
function maybeMatch(reg, str) {
|
||||
var m = str.match(reg);
|
||||
return m ? m[0] : null;
|
||||
}
|
||||
|
||||
balanced.range = range;
|
||||
function range(a, b, str) {
|
||||
var begs, beg, left, right, result;
|
||||
var ai = str.indexOf(a);
|
||||
var bi = str.indexOf(b, ai + 1);
|
||||
var i = ai;
|
||||
|
||||
if (ai >= 0 && bi > 0) {
|
||||
if(a===b) {
|
||||
return [ai, bi];
|
||||
}
|
||||
begs = [];
|
||||
left = str.length;
|
||||
|
||||
while (i >= 0 && !result) {
|
||||
if (i == ai) {
|
||||
begs.push(i);
|
||||
ai = str.indexOf(a, i + 1);
|
||||
} else if (begs.length == 1) {
|
||||
result = [ begs.pop(), bi ];
|
||||
} else {
|
||||
beg = begs.pop();
|
||||
if (beg < left) {
|
||||
left = beg;
|
||||
right = bi;
|
||||
}
|
||||
|
||||
bi = str.indexOf(b, i + 1);
|
||||
}
|
||||
|
||||
i = ai < bi && ai >= 0 ? ai : bi;
|
||||
}
|
||||
|
||||
if (begs.length) {
|
||||
result = [ left, right ];
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
48
node_modules/protobufjs/cli/node_modules/balanced-match/package.json
generated
vendored
Normal file
48
node_modules/protobufjs/cli/node_modules/balanced-match/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "balanced-match",
|
||||
"description": "Match balanced character pairs, like \"{\" and \"}\"",
|
||||
"version": "1.0.2",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/juliangruber/balanced-match.git"
|
||||
},
|
||||
"homepage": "https://github.com/juliangruber/balanced-match",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "tape test/test.js",
|
||||
"bench": "matcha test/bench.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"matcha": "^0.7.0",
|
||||
"tape": "^4.6.0"
|
||||
},
|
||||
"keywords": [
|
||||
"match",
|
||||
"regexp",
|
||||
"test",
|
||||
"balanced",
|
||||
"parse"
|
||||
],
|
||||
"author": {
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
"url": "http://juliangruber.com"
|
||||
},
|
||||
"license": "MIT",
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"firefox/20..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/25..latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
}
|
||||
}
|
||||
21
node_modules/protobufjs/cli/node_modules/bluebird/LICENSE
generated
vendored
Normal file
21
node_modules/protobufjs/cli/node_modules/bluebird/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-2018 Petka Antonov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
57
node_modules/protobufjs/cli/node_modules/bluebird/README.md
generated
vendored
Normal file
57
node_modules/protobufjs/cli/node_modules/bluebird/README.md
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
<a href="http://promisesaplus.com/">
|
||||
<img src="http://promisesaplus.com/assets/logo-small.png" alt="Promises/A+ logo"
|
||||
title="Promises/A+ 1.1 compliant" align="right" />
|
||||
</a>
|
||||
|
||||
|
||||
[](https://travis-ci.org/petkaantonov/bluebird)
|
||||
[](http://petkaantonov.github.io/bluebird/coverage/debug/index.html)
|
||||
|
||||
**Got a question?** Join us on [stackoverflow](http://stackoverflow.com/questions/tagged/bluebird), the [mailing list](https://groups.google.com/forum/#!forum/bluebird-js) or chat on [IRC](https://webchat.freenode.net/?channels=#promises)
|
||||
|
||||
# Introduction
|
||||
|
||||
Bluebird is a fully featured promise library with focus on innovative features and performance
|
||||
|
||||
See the [**bluebird website**](http://bluebirdjs.com/docs/getting-started.html) for further documentation, references and instructions. See the [**API reference**](http://bluebirdjs.com/docs/api-reference.html) here.
|
||||
|
||||
For bluebird 2.x documentation and files, see the [2.x tree](https://github.com/petkaantonov/bluebird/tree/2.x).
|
||||
|
||||
### Note
|
||||
|
||||
Promises in Node.js 10 are significantly faster than before. Bluebird still includes a lot of features like cancellation, iteration methods and warnings that native promises don't. If you are using Bluebird for performance rather than for those - please consider giving native promises a shot and running the benchmarks yourself.
|
||||
|
||||
# Questions and issues
|
||||
|
||||
The [github issue tracker](https://github.com/petkaantonov/bluebird/issues) is **_only_** for bug reports and feature requests. Anything else, such as questions for help in using the library, should be posted in [StackOverflow](http://stackoverflow.com/questions/tagged/bluebird) under tags `promise` and `bluebird`.
|
||||
|
||||
|
||||
|
||||
## Thanks
|
||||
|
||||
Thanks to BrowserStack for providing us with a free account which lets us support old browsers like IE8.
|
||||
|
||||
# License
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-2019 Petka Antonov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
1
node_modules/protobufjs/cli/node_modules/bluebird/changelog.md
generated
vendored
Normal file
1
node_modules/protobufjs/cli/node_modules/bluebird/changelog.md
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[http://bluebirdjs.com/docs/changelog.html](http://bluebirdjs.com/docs/changelog.html)
|
||||
3914
node_modules/protobufjs/cli/node_modules/bluebird/js/browser/bluebird.core.js
generated
vendored
Normal file
3914
node_modules/protobufjs/cli/node_modules/bluebird/js/browser/bluebird.core.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
31
node_modules/protobufjs/cli/node_modules/bluebird/js/browser/bluebird.core.min.js
generated
vendored
Normal file
31
node_modules/protobufjs/cli/node_modules/bluebird/js/browser/bluebird.core.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5778
node_modules/protobufjs/cli/node_modules/bluebird/js/browser/bluebird.js
generated
vendored
Normal file
5778
node_modules/protobufjs/cli/node_modules/bluebird/js/browser/bluebird.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
31
node_modules/protobufjs/cli/node_modules/bluebird/js/browser/bluebird.min.js
generated
vendored
Normal file
31
node_modules/protobufjs/cli/node_modules/bluebird/js/browser/bluebird.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
21
node_modules/protobufjs/cli/node_modules/bluebird/js/release/any.js
generated
vendored
Normal file
21
node_modules/protobufjs/cli/node_modules/bluebird/js/release/any.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
module.exports = function(Promise) {
|
||||
var SomePromiseArray = Promise._SomePromiseArray;
|
||||
function any(promises) {
|
||||
var ret = new SomePromiseArray(promises);
|
||||
var promise = ret.promise();
|
||||
ret.setHowMany(1);
|
||||
ret.setUnwrap();
|
||||
ret.init();
|
||||
return promise;
|
||||
}
|
||||
|
||||
Promise.any = function (promises) {
|
||||
return any(promises);
|
||||
};
|
||||
|
||||
Promise.prototype.any = function () {
|
||||
return any(this);
|
||||
};
|
||||
|
||||
};
|
||||
55
node_modules/protobufjs/cli/node_modules/bluebird/js/release/assert.js
generated
vendored
Normal file
55
node_modules/protobufjs/cli/node_modules/bluebird/js/release/assert.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
module.exports = (function(){
|
||||
var AssertionError = (function() {
|
||||
function AssertionError(a) {
|
||||
this.constructor$(a);
|
||||
this.message = a;
|
||||
this.name = "AssertionError";
|
||||
}
|
||||
AssertionError.prototype = new Error();
|
||||
AssertionError.prototype.constructor = AssertionError;
|
||||
AssertionError.prototype.constructor$ = Error;
|
||||
return AssertionError;
|
||||
})();
|
||||
|
||||
function getParams(args) {
|
||||
var params = [];
|
||||
for (var i = 0; i < args.length; ++i) params.push("arg" + i);
|
||||
return params;
|
||||
}
|
||||
|
||||
function nativeAssert(callName, args, expect) {
|
||||
try {
|
||||
var params = getParams(args);
|
||||
var constructorArgs = params;
|
||||
constructorArgs.push("return " +
|
||||
callName + "("+ params.join(",") + ");");
|
||||
var fn = Function.apply(null, constructorArgs);
|
||||
return fn.apply(null, args);
|
||||
} catch (e) {
|
||||
if (!(e instanceof SyntaxError)) {
|
||||
throw e;
|
||||
} else {
|
||||
return expect;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return function assert(boolExpr, message) {
|
||||
if (boolExpr === true) return;
|
||||
|
||||
if (typeof boolExpr === "string" &&
|
||||
boolExpr.charAt(0) === "%") {
|
||||
var nativeCallName = boolExpr;
|
||||
var $_len = arguments.length;var args = new Array(Math.max($_len - 2, 0)); for(var $_i = 2; $_i < $_len; ++$_i) {args[$_i - 2] = arguments[$_i];};
|
||||
if (nativeAssert(nativeCallName, args, message) === message) return;
|
||||
message = (nativeCallName + " !== " + message);
|
||||
}
|
||||
|
||||
var ret = new AssertionError(message);
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(ret, assert);
|
||||
}
|
||||
throw ret;
|
||||
};
|
||||
})();
|
||||
120
node_modules/protobufjs/cli/node_modules/bluebird/js/release/async.js
generated
vendored
Normal file
120
node_modules/protobufjs/cli/node_modules/bluebird/js/release/async.js
generated
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
"use strict";
|
||||
var firstLineError;
|
||||
try {throw new Error(); } catch (e) {firstLineError = e;}
|
||||
var schedule = require("./schedule");
|
||||
var Queue = require("./queue");
|
||||
|
||||
function Async() {
|
||||
this._customScheduler = false;
|
||||
this._isTickUsed = false;
|
||||
this._lateQueue = new Queue(16);
|
||||
this._normalQueue = new Queue(16);
|
||||
this._haveDrainedQueues = false;
|
||||
var self = this;
|
||||
this.drainQueues = function () {
|
||||
self._drainQueues();
|
||||
};
|
||||
this._schedule = schedule;
|
||||
}
|
||||
|
||||
Async.prototype.setScheduler = function(fn) {
|
||||
var prev = this._schedule;
|
||||
this._schedule = fn;
|
||||
this._customScheduler = true;
|
||||
return prev;
|
||||
};
|
||||
|
||||
Async.prototype.hasCustomScheduler = function() {
|
||||
return this._customScheduler;
|
||||
};
|
||||
|
||||
Async.prototype.haveItemsQueued = function () {
|
||||
return this._isTickUsed || this._haveDrainedQueues;
|
||||
};
|
||||
|
||||
|
||||
Async.prototype.fatalError = function(e, isNode) {
|
||||
if (isNode) {
|
||||
process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) +
|
||||
"\n");
|
||||
process.exit(2);
|
||||
} else {
|
||||
this.throwLater(e);
|
||||
}
|
||||
};
|
||||
|
||||
Async.prototype.throwLater = function(fn, arg) {
|
||||
if (arguments.length === 1) {
|
||||
arg = fn;
|
||||
fn = function () { throw arg; };
|
||||
}
|
||||
if (typeof setTimeout !== "undefined") {
|
||||
setTimeout(function() {
|
||||
fn(arg);
|
||||
}, 0);
|
||||
} else try {
|
||||
this._schedule(function() {
|
||||
fn(arg);
|
||||
});
|
||||
} catch (e) {
|
||||
throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a");
|
||||
}
|
||||
};
|
||||
|
||||
function AsyncInvokeLater(fn, receiver, arg) {
|
||||
this._lateQueue.push(fn, receiver, arg);
|
||||
this._queueTick();
|
||||
}
|
||||
|
||||
function AsyncInvoke(fn, receiver, arg) {
|
||||
this._normalQueue.push(fn, receiver, arg);
|
||||
this._queueTick();
|
||||
}
|
||||
|
||||
function AsyncSettlePromises(promise) {
|
||||
this._normalQueue._pushOne(promise);
|
||||
this._queueTick();
|
||||
}
|
||||
|
||||
Async.prototype.invokeLater = AsyncInvokeLater;
|
||||
Async.prototype.invoke = AsyncInvoke;
|
||||
Async.prototype.settlePromises = AsyncSettlePromises;
|
||||
|
||||
|
||||
function _drainQueue(queue) {
|
||||
while (queue.length() > 0) {
|
||||
_drainQueueStep(queue);
|
||||
}
|
||||
}
|
||||
|
||||
function _drainQueueStep(queue) {
|
||||
var fn = queue.shift();
|
||||
if (typeof fn !== "function") {
|
||||
fn._settlePromises();
|
||||
} else {
|
||||
var receiver = queue.shift();
|
||||
var arg = queue.shift();
|
||||
fn.call(receiver, arg);
|
||||
}
|
||||
}
|
||||
|
||||
Async.prototype._drainQueues = function () {
|
||||
_drainQueue(this._normalQueue);
|
||||
this._reset();
|
||||
this._haveDrainedQueues = true;
|
||||
_drainQueue(this._lateQueue);
|
||||
};
|
||||
|
||||
Async.prototype._queueTick = function () {
|
||||
if (!this._isTickUsed) {
|
||||
this._isTickUsed = true;
|
||||
this._schedule(this.drainQueues);
|
||||
}
|
||||
};
|
||||
|
||||
Async.prototype._reset = function () {
|
||||
this._isTickUsed = false;
|
||||
};
|
||||
|
||||
module.exports = Async;
|
||||
module.exports.firstLineError = firstLineError;
|
||||
67
node_modules/protobufjs/cli/node_modules/bluebird/js/release/bind.js
generated
vendored
Normal file
67
node_modules/protobufjs/cli/node_modules/bluebird/js/release/bind.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) {
|
||||
var calledBind = false;
|
||||
var rejectThis = function(_, e) {
|
||||
this._reject(e);
|
||||
};
|
||||
|
||||
var targetRejected = function(e, context) {
|
||||
context.promiseRejectionQueued = true;
|
||||
context.bindingPromise._then(rejectThis, rejectThis, null, this, e);
|
||||
};
|
||||
|
||||
var bindingResolved = function(thisArg, context) {
|
||||
if (((this._bitField & 50397184) === 0)) {
|
||||
this._resolveCallback(context.target);
|
||||
}
|
||||
};
|
||||
|
||||
var bindingRejected = function(e, context) {
|
||||
if (!context.promiseRejectionQueued) this._reject(e);
|
||||
};
|
||||
|
||||
Promise.prototype.bind = function (thisArg) {
|
||||
if (!calledBind) {
|
||||
calledBind = true;
|
||||
Promise.prototype._propagateFrom = debug.propagateFromFunction();
|
||||
Promise.prototype._boundValue = debug.boundValueFunction();
|
||||
}
|
||||
var maybePromise = tryConvertToPromise(thisArg);
|
||||
var ret = new Promise(INTERNAL);
|
||||
ret._propagateFrom(this, 1);
|
||||
var target = this._target();
|
||||
ret._setBoundTo(maybePromise);
|
||||
if (maybePromise instanceof Promise) {
|
||||
var context = {
|
||||
promiseRejectionQueued: false,
|
||||
promise: ret,
|
||||
target: target,
|
||||
bindingPromise: maybePromise
|
||||
};
|
||||
target._then(INTERNAL, targetRejected, undefined, ret, context);
|
||||
maybePromise._then(
|
||||
bindingResolved, bindingRejected, undefined, ret, context);
|
||||
ret._setOnCancel(maybePromise);
|
||||
} else {
|
||||
ret._resolveCallback(target);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
Promise.prototype._setBoundTo = function (obj) {
|
||||
if (obj !== undefined) {
|
||||
this._bitField = this._bitField | 2097152;
|
||||
this._boundTo = obj;
|
||||
} else {
|
||||
this._bitField = this._bitField & (~2097152);
|
||||
}
|
||||
};
|
||||
|
||||
Promise.prototype._isBound = function () {
|
||||
return (this._bitField & 2097152) === 2097152;
|
||||
};
|
||||
|
||||
Promise.bind = function (thisArg, value) {
|
||||
return Promise.resolve(value).bind(thisArg);
|
||||
};
|
||||
};
|
||||
11
node_modules/protobufjs/cli/node_modules/bluebird/js/release/bluebird.js
generated
vendored
Normal file
11
node_modules/protobufjs/cli/node_modules/bluebird/js/release/bluebird.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
var old;
|
||||
if (typeof Promise !== "undefined") old = Promise;
|
||||
function noConflict() {
|
||||
try { if (Promise === bluebird) Promise = old; }
|
||||
catch (e) {}
|
||||
return bluebird;
|
||||
}
|
||||
var bluebird = require("./promise")();
|
||||
bluebird.noConflict = noConflict;
|
||||
module.exports = bluebird;
|
||||
123
node_modules/protobufjs/cli/node_modules/bluebird/js/release/call_get.js
generated
vendored
Normal file
123
node_modules/protobufjs/cli/node_modules/bluebird/js/release/call_get.js
generated
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
"use strict";
|
||||
var cr = Object.create;
|
||||
if (cr) {
|
||||
var callerCache = cr(null);
|
||||
var getterCache = cr(null);
|
||||
callerCache[" size"] = getterCache[" size"] = 0;
|
||||
}
|
||||
|
||||
module.exports = function(Promise) {
|
||||
var util = require("./util");
|
||||
var canEvaluate = util.canEvaluate;
|
||||
var isIdentifier = util.isIdentifier;
|
||||
|
||||
var getMethodCaller;
|
||||
var getGetter;
|
||||
if (!false) {
|
||||
var makeMethodCaller = function (methodName) {
|
||||
return new Function("ensureMethod", " \n\
|
||||
return function(obj) { \n\
|
||||
'use strict' \n\
|
||||
var len = this.length; \n\
|
||||
ensureMethod(obj, 'methodName'); \n\
|
||||
switch(len) { \n\
|
||||
case 1: return obj.methodName(this[0]); \n\
|
||||
case 2: return obj.methodName(this[0], this[1]); \n\
|
||||
case 3: return obj.methodName(this[0], this[1], this[2]); \n\
|
||||
case 0: return obj.methodName(); \n\
|
||||
default: \n\
|
||||
return obj.methodName.apply(obj, this); \n\
|
||||
} \n\
|
||||
}; \n\
|
||||
".replace(/methodName/g, methodName))(ensureMethod);
|
||||
};
|
||||
|
||||
var makeGetter = function (propertyName) {
|
||||
return new Function("obj", " \n\
|
||||
'use strict'; \n\
|
||||
return obj.propertyName; \n\
|
||||
".replace("propertyName", propertyName));
|
||||
};
|
||||
|
||||
var getCompiled = function(name, compiler, cache) {
|
||||
var ret = cache[name];
|
||||
if (typeof ret !== "function") {
|
||||
if (!isIdentifier(name)) {
|
||||
return null;
|
||||
}
|
||||
ret = compiler(name);
|
||||
cache[name] = ret;
|
||||
cache[" size"]++;
|
||||
if (cache[" size"] > 512) {
|
||||
var keys = Object.keys(cache);
|
||||
for (var i = 0; i < 256; ++i) delete cache[keys[i]];
|
||||
cache[" size"] = keys.length - 256;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
getMethodCaller = function(name) {
|
||||
return getCompiled(name, makeMethodCaller, callerCache);
|
||||
};
|
||||
|
||||
getGetter = function(name) {
|
||||
return getCompiled(name, makeGetter, getterCache);
|
||||
};
|
||||
}
|
||||
|
||||
function ensureMethod(obj, methodName) {
|
||||
var fn;
|
||||
if (obj != null) fn = obj[methodName];
|
||||
if (typeof fn !== "function") {
|
||||
var message = "Object " + util.classString(obj) + " has no method '" +
|
||||
util.toString(methodName) + "'";
|
||||
throw new Promise.TypeError(message);
|
||||
}
|
||||
return fn;
|
||||
}
|
||||
|
||||
function caller(obj) {
|
||||
var methodName = this.pop();
|
||||
var fn = ensureMethod(obj, methodName);
|
||||
return fn.apply(obj, this);
|
||||
}
|
||||
Promise.prototype.call = function (methodName) {
|
||||
var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];};
|
||||
if (!false) {
|
||||
if (canEvaluate) {
|
||||
var maybeCaller = getMethodCaller(methodName);
|
||||
if (maybeCaller !== null) {
|
||||
return this._then(
|
||||
maybeCaller, undefined, undefined, args, undefined);
|
||||
}
|
||||
}
|
||||
}
|
||||
args.push(methodName);
|
||||
return this._then(caller, undefined, undefined, args, undefined);
|
||||
};
|
||||
|
||||
function namedGetter(obj) {
|
||||
return obj[this];
|
||||
}
|
||||
function indexedGetter(obj) {
|
||||
var index = +this;
|
||||
if (index < 0) index = Math.max(0, index + obj.length);
|
||||
return obj[index];
|
||||
}
|
||||
Promise.prototype.get = function (propertyName) {
|
||||
var isIndex = (typeof propertyName === "number");
|
||||
var getter;
|
||||
if (!isIndex) {
|
||||
if (canEvaluate) {
|
||||
var maybeGetter = getGetter(propertyName);
|
||||
getter = maybeGetter !== null ? maybeGetter : namedGetter;
|
||||
} else {
|
||||
getter = namedGetter;
|
||||
}
|
||||
} else {
|
||||
getter = indexedGetter;
|
||||
}
|
||||
return this._then(getter, undefined, undefined, propertyName, undefined);
|
||||
};
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user