Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
instanceId: settings.instanceId
};
// Completely disable calculations in Enketo Core
import calcModule from 'enketo-core/src/js/calculate';
calcModule.update = () => {
console.log( 'Calculations disabled.' );
};
// Completely disable instanceID and deprecatedID population in Enketo Core
import { FormModel } from 'enketo-core/src/js/form-model';
FormModel.prototype.setInstanceIdAndDeprecatedId = () => {
console.log( 'InstanceID and deprecatedID population disabled.' );
};
// Completely disable preload items
import preloadModule from 'enketo-core/src/js/preload';
preloadModule.init = () => {
console.log( 'Preloaders disabled.' );
};
initTranslator( survey )
.then( survey => connection.getFormParts( survey ) )
.then( formParts => {
if ( survey.instanceId ) {
return connection.getExistingInstance( survey )
.then( response => {
formParts.instance = response.instance;
formParts.instanceAttachments = response.instanceAttachments;
return formParts;
} );
}
return formParts;
} )