initial commit taken from gitlab.lrz.de

This commit is contained in:
privatereese
2018-08-24 18:09:42 +02:00
parent ae54ed4c48
commit fc05486403
28494 changed files with 2159823 additions and 0 deletions

115
node_modules/jest-docblock/README.md generated vendored Normal file
View File

@@ -0,0 +1,115 @@
# jest-docblock
`jest-docblock` is a package that can extract and parse a specially-formatted
comment called a "docblock" at the top of a file.
A docblock looks like this:
```js
/**
* Stuff goes here!
*/
```
Docblocks can contain pragmas, which are words prefixed by `@`:
```js
/**
* Pragma incoming!
*
* @flow
*/
```
Pragmas can also take arguments:
```js
/**
* Check this out:
*
* @myPragma it is so cool
*/
```
`jest-docblock` can:
* extract the docblock from some code as a string
* parse a docblock string's pragmas into an object
* print an object and some comments back to a string
## Installation
```sh
# with yarn
$ yarn add jest-docblock
# with npm
$ npm install jest-docblock
```
## Usage
```js
const code = `
/**
* Everything is awesome!
*
* @everything is:awesome
* @flow
*/
export const everything = Object.create(null);
export default function isAwesome(something) {
return something === everything;
}
`;
const {
extract,
strip,
parse,
parseWithComments,
print,
} = require('jest-docblock');
const docblock = extract(code);
console.log(docblock); // "/**\n * Everything is awesome!\n * \n * @everything is:awesome\n * @flow\n */"
const stripped = strip(code);
console.log(stripped); // "export const everything = Object.create(null);\n export default function isAwesome(something) {\n return something === everything;\n }"
const pragmas = parse(docblock);
console.log(pragmas); // { everything: "is:awesome", flow: "" }
const parsed = parseWithComments(docblock);
console.log(parsed); // { comments: "Everything is awesome!", pragmas: { everything: "is:awesome", flow: "" } }
console.log(print({pragmas, comments: 'hi!'})); // /**\n * hi!\n *\n * @everything is:awesome\n * @flow\n */;
```
## API Documentation
### `extract(contents: string): string`
Extracts a docblock from some file contents. Returns the docblock contained in
`contents`. If `contents` did not contain a docblock, it will return the empty
string (`""`).
### `strip(contents: string): string`
Strips the top docblock from a file and return the result. If a file does not
have a docblock at the top, then return the file unchanged.
### `parse(docblock: string): {[key: string]: string | string[] }`
Parses the pragmas in a docblock string into an object whose keys are the pragma
tags and whose values are the arguments to those pragmas.
### `parseWithComments(docblock: string): { comments: string, pragmas: {[key: string]: string | string[]} }`
Similar to `parse` except this method also returns the comments from the
docblock. Useful when used with `print()`.
### `print({ comments?: string, pragmas?: {[key: string]: string | string[]} }): string`
Prints an object of key-value pairs back into a docblock. If `comments` are
provided, they will be positioned on the top of the docblock.

127
node_modules/jest-docblock/build/index.js generated vendored Normal file
View File

