chore: Add objectParser for ObjectTypeAnnotation in Parse Server options (#9912)
This commit is contained in:
@@ -155,6 +155,8 @@ function mapperFor(elt, t) {
|
||||
return wrap(t.identifier('objectParser'));
|
||||
} else if (t.isBooleanTypeAnnotation(elt)) {
|
||||
return wrap(t.identifier('booleanParser'));
|
||||
} else if (t.isObjectTypeAnnotation(elt)) {
|
||||
return wrap(t.identifier('objectParser'));
|
||||
} else if (t.isGenericTypeAnnotation(elt)) {
|
||||
const type = elt.typeAnnotation.id.name;
|
||||
if (type == 'Adapter') {
|
||||
@@ -372,12 +374,18 @@ This code has been generated by resources/buildConfigDefinitions.js
|
||||
Do not edit manually, but update Options/index.js
|
||||
`;
|
||||
|
||||
const babel = require('@babel/core');
|
||||
const res = babel.transformFileSync('./src/Options/index.js', {
|
||||
plugins: [plugin, '@babel/transform-flow-strip-types'],
|
||||
babelrc: false,
|
||||
auxiliaryCommentBefore,
|
||||
sourceMaps: false,
|
||||
});
|
||||
require('fs').writeFileSync('./src/Options/Definitions.js', res.code + '\n');
|
||||
require('fs').writeFileSync('./src/Options/docs.js', docs);
|
||||
// Only run the transformation when executed directly, not when imported by tests
|
||||
if (require.main === module) {
|
||||
const babel = require('@babel/core');
|
||||
const res = babel.transformFileSync('./src/Options/index.js', {
|
||||
plugins: [plugin, '@babel/transform-flow-strip-types'],
|
||||
babelrc: false,
|
||||
auxiliaryCommentBefore,
|
||||
sourceMaps: false,
|
||||
});
|
||||
require('fs').writeFileSync('./src/Options/Definitions.js', res.code + '\n');
|
||||
require('fs').writeFileSync('./src/Options/docs.js', docs);
|
||||
}
|
||||
|
||||
// Export mapperFor for testing
|
||||
module.exports = { mapperFor };
|
||||
|
||||
Reference in New Issue
Block a user