mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-20 05:14:44 +00:00
.
This commit is contained in:
parent
a004f0ae58
commit
fc725ba36b
7280 changed files with 19 additions and 1796407 deletions
23
node_modules/jest-serializer/LICENSE
generated
vendored
23
node_modules/jest-serializer/LICENSE
generated
vendored
|
@ -1,23 +0,0 @@
|
|||
MIT License
|
||||
|
||||
For Jest software
|
||||
|
||||
Copyright (c) 2014-present, Facebook, Inc.
|
||||
|
||||
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.
|
47
node_modules/jest-serializer/README.md
generated
vendored
47
node_modules/jest-serializer/README.md
generated
vendored
|
@ -1,47 +0,0 @@
|
|||
# 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);
|
||||
```
|
21
node_modules/jest-serializer/build/index.d.ts
generated
vendored
21
node_modules/jest-serializer/build/index.d.ts
generated
vendored
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. 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.
|
||||
*/
|
||||
/// <reference path="../v8.d.ts" />
|
||||
/// <reference types="node" />
|
||||
declare type Path = string;
|
||||
export declare function deserialize(buffer: Buffer): any;
|
||||
export declare function serialize(content: unknown): Buffer;
|
||||
export declare function readFileSync(filePath: Path): any;
|
||||
export declare function writeFileSync(filePath: Path, content: any): void;
|
||||
declare const _default: {
|
||||
deserialize: typeof deserialize;
|
||||
readFileSync: typeof readFileSync;
|
||||
serialize: typeof serialize;
|
||||
writeFileSync: typeof writeFileSync;
|
||||
};
|
||||
export default _default;
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
node_modules/jest-serializer/build/index.d.ts.map
generated
vendored
1
node_modules/jest-serializer/build/index.d.ts.map
generated
vendored
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;AAOH,aAAK,IAAI,GAAG,MAAM,CAAC;AAuGnB,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAI/C;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAIlD;AAID,wBAAgB,YAAY,CAAC,QAAQ,EAAE,IAAI,GAAG,GAAG,CAIhD;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,QAIzD;;;;;;;AAED,wBAKE"}
|
206
node_modules/jest-serializer/build/index.js
generated
vendored
206
node_modules/jest-serializer/build/index.js
generated
vendored
|
@ -1,206 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.deserialize = deserialize;
|
||||
exports.serialize = serialize;
|
||||
exports.readFileSync = readFileSync;
|
||||
exports.writeFileSync = writeFileSync;
|
||||
exports.default = void 0;
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require('fs'));
|
||||
|
||||
_fs = function _fs() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _v() {
|
||||
const data = _interopRequireDefault(require('v8'));
|
||||
|
||||
_v = function _v() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. 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.
|
||||
*/
|
||||
// TODO: Remove this
|
||||
/// <reference path="../v8.d.ts" />
|
||||
// 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 {
|
||||
// @ts-ignore intentional removal of "toJSON" property.
|
||||
Date.prototype.toJSON = undefined; // @ts-ignore intentional removal of "toJSON" property.
|
||||
|
||||
Buffer.prototype.toJSON = undefined;
|
||||
return JSON.stringify(content, replacer);
|
||||
} finally {
|
||||
Date.prototype.toJSON = dateToJSON;
|
||||
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().default.deserialize
|
||||
? _v().default.deserialize(buffer)
|
||||
: jsonParse(buffer.toString('utf8'));
|
||||
}
|
||||
|
||||
function serialize(content) {
|
||||
return _v().default.serialize
|
||||
? _v().default.serialize(content)
|
||||
: Buffer.from(jsonStringify(content));
|
||||
} // Synchronous filesystem functions.
|
||||
|
||||
function readFileSync(filePath) {
|
||||
return _v().default.deserialize
|
||||
? _v().default.deserialize(_fs().default.readFileSync(filePath))
|
||||
: jsonParse(_fs().default.readFileSync(filePath, 'utf8'));
|
||||
}
|
||||
|
||||
function writeFileSync(filePath, content) {
|
||||
return _v().default.serialize
|
||||
? _fs().default.writeFileSync(filePath, _v().default.serialize(content))
|
||||
: _fs().default.writeFileSync(filePath, jsonStringify(content), 'utf8');
|
||||
}
|
||||
|
||||
var _default = {
|
||||
deserialize,
|
||||
readFileSync,
|
||||
serialize,
|
||||
writeFileSync
|
||||
};
|
||||
exports.default = _default;
|
53
node_modules/jest-serializer/package.json
generated
vendored
53
node_modules/jest-serializer/package.json
generated
vendored
|
@ -1,53 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"jest-serializer@24.4.0",
|
||||
"/Users/eric/repos/actions/setup-node"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "jest-serializer@24.4.0",
|
||||
"_id": "jest-serializer@24.4.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q==",
|
||||
"_location": "/jest-serializer",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "jest-serializer@24.4.0",
|
||||
"name": "jest-serializer",
|
||||
"escapedName": "jest-serializer",
|
||||
"rawSpec": "24.4.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "24.4.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/jest-haste-map"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-24.4.0.tgz",
|
||||
"_spec": "24.4.0",
|
||||
"_where": "/Users/eric/repos/actions/setup-node",
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/jest/issues"
|
||||
},
|
||||
"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`, `undefined`, `NaN`, etc, although the JSON one does it through a replacer/reviver.",
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"gitHead": "a018000fc162db3cfd0ebf9f23fdb734f05821a6",
|
||||
"homepage": "https://github.com/facebook/jest#readme",
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"name": "jest-serializer",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-serializer"
|
||||
},
|
||||
"types": "build/index.d.ts",
|
||||
"version": "24.4.0"
|
||||
}
|
7
node_modules/jest-serializer/tsconfig.json
generated
vendored
7
node_modules/jest-serializer/tsconfig.json
generated
vendored
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "build"
|
||||
}
|
||||
}
|
11
node_modules/jest-serializer/v8.d.ts
generated
vendored
11
node_modules/jest-serializer/v8.d.ts
generated
vendored
|
@ -1,11 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. 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.
|
||||
*/
|
||||
|
||||
declare module 'v8' {
|
||||
function serialize(value: unknown): Buffer;
|
||||
function deserialize(value: Buffer): unknown;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue