Updating NPM dependencies
This commit is contained in:
7
node_modules/jest-serializer/build/index.d.ts
generated
vendored
7
node_modules/jest-serializer/build/index.d.ts
generated
vendored
@@ -7,10 +7,10 @@
|
||||
/// <reference path="../v8.d.ts" />
|
||||
/// <reference types="node" />
|
||||
declare type Path = string;
|
||||
export declare function deserialize(buffer: Buffer): any;
|
||||
export declare function deserialize(buffer: Buffer): unknown;
|
||||
export declare function serialize(content: unknown): Buffer;
|
||||
export declare function readFileSync(filePath: Path): any;
|
||||
export declare function writeFileSync(filePath: Path, content: any): void;
|
||||
export declare function readFileSync(filePath: Path): unknown;
|
||||
export declare function writeFileSync(filePath: Path, content: unknown): void;
|
||||
declare const _default: {
|
||||
deserialize: typeof deserialize;
|
||||
readFileSync: typeof readFileSync;
|
||||
@@ -18,4 +18,3 @@ declare const _default: {
|
||||
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"}
|
||||
211
node_modules/jest-serializer/build/index.js
generated
vendored
211
node_modules/jest-serializer/build/index.js
generated
vendored
@@ -9,28 +9,66 @@ 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'));
|
||||
const data = require('v8');
|
||||
|
||||
_v = function _v() {
|
||||
_v = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
function fs() {
|
||||
const data = _interopRequireWildcard(require('graceful-fs'));
|
||||
|
||||
fs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function () {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,156 +83,21 @@ function _interopRequireDefault(obj) {
|
||||
// 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.
|
||||
|
||||
// In memory functions.
|
||||
function deserialize(buffer) {
|
||||
return _v().default.deserialize
|
||||
? _v().default.deserialize(buffer)
|
||||
: jsonParse(buffer.toString('utf8'));
|
||||
return (0, _v().deserialize)(buffer);
|
||||
}
|
||||
|
||||
function serialize(content) {
|
||||
return _v().default.serialize
|
||||
? _v().default.serialize(content)
|
||||
: Buffer.from(jsonStringify(content));
|
||||
return (0, _v().serialize)(content);
|
||||
} // Synchronous filesystem functions.
|
||||
|
||||
function readFileSync(filePath) {
|
||||
return _v().default.deserialize
|
||||
? _v().default.deserialize(_fs().default.readFileSync(filePath))
|
||||
: jsonParse(_fs().default.readFileSync(filePath, 'utf8'));
|
||||
return (0, _v().deserialize)(fs().readFileSync(filePath));
|
||||
}
|
||||
|
||||
function writeFileSync(filePath, content) {
|
||||
return _v().default.serialize
|
||||
? _fs().default.writeFileSync(filePath, _v().default.serialize(content))
|
||||
: _fs().default.writeFileSync(filePath, jsonStringify(content), 'utf8');
|
||||
return fs().writeFileSync(filePath, (0, _v().serialize)(content));
|
||||
}
|
||||
|
||||
var _default = {
|
||||
|
||||
Reference in New Issue
Block a user