Comparing version 1.0.8 to 1.0.9
@@ -28,3 +28,3 @@ const fs = require('fs'); | ||
self.db = self.fn(self.opts.xml); | ||
self.db = self.fn(); | ||
if (!fs.existsSync(self.db) || force) | ||
@@ -36,2 +36,3 @@ await self.zipExtract(fn, self.opts.xml, self.opts.path); | ||
fn: (url) => { | ||
if (!url) url = self.opts.xml; | ||
return self.opts.path + '/' + url.replace(/.*\//, ''); | ||
@@ -50,6 +51,8 @@ }, | ||
return new Promise((resolve, reject) => { | ||
z.on('error', reject); | ||
z.on('error', (err) => { | ||
reject(Object.assign(ret, {src: 'on', err})); | ||
}); | ||
z.on('ready', () => { | ||
z.extract(fn, dest, err => { | ||
if (err) reject(err); | ||
if (err) reject(Object.assign(ret, {src: 'ready', err})); | ||
resolve(dest + '/' + fn); | ||
@@ -56,0 +59,0 @@ z.close(); |
{ | ||
"name": "ofac", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "A module to facilitate local OFAC searches", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -109,7 +109,7 @@ [![npm version](https://badge.fury.io/js/ofac.svg)](https://badge.fury.io/js/ofac) | ||
Since the data set tends to be largish, rather than converting the XML into a DOM for in-memory | ||
* Since the data set tends to be largish, rather than converting the XML into a DOM for in-memory | ||
searches, the module searches the file. This takes a little longer (though it's actually pretty | ||
fast) but it's super-light on RAM | ||
Also, at present searching is limited to first-name/last-name and id/country, and operates only on | ||
* Also, at present searching is limited to first-name/last-name and id/country, and operates only on | ||
Individual data (skips corporations, vessels and other types of entities) but the database contains | ||
@@ -119,2 +119,5 @@ richer information. Anyone that wishes to match against other properties is welcome to write it, | ||
* The data currently retrieved is contained in the `SDN_XML.zip` listed on this page: | ||
https://www.treasury.gov/resource-center/sanctions/SDN-List/Pages/sdn_data.aspx | ||
## Testing | ||
@@ -121,0 +124,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26415
263
173