Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure scalar examples are consistent #976

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions src/lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,16 @@ const QUOTE_TAG_REGEX = new RegExp(QUOTE_TAG, 'g')
const QUOTE_HTML = '"'
const QUOTE_HTML_REGEX = new RegExp(QUOTE_HTML, 'g')

// Map Scalar types to example data to use fro them
// Map Scalar types to example data to use for them
const SCALAR_TO_EXAMPLE = {
String: ['abc123', 'xyz789'],
Int: [123, 987],
Float: [123.45, 987.65],
String: 'abc123',
Int: 123,
Float: 123.45,
Boolean: [true, false],
Date: [
new Date(),
new Date(new Date().setMonth(new Date().getMonth() - 6).valueOf()),
].map((date) => date.toISOString()),
DateTime: [
new Date(),
new Date(new Date().setMonth(new Date().getMonth() - 6).valueOf()),
].map((date) => date.toISOString()),
Date: (new Date(0)).toISOString(),
DateTime: (new Date(0)).toISOString(),
JSON: SPECIAL_TAG + '{}' + SPECIAL_TAG,
ID: [4, '4'],
ID: '4',
}

function unwindTags(str) {
Expand Down
Loading