Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import createSchemaBridge from 'uniforms/createSchemaBridge';
import JSONSchemaBridge from './JSONSchemaBridge';
// Register bridge.
createSchemaBridge.register(JSONSchemaBridge);
import createSchemaBridge from 'uniforms/createSchemaBridge';
import GraphQLBridge from './GraphQLBridge';
// Register bridge.
createSchemaBridge.register(GraphQLBridge);
import createSchemaBridge from 'uniforms/createSchemaBridge';
import filterDOMProps from 'uniforms/filterDOMProps';
// @ts-ignore
import { Match } from 'meteor/check'; // eslint-disable-line
// @ts-ignore
import { SimpleSchema } from 'meteor/aldeed:simple-schema'; // eslint-disable-line
import SimpleSchemaBridge from './SimpleSchemaBridge';
// Register bridge.
createSchemaBridge.register(SimpleSchemaBridge);
// Register custom property.
SimpleSchema.extendOptions({
uniforms: Match.Optional(
Match.OneOf(
String,
Function,
Match.ObjectIncluding({
component: Match.Optional(Match.OneOf(String, Function))
})
)
)
});
// There's no possibility to retrieve them at runtime
filterDOMProps.register(
import SimpleSchema from 'simpl-schema';
import createSchemaBridge from 'uniforms/createSchemaBridge';
import filterDOMProps from 'uniforms/filterDOMProps';
import SimpleSchema2Bridge from './SimpleSchema2Bridge';
// Register bridge.
createSchemaBridge.register(SimpleSchema2Bridge);
// Register custom property.
SimpleSchema.extendOptions(['uniforms']);
// There's no possibility to retrieve them at runtime
filterDOMProps.register(
'allowedValues',
'autoValue',
'blackbox',
'custom',
'decimal',
'defaultValue',
'exclusiveMax',
'exclusiveMin',
'label',
'max',
it('recognizes a registered bridge', () => {
class TestSchema {}
class TestSchemaBridge extends Bridge {
static check(schema: any) {
return schema instanceof TestSchema;
}
}
createSchemaBridge.register(TestSchemaBridge);
expect(createSchemaBridge(new TestSchema())).toBeInstanceOf(
TestSchemaBridge
);
});