Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-amplify/amplify-prompts

Package Overview
Dependencies
Maintainers
10
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-amplify/amplify-prompts - npm Package Compare versions

Comparing version 2.8.1-rds.0 to 2.8.1

2

CHANGELOG.md

@@ -6,3 +6,3 @@ # Change Log

## [2.8.1-rds.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-prompts@2.8.0...@aws-amplify/amplify-prompts@2.8.1-rds.0) (2023-08-08)
## [2.8.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-prompts@2.8.0...@aws-amplify/amplify-prompts@2.8.1) (2023-08-09)

@@ -9,0 +9,0 @@ **Note:** Version bump only for package @aws-amplify/amplify-prompts

{
"name": "@aws-amplify/amplify-prompts",
"version": "2.8.1-rds.0",
"version": "2.8.1",
"description": "Utility functions for Amplify CLI terminal I/O",

@@ -67,3 +67,3 @@ "main": "lib/index.js",

},
"gitHead": "fc72c0617e3211ac944462ed5747ae5d1f38e257"
"gitHead": "de71c6a620878c77785331549e1478f22fad03d1"
}

@@ -98,3 +98,3 @@ import { prompt } from 'enquirer';

promptMock.mockResolvedValueOnce({ result: promptResponse });
expect(await prompter.input('test message', { transform: () => transformedValue })).toEqual(transformedValue);
expect(await prompter.input('test message', { transform: (_) => transformedValue })).toEqual(transformedValue);
});

@@ -101,0 +101,0 @@

@@ -7,3 +7,3 @@ import { Stopwatch } from '../stopwatch';

stopwatch.start();
await new Promise((resolve) => {
await new Promise((resolve, __reject) => {
setTimeout(resolve, 300);

@@ -15,3 +15,3 @@ });

stopwatch.start();
await new Promise((resolve) => {
await new Promise((resolve, __reject) => {
setTimeout(resolve, 300);

@@ -18,0 +18,0 @@ });

@@ -69,13 +69,15 @@ import { alphanumeric, and, integer, maxLength, minLength, not, or, matchRegex } from '../validators';

it('returns true if all validators return true', async () => {
expect(await and([() => true, () => true])('anything')).toBe(true);
expect(await and([(input) => true, (input) => true])('anything')).toBe(true);
});
it('returns first error message', async () => {
expect(await and([() => true, () => 'first error', () => 'second error'])('anything')).toMatchInlineSnapshot(`"first error"`);
expect(await and([(input) => true, (input) => 'first error', (input) => 'second error'])('anything')).toMatchInlineSnapshot(
`"first error"`,
);
});
it('returns override message if any validators return error message', async () => {
expect(await and([() => true, () => 'first error', () => 'second error'], 'custom error message')('anything')).toMatchInlineSnapshot(
`"custom error message"`,
);
expect(
await and([(input) => true, (input) => 'first error', (input) => 'second error'], 'custom error message')('anything'),
).toMatchInlineSnapshot(`"custom error message"`);
});

@@ -86,11 +88,13 @@ });

it('returns true if one validator returns true', async () => {
expect(await or([() => 'first error', () => true])('anything')).toBe(true);
expect(await or([(input) => 'first error', (input) => true])('anything')).toBe(true);
});
it('returns last error message if all validators return error', async () => {
expect(await or([() => 'first error', () => 'second error'])('anything')).toMatchInlineSnapshot(`"second error"`);
expect(await or([(input) => 'first error', (input) => 'second error'])('anything')).toMatchInlineSnapshot(`"second error"`);
});
it('returns override error mmessage if all validators return error', async () => {
expect(await or([() => 'first error', () => 'second error'], 'custom message')('anything')).toMatchInlineSnapshot(`"custom message"`);
expect(await or([(input) => 'first error', (input) => 'second error'], 'custom message')('anything')).toMatchInlineSnapshot(
`"custom message"`,
);
});

@@ -101,7 +105,7 @@ });

it('returns error message if validator returns true', async () => {
expect(await not(() => true, 'custom error message')('anything')).toMatchInlineSnapshot(`"custom error message"`);
expect(await not((input) => true, 'custom error message')('anything')).toMatchInlineSnapshot(`"custom error message"`);
});
it('returns true when validator returns error message', async () => {
expect(await not(() => 'error message', 'other message')('anything')).toBe(true);
expect(await not((input) => 'error message', 'other message')('anything')).toBe(true);
});

@@ -108,0 +112,0 @@ });

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc