fix(taSanitize): copy code to lib/factories.js (#424)