Comparing version 1.0.3 to 1.0.4
@@ -7,28 +7,24 @@ #!/usr/bin/env node | ||
/** Build local filename from title of a Standard */ | ||
const buildLocalName = title => { | ||
const conversion = [ | ||
['IFRS ', '1'], | ||
['IAS ', '2'], | ||
['IFRIC ', '3'], | ||
['SIC-', '4'], | ||
]; | ||
return conversion.reduce((prev, [from, to]) => { | ||
const pf = title.match(new RegExp(`^${from}(\\d+) .*`)); | ||
return pf ? to + ('0' + pf[1]).slice(-2) + ' ' + title : prev; | ||
}, title) + '.pdf'; | ||
}; | ||
const buildLocalName = title => [ | ||
// Conversion table | ||
['IFRS ', '1'], | ||
['IAS ', '2'], | ||
['IFRIC ', '3'], | ||
['SIC-', '4'], | ||
].reduce((prev, [from, to]) => { | ||
const pf = title.match(new RegExp(`^${from}(\\d+) .*`)); | ||
return pf ? to + ('0' + pf[1]).slice(-2) + ' ' + title : prev; | ||
}, title) + '.pdf'; | ||
/** Build remote filename from title of a Standard */ | ||
const buildRemoteName = title => { | ||
const conversion = [ | ||
['IFRS ', 'IFRS'], | ||
['IAS ', 'IAS'], | ||
['IFRIC ', 'IFRIC'], | ||
['SIC-', 'SIC'], | ||
]; | ||
return conversion.reduce((prev, [from, to]) => { | ||
const pf = title.match(new RegExp(`^${from}(\\d+) .*`)); | ||
return pf ? to + pf[1] : prev; | ||
}, title) + '.pdf'; | ||
}; | ||
const buildRemoteName = title => [ | ||
// Conversion table | ||
['IFRS ', 'IFRS'], | ||
['IAS ', 'IAS'], | ||
['IFRIC ', 'IFRIC'], | ||
['SIC-', 'SIC'], | ||
].reduce((prev, [from, to]) => { | ||
const pf = title.match(new RegExp(`^${from}(\\d+) .*`)); | ||
return pf ? to + pf[1] : prev; | ||
}, title) + '.pdf'; | ||
@@ -35,0 +31,0 @@ const main = (baseUrl, titles, irregulars) => { |
{ | ||
"name": "curl_ifrs", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Utility to download latest unaccompanied IFRS using curl.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
27383
116