@nangohq/nango-yaml
Advanced tools
Comparing version 0.40.1 to 0.40.2
@@ -153,3 +153,3 @@ import { getNativeDataType, getPotentialTypeAlias, isDisallowedType, shouldQuote } from './helpers.js'; | ||
if (isModel) { | ||
parsed.push({ name, value, model: true, optional }); | ||
parsed.push({ name, value: valueClean, model: true, optional, array: isArray }); | ||
continue; | ||
@@ -156,0 +156,0 @@ } |
@@ -155,3 +155,3 @@ import { expect, describe, it } from 'vitest'; | ||
{ name: '0', value: 'string', tsType: true, array: false, optional: false }, | ||
{ name: '1', value: 'User', model: true, optional: false } | ||
{ name: '1', value: 'User', model: true, optional: false, array: false } | ||
] | ||
@@ -188,3 +188,3 @@ } | ||
it('should handle union with Model, ts types and data types', () => { | ||
const parser = new ModelsParser({ raw: { Test: { user: 'true | literal | GithubIssue | boolean[]' }, GithubIssue: { id: 'string' } } }); | ||
const parser = new ModelsParser({ raw: { Test: { user: 'true | literal | GithubIssue[] | boolean[]' }, GithubIssue: { id: 'string' } } }); | ||
parser.parseAll(); | ||
@@ -203,3 +203,3 @@ expect(parser.errors).toStrictEqual([]); | ||
{ name: '1', value: 'literal', array: false, optional: false }, | ||
{ name: '2', value: 'GithubIssue', model: true, optional: false }, | ||
{ name: '2', value: 'GithubIssue', model: true, optional: false, array: true }, | ||
{ name: '3', value: 'boolean', tsType: true, array: true, optional: false } | ||
@@ -302,3 +302,3 @@ ], | ||
User: { name: 'User', fields: [{ name: 'id', value: 'string', tsType: true, array: false, optional: false }] }, | ||
Test: { name: 'Test', fields: [{ name: 'user', value: 'User', model: true, optional: false }] } | ||
Test: { name: 'Test', fields: [{ name: 'user', value: 'User', model: true, optional: false, array: false }] } | ||
}); | ||
@@ -311,3 +311,3 @@ expect(parser.warnings).toStrictEqual([]); | ||
expect(Object.fromEntries(parser.parsed)).toStrictEqual({ | ||
Test: { name: 'Test', fields: [{ name: 'user', value: 'User', model: true, optional: false }] }, | ||
Test: { name: 'Test', fields: [{ name: 'user', value: 'User', model: true, optional: false, array: false }] }, | ||
User: { name: 'User', fields: [{ name: 'id', value: 'string', tsType: true, array: false, optional: false }] } | ||
@@ -331,3 +331,3 @@ }); | ||
expect(Object.fromEntries(parser.parsed)).toStrictEqual({ | ||
Test: { name: 'Test', fields: [{ name: 'user', value: 'Test', model: true, optional: false }] } | ||
Test: { name: 'Test', fields: [{ name: 'user', value: 'Test', model: true, optional: false, array: false }] } | ||
}); | ||
@@ -340,3 +340,6 @@ }); | ||
expect(Object.fromEntries(parser.parsed)).toStrictEqual({ | ||
Test: { name: 'Test', fields: [{ name: 'user', optional: false, value: [{ name: 'author', value: 'Test', model: true, optional: false }] }] } | ||
Test: { | ||
name: 'Test', | ||
fields: [{ name: 'user', optional: false, value: [{ name: 'author', value: 'Test', model: true, optional: false, array: false }] }] | ||
} | ||
}); | ||
@@ -351,3 +354,3 @@ }); | ||
name: 'Test', | ||
fields: [{ name: 'user', optional: false, array: true, value: [{ name: '0', value: 'Test', model: true, optional: false }] }] | ||
fields: [{ name: 'user', optional: false, array: true, value: [{ name: '0', value: 'Test', model: true, optional: false, array: false }] }] | ||
} | ||
@@ -354,0 +357,0 @@ }); |
{ | ||
"name": "@nangohq/nango-yaml", | ||
"version": "0.40.1", | ||
"version": "0.40.2", | ||
"type": "module", | ||
@@ -16,7 +16,7 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"ms": "3.0.0-canary.1", | ||
"js-yaml": "^4.1.0" | ||
"js-yaml": "^4.1.0", | ||
"ms": "3.0.0-canary.1" | ||
}, | ||
"devDependencies": { | ||
"@nangohq/types": "^0.40.1", | ||
"@nangohq/types": "^0.40.2", | ||
"vitest": "0.33.0" | ||
@@ -23,0 +23,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
147428
1795
1