Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Element.prototype.matches polyfill
if (Element && !Element.prototype.matches) {
let proto = Element.prototype as any;
proto.matches = proto.matchesSelector ||
proto.mozMatchesSelector || proto.msMatchesSelector ||
proto.oMatchesSelector || proto.webkitMatchesSelector;
}
import * as embed from './embed-manager';
import * as _ from 'underscore';
import { WidgetModel } from 'jupyter-js-widgets';
// Load json schema validator
var Ajv = require('ajv');
var widget_state_schema = require('jupyter-widgets-schema').v2.state;
var widget_view_schema = require('jupyter-widgets-schema').v2.view;
// BEGIN: Ajv config for json-schema draft 4, from https://github.com/epoberezkin/ajv/releases/tag/5.0.0
// This can be deleted when the schema is moved to draft 6
var ajv = new Ajv({
meta: false, // optional, to prevent adding draft-06 meta-schema
extendRefs: true, // optional, current default is to 'fail', spec behaviour is to 'ignore'
unknownFormats: 'ignore', // optional, current default is true (fail)
// ...
});
var metaSchema = require('ajv/lib/refs/json-schema-draft-04.json');
ajv.addMetaSchema(metaSchema);
ajv._opts.defaultMeta = metaSchema.id;
// optional, using unversioned URI is out of spec, see https://github.com/json-schema-org/json-schema-spec/issues/216
ajv._refs['http://json-schema.org/schema'] = 'http://json-schema.org/draft-04/schema';
// Element.prototype.matches polyfill
if (Element && !Element.prototype.matches) {
let proto = Element.prototype as any;
proto.matches = proto.matchesSelector ||
proto.mozMatchesSelector || proto.msMatchesSelector ||
proto.oMatchesSelector || proto.webkitMatchesSelector;
}
import * as embed from './embed-manager';
import * as _ from 'underscore';
import { WidgetModel } from 'jupyter-js-widgets';
// Load json schema validator
var Ajv = require('ajv');
var widget_state_schema = require('jupyter-widgets-schema').v2.state;
var widget_view_schema = require('jupyter-widgets-schema').v2.view;
// BEGIN: Ajv config for json-schema draft 4, from https://github.com/epoberezkin/ajv/releases/tag/5.0.0
// This can be deleted when the schema is moved to draft 6
var ajv = new Ajv({
meta: false, // optional, to prevent adding draft-06 meta-schema
extendRefs: true, // optional, current default is to 'fail', spec behaviour is to 'ignore'
unknownFormats: 'ignore', // optional, current default is true (fail)
// ...
});
var metaSchema = require('ajv/lib/refs/json-schema-draft-04.json');
ajv.addMetaSchema(metaSchema);
ajv._opts.defaultMeta = metaSchema.id;
// optional, using unversioned URI is out of spec, see https://github.com/json-schema-org/json-schema-spec/issues/216