v3 new release (#84)

swap to graphql
This commit is contained in:
github-actions[bot]
2022-07-11 13:48:02 -04:00
committed by GitHub
parent 20d2b4f98d
commit e4f3964f67
1492 changed files with 63799 additions and 63001 deletions

View File

@@ -1 +0,0 @@
coverage/

View File

@@ -5,6 +5,24 @@ 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).
## [v1.12.2](https://github.com/inspect-js/object-inspect/compare/v1.12.1...v1.12.2) - 2022-05-26
### Commits
- [Fix] use `util.inspect` for a custom inspection symbol method [`e243bf2`](https://github.com/inspect-js/object-inspect/commit/e243bf2eda6c4403ac6f1146fddb14d12e9646c1)
- [meta] add support info [`ca20ba3`](https://github.com/inspect-js/object-inspect/commit/ca20ba35713c17068ca912a86c542f5e8acb656c)
- [Fix] ignore `cause` in node v16.9 and v16.10 where it has a bug [`86aa553`](https://github.com/inspect-js/object-inspect/commit/86aa553a4a455562c2c56f1540f0bf857b9d314b)
## [v1.12.1](https://github.com/inspect-js/object-inspect/compare/v1.12.0...v1.12.1) - 2022-05-21
### Commits
- [Tests] use `mock-property` [`4ec8893`](https://github.com/inspect-js/object-inspect/commit/4ec8893ea9bfd28065ca3638cf6762424bf44352)
- [meta] use `npmignore` to autogenerate an npmignore file [`07f868c`](https://github.com/inspect-js/object-inspect/commit/07f868c10bd25a9d18686528339bb749c211fc9a)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`b05244b`](https://github.com/inspect-js/object-inspect/commit/b05244b4f331e00c43b3151bc498041be77ccc91)
- [Dev Deps] update `@ljharb/eslint-config`, `error-cause`, `es-value-fixtures`, `functions-have-names`, `tape` [`d037398`](https://github.com/inspect-js/object-inspect/commit/d037398dcc5d531532e4c19c4a711ed677f579c1)
- [Fix] properly handle callable regexes in older engines [`848fe48`](https://github.com/inspect-js/object-inspect/commit/848fe48bd6dd0064ba781ee6f3c5e54a94144c37)
## [v1.12.0](https://github.com/inspect-js/object-inspect/compare/v1.11.1...v1.12.0) - 2021-12-18
### Commits

13
node_modules/object-inspect/index.js generated vendored
View File

@@ -65,8 +65,9 @@ function addNumericSeparator(num, str) {
return $replace.call(str, sepRegex, '$&_');
}
var inspectCustom = require('./util.inspect').custom;
var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
var utilInspect = require('./util.inspect');
var inspectCustom = utilInspect.custom;
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
module.exports = function inspect_(obj, options, depth, seen) {
var opts = options || {};
@@ -156,7 +157,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
return inspect_(value, opts, depth + 1, seen);
}
if (typeof obj === 'function') {
if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
var name = nameOf(obj);
var keys = arrObjKeys(obj, inspect);
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
@@ -186,15 +187,15 @@ module.exports = function inspect_(obj, options, depth, seen) {
}
if (isError(obj)) {
var parts = arrObjKeys(obj, inspect);
if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
}
if (parts.length === 0) { return '[' + String(obj) + ']'; }
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
}
if (typeof obj === 'object' && customInspect) {
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
return obj[inspectSymbol]();
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
return utilInspect(obj, { depth: maxDepth - depth });
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
return obj.inspect();
}

20
node_modules/object-inspect/package-support.json generated vendored Normal file
View File

@@ -0,0 +1,20 @@
{
"versions": [
{
"version": "*",
"target": {
"node": "all"
},
"response": {
"type": "time-permitting"
},
"backing": {
"npm-funding": true,
"donations": [
"https://github.com/ljharb",
"https://tidelift.com/funding/github/npm/object-inspect"
]
}
}
]
}

View File

@@ -1,27 +1,30 @@
{
"name": "object-inspect",
"version": "1.12.0",
"version": "1.12.2",
"description": "string representations of objects in node and the browser",
"main": "index.js",
"sideEffects": false,
"devDependencies": {
"@ljharb/eslint-config": "^20.1.0",
"aud": "^1.1.5",
"auto-changelog": "^2.3.0",
"@ljharb/eslint-config": "^21.0.0",
"aud": "^2.0.0",
"auto-changelog": "^2.4.0",
"core-js": "^2.6.12",
"error-cause": "^1.0.3",
"es-value-fixtures": "^1.2.1",
"eslint": "^8.5.0",
"error-cause": "^1.0.4",
"es-value-fixtures": "^1.4.1",
"eslint": "=8.8.0",
"for-each": "^0.3.3",
"functions-have-names": "^1.2.2",
"functions-have-names": "^1.2.3",
"has-tostringtag": "^1.0.0",
"make-arrow-function": "^1.2.0",
"mock-property": "^1.0.0",
"npmignore": "^0.3.0",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"string.prototype.repeat": "^1.0.0",
"tape": "^5.3.2"
"tape": "^5.5.3"
},
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"pretest": "npm run lint",
@@ -80,5 +83,12 @@
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
}
},
"publishConfig": {
"ignore": [
".github/workflows",
"./test-core-js.js"
]
},
"support": true
}

View File

@@ -40,9 +40,9 @@ test('type error', function (t) {
'{ [TypeError] foo: 555, bar: [ 1, 2, 3 ] }',
'{ [TypeError: tuv] baz: 555 }',
'{ [SyntaxError: whoa] message: \'whoa\', \'a-b\': 5 }',
'{ [Error: foo] [cause]: \'bar\' }',
'{ [Error: foo] [cause]: \'bar\', foo: \'bar\' }',
'{ [Error: foo] [cause]: undefined }',
'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: \'bar\' }',
'{ [Error: foo] ' + ('cause' in Error.prototype ? '' : '[cause]: \'bar\', ') + 'foo: \'bar\' }',
'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: undefined }',
'{ [Error: foo] cause: \'bar\' }'
].join(', ') + ' ]');
});

View File

@@ -1,34 +1,15 @@
'use strict';
var inspect = require('../');
var test = require('tape');
function withoutProperty(object, property, fn) {
var original;
if (Object.getOwnPropertyDescriptor) {
original = Object.getOwnPropertyDescriptor(object, property);
} else {
original = object[property];
}
delete object[property];
try {
fn();
} finally {
if (Object.getOwnPropertyDescriptor) {
Object.defineProperty(object, property, original);
} else {
object[property] = original;
}
}
}
var mockProperty = require('mock-property');
test('when Object#hasOwnProperty is deleted', function (t) {
t.plan(1);
var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays
// eslint-disable-next-line no-extend-native
Array.prototype[1] = 2; // this is needed to account for "in" vs "hasOwnProperty"
t.teardown(mockProperty(Array.prototype, 1, { value: 2 })); // this is needed to account for "in" vs "hasOwnProperty"
t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true }));
withoutProperty(Object.prototype, 'hasOwnProperty', function () {
t.equal(inspect(arr), '[ 1, , 3 ]');
});
delete Array.prototype[1];
t.equal(inspect(arr), '[ 1, , 3 ]');
});

