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

54
node_modules/jest-serializer/README.md generated vendored Normal file
View File

@@ -0,0 +1,54 @@
# jest-serializer
Module for serializing and deserializing object into memory and disk. By
default, the `v8` implementations are used, but if not present, it defaults to
`JSON` implementation. Both serializers have the advantage of being able to
serialize `Map`, `Set`, `undefined`, `NaN`, etc, although the JSON one does it
through a replacer/reviver.
## Install
```sh
$ yarn add jest-serializer
```
## API
Three kinds of API groups are exposed:
### In-memory serialization: `serialize` and `deserialize`
This set of functions take or return a `Buffer`. All the process happens in
memory. This is useful when willing to transfer over HTTP, TCP or via UNIX
pipes.
```javascript
import {serialize, deserialize} from 'jest-serializer';
const myObject = {
foo: 'bar',
baz: [0, true, '2', [], {}],
};
const buffer = serialize(myObject);
const myCopyObject = deserialize(buffer);
```
### Synchronous persistent filesystem: `readFileSync` and `writeFileSync`
This set of functions allow to send to disk a serialization result and retrieve
it back, in a synchronous way. It mimics the `fs` API so it looks familiar.
```javascript
import {readFileSync, writeFileSync} from 'jest-serializer';
const myObject = {
foo: 'bar',
baz: [0, true, '2', [], {}],
};
const myFile = '/tmp/obj';
writeFileSync(myFile, myObject);
const myCopyObject = readFileSync(myFile);
```

174
node_modules/jest-serializer/build/index.js generated vendored Normal file
View File

