Skip to content

Commit

Permalink
feat(pacer): Tweaks parseGoDLSFunction to handle new param
Browse files Browse the repository at this point in the history
  • Loading branch information
ERosendo committed Sep 19, 2024
1 parent 009217f commit 00c86c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions spec/PacerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ describe('The PACER module', function () {
});

describe('getDocumentIdFronForm', function () {
const goDLS = "goDLS('/doc1/09518360046','153992','264','','','1','','');";
const goDLS = "goDLS('/doc1/09518360046','153992','264','','','1','','','','');";
let form;
beforeEach(function () {
form = document.createElement('form');
Expand Down Expand Up @@ -477,7 +477,7 @@ describe('The PACER module', function () {
});

describe('getCaseNumberFromInputs', function () {
const goDLS = "goDLS('/doc1/09518360046','153992','264','','','1','','');";
const goDLS = "goDLS('/doc1/09518360046','153992','264','','','1','','','');";
const input = document.createElement('input');

beforeEach(function () {
Expand Down Expand Up @@ -516,7 +516,7 @@ describe('The PACER module', function () {

describe('parseGoDLSFunction', function () {
it('gets the right values for an example DLS string', function () {
let goDLSSampleString = "goDLS('/doc1/09518360046','153992','264','','','1','',''); " + 'return(false);';
let goDLSSampleString = "goDLS('/doc1/09518360046','153992','264','','','1','','',''); " + 'return(false);';
expect(PACER.parseGoDLSFunction(goDLSSampleString)).toEqual({
hyperlink: '/doc1/09518360046',
de_caseid: '153992',
Expand All @@ -526,6 +526,7 @@ describe('The PACER module', function () {
pdf_toggle_possible: '1',
magic_num: '',
hdr: '',
psf_report: '',
});
});

Expand Down
8 changes: 4 additions & 4 deletions src/pacer.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,9 @@ let PACER = {
// https://ecf.flnd.uscourts.gov/lib/dls_url.js
// as:
// function goDLS(hyperlink, de_caseid, de_seqno, got_receipt,
// pdf_header, pdf_toggle_possible, magic_num, hdr)
// pdf_header, pdf_toggle_possible, magic_num, hdr, psf_report)
//
// Bankruptcy courts provide ten parameters, instead of eight. These can
// Bankruptcy courts provide ten parameters, instead of nine. These can
// be found in unminified js:
// https://ecf.paeb.uscourts.gov/lib/dls_url.js
// as:
Expand All @@ -548,15 +548,15 @@ let PACER = {
// Δ:
// - hdr
// + claim_id, claim_num, claim_doc_seq
let goDlsDistrict = /^goDLS\('([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)'\)/.exec(goDLS_string);
let goDlsDistrict = /^goDLS\('([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)'\)/.exec(goDLS_string);
let goDlsBankr= /^goDLS\('([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)'\)/.exec(goDLS_string);
if (!goDlsDistrict && !goDlsBankr) {
return null;
}
let r = {};
if (goDlsDistrict){
[, r.hyperlink, r.de_caseid, r.de_seqno, r.got_receipt, r.pdf_header,
r.pdf_toggle_possible, r.magic_num, r.hdr] = goDlsDistrict;
r.pdf_toggle_possible, r.magic_num, r.hdr, r.psf_report] = goDlsDistrict;
} else {
[, r.hyperlink, r.de_caseid, r.de_seqno, r.got_receipt, r.pdf_header,
r.pdf_toggle_possible, r.magic_num, r.claim_id, r.claim_num,
Expand Down

0 comments on commit 00c86c9

Please sign in to comment.