@@ -0,0 +1,127 @@
'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.
extract = extract;exports.
strip = strip;exports.
parse = parse;exports.
parseWithComments = parseWithComments;exports.
print = print;var _detectNewline;function _load_detectNewline() {return _detectNewline = _interopRequireDefault(require('detect-newline'));}var _os;function _load_os() {return _os = require('os');}function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/const commentEndRe = /\*\/$/;const commentStartRe = /^\/\*\*/;const docblockRe = /^\s*(\/\*\*?(.|\r?\n)*?\*\/)/;const lineCommentRe = /(^|\s+)\/\/([^\r\n]*)/g;const ltrimNewlineRe = /^(\r?\n)+/;const multilineRe = /(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g;const propertyRe = /(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g;const stringStartRe = /(\r?\n|^) *\* ?/g;function extract(contents) {const match = contents.match(docblockRe);return match ? match[0].trimLeft() : '';}function strip(contents) {const match = contents.match(docblockRe);return match && match[0] ? contents.substring(match[0].length) : contents;}function parse(docblock) {return parseWithComments(docblock).pragmas;}function parseWithComments(docblock) {const line = (0, (_detectNewline || _load_detectNewline()).default)(docblock) || (_os || _load_os()).EOL;docblock = docblock.replace(commentStartRe, '').replace(commentEndRe, '').replace(stringStartRe, '$1'); // Normalize multi-line directives
let prev = '';while (prev !== docblock) {prev = docblock;docblock = docblock.replace(multilineRe, `${line}$1 $2${line}`);}docblock = docblock.replace(ltrimNewlineRe, '').trimRight();const result = Object.create(null);const comments = docblock.replace(propertyRe, '').replace(ltrimNewlineRe, '').trimRight();let match;while (match = propertyRe.exec(docblock)) {// strip linecomments from pragmas
const nextPragma = match[2].replace(lineCommentRe, '');if (typeof result[match[1]] === 'string' || Array.isArray(result[match[1]])) {result[match[1]] = [].concat(result[match[1]], nextPragma);} else {result[match[1]] = nextPragma;}}return { comments, pragmas: result };}function print(_ref) {var _ref$comments = _ref.comments;let comments = _ref$comments === undefined ? '' : _ref$comments;var _ref$pragmas = _ref.pragmas;let pragmas = _ref$pragmas === undefined ? {} : _ref$pragmas;const line = (0, (_detectNewline || _load_detectNewline()).default)(comments) || (_os || _load_os()).EOL;const head = '/**';
const start = ' *';
const tail = ' */';
const keys = Object.keys(pragmas);
const printedObject = keys.
map(key => printKeyValues(key, pragmas[key])).
reduce((arr, next) => arr.concat(next), []).
map(keyValue => start + ' ' + keyValue + line).
join('');
if (!comments) {
if (keys.length === 0) {
return '';
}
if (keys.length === 1 && !Array.isArray(pragmas[keys[0]])) {
const value = pragmas[keys[0]];
return `${head} ${printKeyValues(keys[0], value)[0]}${tail}`;
}
}
const printedComments =
comments.
split(line).
map(textLine => `${start} ${textLine}`).
join(line) + line;
return (
head +
line + (
comments ? printedComments : '') + (
comments && keys.length ? start + line : '') +
printedObject +
tail);
}
function printKeyValues(key, valueOrArray) {
return [].concat(valueOrArray).map(value => `@${key} ${value}`.trim());
}

91
node_modules/jest-docblock/package.json generated vendored Normal file
View File

@@ -0,0 +1,91 @@
{
"_args": [
[
"jest-docblock@22.4.0",
"/home/bernhard/freifunk-app/node_modules/metro"
]
],
"_from": "jest-docblock@22.4.0",
"_id": "jest-docblock@22.4.0",
"_inCache": true,
"_installable": true,
"_location": "/jest-docblock",
"_nodeVersion": "8.9.1",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/jest-docblock_22.4.0_1519128207301_0.8008459783765294"
},
"_npmUser": {
"email": "mjesun@hotmail.com",
"name": "mjesun"
},
"_npmVersion": "5.5.1",
"_phantomChildren": {},
"_requested": {
"name": "jest-docblock",
"raw": "jest-docblock@22.4.0",
"rawSpec": "22.4.0",
"scope": null,
"spec": "22.4.0",
"type": "version"
},
"_requiredBy": [
"/jest-haste-map",
"/jest-runner",
"/metro"
],
"_resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-22.4.0.tgz",
"_shasum": "dbf1877e2550070cfc4d9b07a55775a0483159b8",
"_shrinkwrap": null,
"_spec": "jest-docblock@22.4.0",
"_where": "/home/bernhard/freifunk-app/node_modules/metro",
"bugs": {
"url": "https://github.com/facebook/jest/issues"
},
"dependencies": {
"detect-newline": "^2.1.0"
},
"description": "`jest-docblock` is a package that can extract and parse a specially-formatted comment called a \"docblock\" at the top of a file.",
"devDependencies": {},
"directories": {},
"dist": {
"fileCount": 3,
"integrity": "sha512-lDY7GZ+/CJb02oULYLBDj7Hs5shBhVpDYpIm8LUyqw9X2J22QRsM19gmGQwIFqGSJmpc/LRrSYudeSrG510xlQ==",
"shasum": "dbf1877e2550070cfc4d9b07a55775a0483159b8",
"tarball": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-22.4.0.tgz",
"unpackedSize": 8833
},
"homepage": "https://github.com/facebook/jest#readme",
"license": "MIT",
"main": "build/index.js",
"maintainers": [
{
"name": "aaronabramov",
"email": "aaron@abramov.io"
},
{
"name": "cpojer",
"email": "christoph.pojer@gmail.com"
},
{
"name": "fb",
"email": "opensource+npm@fb.com"
},
{
"name": "jeanlauliac",
"email": "jean@lauliac.com"
},
{
"name": "mjesun",
"email": "mjesun@hotmail.com"
}
],
"name": "jest-docblock",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/facebook/jest.git"
},
"version": "22.4.0"
}