@@ -0,0 +1,174 @@
/**
* Copyright (c) 2018-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.
*
*
*/
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.deserialize = deserialize;
exports.serialize = serialize;
exports.readFileSync = readFileSync;
exports.writeFileSync = writeFileSync;
var _fs;
function _load_fs() {
return _fs = _interopRequireDefault(require('fs'));
}
var _v;
function _load_v() {
return _v = _interopRequireDefault(require('v8'));
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// JSON and V8 serializers are both stable when it comes to compatibility. The
// current JSON specification is well defined in RFC 8259, and V8 ensures that
// the versions are compatible by encoding the serialization version in the own
// generated buffer.
const JS_TYPE = '__$t__';
const JS_VALUE = '__$v__';
const JS_VF = '__$f__';
function replacer(key, value) {
// NaN cannot be in a switch statement, because NaN !== NaN.
if (Number.isNaN(value)) {
return { [JS_TYPE]: 'n' };
}
switch (value) {
case undefined:
return { [JS_TYPE]: 'u' };
case +Infinity:
return { [JS_TYPE]: '+' };
case -Infinity:
return { [JS_TYPE]: '-' };
}
switch (value && value.constructor) {
case Date:
return { [JS_TYPE]: 'd', [JS_VALUE]: value.getTime() };
case RegExp:
return { [JS_TYPE]: 'r', [JS_VALUE]: value.source, [JS_VF]: value.flags };
case Set:
return { [JS_TYPE]: 's', [JS_VALUE]: Array.from(value) };
case Map:
return { [JS_TYPE]: 'm', [JS_VALUE]: Array.from(value) };
case Buffer:
return { [JS_TYPE]: 'b', [JS_VALUE]: value.toString('latin1') };
}
return value;
}
function reviver(key, value) {
if (!value || typeof value !== 'object' && !value.hasOwnProperty(JS_TYPE)) {
return value;
}
switch (value[JS_TYPE]) {
case 'u':
return undefined;
case 'n':
return NaN;
case '+':
return +Infinity;
case '-':
return -Infinity;
case 'd':
return new Date(value[JS_VALUE]);
case 'r':
return new RegExp(value[JS_VALUE], value[JS_VF]);
case 's':
return new Set(value[JS_VALUE]);
case 'm':
return new Map(value[JS_VALUE]);
case 'b':
return Buffer.from(value[JS_VALUE], 'latin1');
}
return value;
}
function jsonStringify(content) {
// Not pretty, but the ES JSON spec says that "toJSON" will be called before
// getting into your replacer, so we have to remove them beforehand. See
// https://www.ecma-international.org/ecma-262/#sec-serializejsonproperty
// section 2.b for more information.
const dateToJSON = Date.prototype.toJSON;
const bufferToJSON = Buffer.prototype.toJSON;
/* eslint-disable no-extend-native */
try {
// $FlowFixMe: intentional removal of "toJSON" property.
Date.prototype.toJSON = undefined;
// $FlowFixMe: intentional removal of "toJSON" property.
Buffer.prototype.toJSON = undefined;
return JSON.stringify(content, replacer);
} finally {
// $FlowFixMe: intentional assignment of "toJSON" property.
Date.prototype.toJSON = dateToJSON;
// $FlowFixMe: intentional assignment of "toJSON" property.
Buffer.prototype.toJSON = bufferToJSON;
}
/* eslint-enable no-extend-native */
}
function jsonParse(content) {
return JSON.parse(content, reviver);
}
// In memory functions.
function deserialize(buffer) {
return (_v || _load_v()).default.deserialize ? (_v || _load_v()).default.deserialize(buffer) : jsonParse(buffer.toString('utf8'));
}
function serialize(content) {
return (_v || _load_v()).default.serialize ? (_v || _load_v()).default.serialize(content) : Buffer.from(jsonStringify(content));
}
// Synchronous filesystem functions.
function readFileSync(filePath) {
return (_v || _load_v()).default.deserialize ? (_v || _load_v()).default.deserialize((_fs || _load_fs()).default.readFileSync(filePath)) : jsonParse((_fs || _load_fs()).default.readFileSync(filePath, 'utf8'));
}
function writeFileSync(filePath, content) {
return (_v || _load_v()).default.serialize ? (_fs || _load_fs()).default.writeFileSync(filePath, (_v || _load_v()).default.serialize(content)) : (_fs || _load_fs()).default.writeFileSync(filePath, jsonStringify(content), 'utf8');
}
exports.default = {
deserialize,
readFileSync,
serialize,
writeFileSync
};

80
node_modules/jest-serializer/package.json generated vendored Normal file
View File

@@ -0,0 +1,80 @@
{
"_args": [
[
"jest-serializer@^22.4.0",
"/home/bernhard/freifunk-app/node_modules/jest-haste-map"
]
],
"_from": "jest-serializer@>=22.4.0 <23.0.0",
"_id": "jest-serializer@22.4.3",
"_inCache": true,
"_installable": true,
"_location": "/jest-serializer",
"_nodeVersion": "8.9.1",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/jest-serializer_22.4.3_1521648488316_0.47187571126282135"
},
"_npmUser": {
"email": "mjesun@hotmail.com",
"name": "mjesun"
},
"_npmVersion": "5.5.1",
"_phantomChildren": {},
"_requested": {
"name": "jest-serializer",
"raw": "jest-serializer@^22.4.0",
"rawSpec": "^22.4.0",
"scope": null,
"spec": ">=22.4.0 <23.0.0",
"type": "range"
},
"_requiredBy": [
"/jest-haste-map",
"/metro-cache"
],
"_resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-22.4.3.tgz",
"_shasum": "a679b81a7f111e4766235f4f0c46d230ee0f7436",
"_shrinkwrap": null,
"_spec": "jest-serializer@^22.4.0",
"_where": "/home/bernhard/freifunk-app/node_modules/jest-haste-map",
"bugs": {
"url": "https://github.com/facebook/jest/issues"
},
"dependencies": {},
"description": "Module for serializing and deserializing object into memory and disk. By default, the `v8` implementations are used, but if not present, it defaults to `JSON` implementation. Both serializers have the advantage of being able to serialize `Map`, `Set`, `un",
"devDependencies": {},
"directories": {},
"dist": {
"fileCount": 3,
"integrity": "sha512-uPaUAppx4VUfJ0QDerpNdF43F68eqKWCzzhUlKNDsUPhjOon7ZehR4C809GCqh765FoMRtTVUVnGvIoskkYHiw==",
"shasum": "a679b81a7f111e4766235f4f0c46d230ee0f7436",
"tarball": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-22.4.3.tgz",
"unpackedSize": 6130
},
"homepage": "https://github.com/facebook/jest#readme",
"license": "MIT",
"main": "build/index.js",
"maintainers": [
{
"name": "cpojer",
"email": "christoph.pojer@gmail.com"
},
{
"name": "fb",
"email": "opensource+npm@fb.com"
},
{
"name": "mjesun",
"email": "mjesun@hotmail.com"
}
],
"name": "jest-serializer",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/facebook/jest.git"
},
"version": "22.4.3"
}