View File

@@ -100,3 +100,40 @@ test('maxStringLength', function (t) {
t.end();
});
test('inspect options', { skip: !utilInspect.custom }, function (t) {
var obj = {};
obj[utilInspect.custom] = function () {
return JSON.stringify(arguments);
};
t.equal(
inspect(obj),
utilInspect(obj, { depth: 5 }),
'custom symbols will use node\'s inspect'
);
t.equal(
inspect(obj, { depth: 2 }),
utilInspect(obj, { depth: 2 }),
'a reduced depth will be passed to node\'s inspect'
);
t.equal(
inspect({ d1: obj }, { depth: 3 }),
'{ d1: ' + utilInspect(obj, { depth: 2 }) + ' }',
'deep objects will receive a reduced depth'
);
t.equal(
inspect({ d1: obj }, { depth: 1 }),
'{ d1: [Object] }',
'unlike nodejs inspect, customInspect will not be used once the depth is exceeded.'
);
t.end();
});
test('inspect URL', { skip: typeof URL === 'undefined' }, function (t) {
t.match(
inspect(new URL('https://nodejs.org')),
/nodejs\.org/, // Different environments stringify it differently
'url can be inspected'
);
t.end();
});

View File

@@ -2,6 +2,7 @@
var inspect = require('../');
var test = require('tape');
var mockProperty = require('mock-property');
var hasSymbols = require('has-symbols/shams')();
var hasToStringTag = require('has-tostringtag/shams')();
@@ -23,10 +24,9 @@ test('arrays with properties', function (t) {
test('has', function (t) {
t.plan(1);
var has = Object.prototype.hasOwnProperty;
delete Object.prototype.hasOwnProperty;
t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true }));
t.equal(inspect({ a: 1, b: 2 }), '{ a: 1, b: 2 }');
Object.prototype.hasOwnProperty = has; // eslint-disable-line no-extend-native
});
test('indexOf seen', function (t) {