refactor: drop unused debug logs
This commit is contained in:
parent
4ead3dc4bf
commit
8660f00257
2 changed files with 1 additions and 12 deletions
|
|
@ -6,8 +6,6 @@ const nameUtils = require('./name-utils')
|
|||
const _ = require('lodash/fp')
|
||||
const logger = require('../logger')
|
||||
|
||||
const debugLog = require('../pp')(__filename) // KOSTIS TODO: remove
|
||||
|
||||
const OFAC_DATA_DIR = process.env.OFAC_DATA_DIR
|
||||
|
||||
let structs = null
|
||||
|
|
@ -40,8 +38,6 @@ function makeCompatible (nameParts) {
|
|||
}
|
||||
|
||||
function match (nameParts, birthDateString, options) {
|
||||
const {debug} = options
|
||||
|
||||
if (!structs) {
|
||||
logger.error(new Error('The OFAC data sources have not been loaded yet.'))
|
||||
return false
|
||||
|
|
@ -66,10 +62,7 @@ function match (nameParts, birthDateString, options) {
|
|||
])(birthDateString)
|
||||
|
||||
const candidate = {parts, fullName, words, birthDate}
|
||||
debug && debugLog(candidate)
|
||||
|
||||
const result = matcher.match(structs, candidate, options)
|
||||
debug && debugLog(result)
|
||||
return result
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
const jaro = require('talisman/metrics/distance/jaro')
|
||||
const _ = require('lodash/fp')
|
||||
|
||||
const debugLog = require('../pp')(__filename) // KOSTIS TODO: remove
|
||||
const logger = require('../logger')
|
||||
|
||||
const stringSimilarity = _.curry(jaro)
|
||||
|
|
@ -30,7 +29,7 @@ const isBornTooLongSince = _.curry((days, dateObject, individual) => {
|
|||
// algorithm
|
||||
|
||||
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
|
||||
|
||||
// Accept aliases who's full name matches.
|
||||
|
|
@ -90,9 +89,6 @@ function match (structs, candidate, options) {
|
|||
_.map(_.first)
|
||||
)(matches)
|
||||
|
||||
debug && debugLog(aliasIdsFromFullName)
|
||||
debug && debugLog(aliasIdsFromNamePart)
|
||||
|
||||
// Get the full record for each matched id
|
||||
const getIndividual = aliasId => {
|
||||
const individualId = structs.aliasToIndividual.get(aliasId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue