@jsdevtools/ono
Advanced tools
Comparing version 7.1.2 to 7.1.3
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Ono = void 0; | ||
const extend_error_1 = require("./extend-error"); | ||
@@ -11,3 +12,3 @@ const normalize_1 = require("./normalize"); | ||
*/ | ||
// tslint:disable-next-line: variable-name | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
function Ono(ErrorConstructor, options) { | ||
@@ -14,0 +15,0 @@ options = normalize_1.normalizeOptions(options); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.extendError = void 0; | ||
const isomorphic_node_1 = require("./isomorphic.node"); | ||
@@ -25,2 +26,3 @@ const stack_1 = require("./stack"); | ||
// On Node.js, add support for the `util.inspect()` method | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
if (isomorphic_node_1.addInspectMethod) { | ||
@@ -63,3 +65,2 @@ isomorphic_node_1.addInspectMethod(onoError); | ||
// see https://github.com/Microsoft/TypeScript/issues/1863 | ||
// tslint:disable: no-any no-unsafe-any | ||
let _newError = newError; | ||
@@ -66,0 +67,0 @@ let _originalError = originalError; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ono = void 0; | ||
/* eslint-env commonjs */ | ||
const singleton_1 = require("./singleton"); | ||
exports.ono = singleton_1.ono; | ||
Object.defineProperty(exports, "ono", { enumerable: true, get: function () { return singleton_1.ono; } }); | ||
var constructor_1 = require("./constructor"); | ||
exports.Ono = constructor_1.Ono; | ||
// tslint:disable-next-line: no-default-export | ||
Object.defineProperty(exports, "Ono", { enumerable: true, get: function () { return constructor_1.Ono; } }); | ||
__exportStar(require("./types"), exports); | ||
exports.default = singleton_1.ono; | ||
// CommonJS default export hack | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
module.exports = Object.assign(module.exports.default, module.exports); // tslint:disable-line: no-unsafe-any | ||
module.exports = Object.assign(module.exports.default, module.exports); | ||
} | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.addInspectMethod = exports.format = void 0; | ||
/** | ||
@@ -4,0 +5,0 @@ * Ono supports custom formatters for error messages. In Node.js, it defaults |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.addInspectMethod = exports.format = void 0; | ||
const util = require("util"); | ||
@@ -20,3 +21,3 @@ const to_json_1 = require("./to-json"); | ||
function addInspectMethod(newError) { | ||
// @ts-ignore | ||
// @ts-expect-error - TypeScript doesn't support symbol indexers | ||
newError[inspectMethod] = inspect; | ||
@@ -33,3 +34,2 @@ } | ||
// see https://github.com/Microsoft/TypeScript/issues/1863 | ||
// tslint:disable: no-any no-unsafe-any | ||
let pojo = {}; | ||
@@ -43,6 +43,6 @@ let error = this; | ||
// otherwise it will cause `util.inspect()` to go into an infinite loop | ||
delete pojo[inspectMethod]; // tslint:disable-line: no-dynamic-delete | ||
// tslint:enable: no-any no-unsafe-any | ||
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete | ||
delete pojo[inspectMethod]; | ||
return pojo; | ||
} | ||
//# sourceMappingURL=isomorphic.node.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.normalizeArgs = exports.normalizeOptions = void 0; | ||
const isomorphic_node_1 = require("./isomorphic.node"); | ||
@@ -4,0 +5,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ono = void 0; | ||
const constructor_1 = require("./constructor"); | ||
@@ -4,0 +5,0 @@ const singleton = ono; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.lazyJoinStacks = exports.joinStacks = exports.isWritableStack = exports.isLazyStack = void 0; | ||
const newline = /\r?\n/; | ||
@@ -4,0 +5,0 @@ const onoCall = /\bono[ @]/; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDeepKeys = exports.toJSON = void 0; | ||
const nonJsonTypes = ["function", "symbol", "undefined"]; | ||
@@ -13,3 +14,2 @@ const protectedProps = ["constructor", "prototype", "__proto__"]; | ||
// see https://github.com/Microsoft/TypeScript/issues/1863 | ||
// tslint:disable: no-any no-unsafe-any | ||
let pojo = {}; | ||
@@ -26,3 +26,2 @@ let error = this; | ||
} | ||
// tslint:enable: no-any no-unsafe-any | ||
return pojo; | ||
@@ -29,0 +28,0 @@ } |
@@ -9,3 +9,3 @@ import { extendError } from "./extend-error"; | ||
*/ | ||
// tslint:disable-next-line: variable-name | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
function Ono(ErrorConstructor, options) { | ||
@@ -12,0 +12,0 @@ options = normalizeOptions(options); |
@@ -23,2 +23,3 @@ import { addInspectMethod } from "./isomorphic.node"; | ||
// On Node.js, add support for the `util.inspect()` method | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
if (addInspectMethod) { | ||
@@ -60,3 +61,2 @@ addInspectMethod(onoError); | ||
// see https://github.com/Microsoft/TypeScript/issues/1863 | ||
// tslint:disable: no-any no-unsafe-any | ||
let _newError = newError; | ||
@@ -63,0 +63,0 @@ let _originalError = originalError; |
@@ -0,10 +1,11 @@ | ||
/* eslint-env commonjs */ | ||
import { ono } from "./singleton"; | ||
export { Ono } from "./constructor"; | ||
export * from "./types"; | ||
export { ono }; | ||
// tslint:disable-next-line: no-default-export | ||
export default ono; | ||
// CommonJS default export hack | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
module.exports = Object.assign(module.exports.default, module.exports); // tslint:disable-line: no-unsafe-any | ||
module.exports = Object.assign(module.exports.default, module.exports); | ||
} | ||
//# sourceMappingURL=index.js.map |
@@ -18,3 +18,3 @@ import * as util from "util"; | ||
export function addInspectMethod(newError) { | ||
// @ts-ignore | ||
// @ts-expect-error - TypeScript doesn't support symbol indexers | ||
newError[inspectMethod] = inspect; | ||
@@ -30,3 +30,2 @@ } | ||
// see https://github.com/Microsoft/TypeScript/issues/1863 | ||
// tslint:disable: no-any no-unsafe-any | ||
let pojo = {}; | ||
@@ -40,6 +39,6 @@ let error = this; | ||
// otherwise it will cause `util.inspect()` to go into an infinite loop | ||
delete pojo[inspectMethod]; // tslint:disable-line: no-dynamic-delete | ||
// tslint:enable: no-any no-unsafe-any | ||
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete | ||
delete pojo[inspectMethod]; | ||
return pojo; | ||
} | ||
//# sourceMappingURL=isomorphic.node.js.map |
@@ -11,3 +11,2 @@ const nonJsonTypes = ["function", "symbol", "undefined"]; | ||
// see https://github.com/Microsoft/TypeScript/issues/1863 | ||
// tslint:disable: no-any no-unsafe-any | ||
let pojo = {}; | ||
@@ -24,3 +23,2 @@ let error = this; | ||
} | ||
// tslint:enable: no-any no-unsafe-any | ||
return pojo; | ||
@@ -27,0 +25,0 @@ } |
{ | ||
"name": "@jsdevtools/ono", | ||
"version": "7.1.2", | ||
"version": "7.1.3", | ||
"description": "Throw better errors.", | ||
@@ -41,5 +41,3 @@ "keywords": [ | ||
"clean": "shx rm -rf .nyc_output coverage cjs esm", | ||
"lint": "npm run lint:typescript && npm run lint:javascript", | ||
"lint:typescript": "tslint -p tsconfig.json", | ||
"lint:javascript": "eslint test ./*.js", | ||
"lint": "eslint src test", | ||
"build": "npm run build:cjs && npm run build:esm", | ||
@@ -60,22 +58,19 @@ "build:esm": "tsc", | ||
"devDependencies": { | ||
"@babel/polyfill": "^7.8.7", | ||
"@jsdevtools/eslint-config-modular": "^8.0.3", | ||
"@babel/polyfill": "^7.10.4", | ||
"@jsdevtools/eslint-config": "^1.0.0", | ||
"@jsdevtools/host-environment": "^2.0.3", | ||
"@jsdevtools/karma-config": "^3.1.4", | ||
"@jsdevtools/tslint-modular": "^2.0.5", | ||
"@jsdevtools/karma-config": "^3.1.6", | ||
"@jsdevtools/version-bump-prompt": "^6.0.3", | ||
"@types/node": "^13.13.0", | ||
"@types/node": "^14.0.19", | ||
"chai": "^4.2.0", | ||
"eslint": "^6.8.0", | ||
"karma": "^5.0.2", | ||
"eslint": "^7.4.0", | ||
"karma": "^5.1.0", | ||
"karma-cli": "^2.0.0", | ||
"mocha": "^7.1.1", | ||
"mocha": "^8.0.1", | ||
"npm-check": "^5.9.2", | ||
"nyc": "^15.0.1", | ||
"nyc": "^15.1.0", | ||
"shx": "^0.3.2", | ||
"tslint": "^6.1.1", | ||
"typescript": "^3.8.3", | ||
"typescript-tslint-plugin": "^0.5.5" | ||
"typescript": "^3.9.6" | ||
}, | ||
"dependencies": {} | ||
} |
@@ -9,7 +9,7 @@ ono (Oh No!) | ||
[![Build Status](https://github.com/JS-DevTools/ono/workflows/CI-CD/badge.svg)](https://github.com/JS-DevTools/ono/blob/master/.github/workflows/CI-CD.yaml) | ||
[![Build Status](https://github.com/JS-DevTools/ono/workflows/CI-CD/badge.svg)](https://github.com/JS-DevTools/ono/actions) | ||
[![Coverage Status](https://coveralls.io/repos/github/JS-DevTools/ono/badge.svg?branch=master)](https://coveralls.io/github/JS-DevTools/ono) | ||
[![Dependencies](https://david-dm.org/JS-DevTools/ono.svg)](https://david-dm.org/JS-DevTools/ono) | ||
[![OS and Browser Compatibility](https://jstools.dev/img/badges/ci-badges-with-ie.svg)](https://github.com/JS-DevTools/ono/blob/master/.github/workflows/CI-CD.yaml) | ||
[![OS and Browser Compatibility](https://jstools.dev/img/badges/ci-badges-with-ie.svg)](https://github.com/JS-DevTools/ono/actions) | ||
@@ -16,0 +16,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
105359
15
1462