Socket
Socket
Sign inDemoInstall

jest-validate

Package Overview
Dependencies
22
Maintainers
6
Versions
216
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 27.5.1 to 28.0.0-alpha.0

89

build/index.d.ts

@@ -7,6 +7,85 @@ /**

*/
export { ValidationError, createDidYouMeanMessage, format, logValidationWarning, } from './utils';
export type { DeprecatedOptions } from './types';
export { default as validate } from './validate';
export { default as validateCLIOptions } from './validateCLIOptions';
export { multipleValidOptions } from './condition';
import type {Config} from '@jest/types';
import type {Options} from 'yargs';
export declare const createDidYouMeanMessage: (
unrecognized: string,
allowedOptions: Array<string>,
) => string;
declare type DeprecatedOptionFunc = (arg: Record<string, unknown>) => string;
export declare type DeprecatedOptions = Record<string, DeprecatedOptionFunc>;
export declare const format: (value: unknown) => string;
export declare const logValidationWarning: (
name: string,
message: string,
comment?: string | null | undefined,
) => void;
export declare function multipleValidOptions<T extends Array<unknown>>(
...args: T
): T[number];
declare type Title = {
deprecation?: string;
error?: string;
warning?: string;
};
export declare const validate: (
config: Record<string, unknown>,
options: ValidationOptions,
) => {
hasDeprecationWarnings: boolean;
isValid: boolean;
};
export declare function validateCLIOptions(
argv: Config.Argv,
options: {
deprecationEntries: DeprecatedOptions;
[s: string]: Options;
},
rawArgv?: Array<string>,
): boolean;
export declare class ValidationError extends Error {
name: string;
message: string;
constructor(name: string, message: string, comment?: string | null);
}
declare type ValidationOptions = {
comment?: string;
condition?: (option: unknown, validOption: unknown) => boolean;
deprecate?: (
config: Record<string, unknown>,
option: string,
deprecatedOptions: DeprecatedOptions,
options: ValidationOptions,
) => boolean;
deprecatedConfig?: DeprecatedOptions;
error?: (
option: string,
received: unknown,
defaultValue: unknown,
options: ValidationOptions,
path?: Array<string>,
) => void;
exampleConfig: Record<string, unknown>;
recursive?: boolean;
recursiveDenylist?: Array<string>;
title?: Title;
unknown?: (
config: Record<string, unknown>,
exampleConfig: Record<string, unknown>,
option: string,
options: ValidationOptions,
path?: Array<string>,
) => void;
};
export {};

28

build/utils.js

@@ -50,16 +50,8 @@ 'use strict';

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return 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.
*/
const BULLET = _chalk().default.bold('\u25cf');

@@ -91,9 +83,7 @@

class ValidationError extends Error {
name;
message;
constructor(name, message, comment) {
super();
_defineProperty(this, 'name', void 0);
_defineProperty(this, 'message', void 0);
comment = comment ? '\n\n' + comment : '\n';

@@ -100,0 +90,0 @@ this.name = '';

{
"name": "jest-validate",
"version": "27.5.1",
"version": "28.0.0-alpha.0",
"repository": {

@@ -20,14 +20,14 @@ "type": "git",

"dependencies": {
"@jest/types": "^27.5.1",
"@jest/types": "^28.0.0-alpha.0",
"camelcase": "^6.2.0",
"chalk": "^4.0.0",
"jest-get-type": "^27.5.1",
"jest-get-type": "^28.0.0-alpha.0",
"leven": "^3.1.0",
"pretty-format": "^27.5.1"
"pretty-format": "^28.0.0-alpha.0"
},
"devDependencies": {
"@types/yargs": "^16.0.0"
"@types/yargs": "^17.0.8"
},
"engines": {
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
"node": "^12.13.0 || ^14.15.0 || ^16.13.0 || >=17.0.0"
},

@@ -37,3 +37,3 @@ "publishConfig": {

},
"gitHead": "67c1aa20c5fec31366d733e901fee2b981cb1850"
"gitHead": "89275b08977065d98e42ad71fcf223f4ad169f09"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc