refactor: drop unused debug logs

This commit is contained in:
siiky 2024-06-28 15:58:59 +01:00
parent 4ead3dc4bf
commit 8660f00257
2 changed files with 1 additions and 12 deletions

View file

@ -6,8 +6,6 @@ const nameUtils = require('./name-utils')
const _ = require('lodash/fp') const _ = require('lodash/fp')
const logger = require('../logger') const logger = require('../logger')
const debugLog = require('../pp')(__filename) // KOSTIS TODO: remove
const OFAC_DATA_DIR = process.env.OFAC_DATA_DIR const OFAC_DATA_DIR = process.env.OFAC_DATA_DIR
let structs = null let structs = null
@ -40,8 +38,6 @@ function makeCompatible (nameParts) {
} }
function match (nameParts, birthDateString, options) { function match (nameParts, birthDateString, options) {
const {debug} = options
if (!structs) { if (!structs) {
logger.error(new Error('The OFAC data sources have not been loaded yet.')) logger.error(new Error('The OFAC data sources have not been loaded yet.'))
return false return false
@ -66,10 +62,7 @@ function match (nameParts, birthDateString, options) {
])(birthDateString) ])(birthDateString)
const candidate = {parts, fullName, words, birthDate} const candidate = {parts, fullName, words, birthDate}
debug && debugLog(candidate)
const result = matcher.match(structs, candidate, options) const result = matcher.match(structs, candidate, options)
debug && debugLog(result)
return result return result
} }

View file

@ -1,7 +1,6 @@
const jaro = require('talisman/metrics/distance/jaro') const jaro = require('talisman/metrics/distance/jaro')
const _ = require('lodash/fp') const _ = require('lodash/fp')
const debugLog = require('../pp')(__filename) // KOSTIS TODO: remove
const logger = require('../logger') const logger = require('../logger')
const stringSimilarity = _.curry(jaro) const stringSimilarity = _.curry(jaro)
@ -30,7 +29,7 @@ const isBornTooLongSince = _.curry((days, dateObject, individual) => {
// algorithm // algorithm
function match (structs, candidate, options) { function match (structs, candidate, options) {
const {threshold, fullNameThreshold, ratio = 0.5, debug, verboseFor} = options const {threshold, fullNameThreshold, ratio = 0.5, verboseFor} = options
const {fullName, words, birthDate} = candidate const {fullName, words, birthDate} = candidate
// Accept aliases who's full name matches. // Accept aliases who's full name matches.
@ -90,9 +89,6 @@ function match (structs, candidate, options) {
_.map(_.first) _.map(_.first)
)(matches) )(matches)
debug && debugLog(aliasIdsFromFullName)
debug && debugLog(aliasIdsFromNamePart)
// Get the full record for each matched id // Get the full record for each matched id
const getIndividual = aliasId => { const getIndividual = aliasId => {
const individualId = structs.aliasToIndividual.get(aliasId) const individualId = structs.aliasToIndividual.get(aliasId)