Zip codes which start with a "0" (zero) are incorrectly parsed and the leading zero is dropped from the result. E.g. 01234 becomes 1234 which is no longer a valid zip code.
I was also getting errors that I was missing an iphone7.yaml file until I stubbed one out even though I was not using the notify flag.
Cool script though! Nice job
~> find-iphone-7 --zip 07030 --model plus --color black --capacity 128 --carrier att
argv: { _: [],
zip: 7030,
model: 'plus',
color: 'black',
capacity: 128,
carrier: 'att',
'$0': '/usr/local/bin/find-iphone-7' }
⠹ Searching for iphones...
availability payload: { overlayInitiatedFromWarmStart: false,
viewMoreHoursLinkText: 'View more hours',
little: true,
errorMessage: 'Invalid Zip Code or City/State.',
location: '7030' }
TypeError: Cannot read property 'filter' of undefined
at axios.get.then (/usr/local/lib/node_modules/find-iphone-7/index.js:111:47)
at process._tickCallback (internal/process/next_tick.js:103:7)
⠧ Searching for iphones...⏎
~> find-iphone-7 --zip '07030' --model plus --color black --capacity 128 --carrier att
argv: { _: [],
zip: 7030,
model: 'plus',
color: 'black',
capacity: 128,
carrier: 'att',
'$0': '/usr/local/bin/find-iphone-7' }
⠙ Searching for iphones...
availability payload: { overlayInitiatedFromWarmStart: false,
viewMoreHoursLinkText: 'View more hours',
little: true,
errorMessage: 'Invalid Zip Code or City/State.',
location: '7030' }
TypeError: Cannot read property 'filter' of undefined
at axios.get.then (/usr/local/lib/node_modules/find-iphone-7/index.js:111:47)
at process._tickCallback (internal/process/next_tick.js:103:7)
⠦ Searching for iphones...^C⏎
~>
Above you can see two trials where I'm logging out the argv variable and the api response. Only difference between the two trials is the second wraps the zip arg in single quotes. Both incorrectly parse the zip code and the error returned from the API refers to the incorrect zip code.
Zip codes which start with a "0" (zero) are incorrectly parsed and the leading zero is dropped from the result. E.g. 01234 becomes 1234 which is no longer a valid zip code.
I was also getting errors that I was missing an iphone7.yaml file until I stubbed one out even though I was not using the notify flag.
Cool script though! Nice job
Above you can see two trials where I'm logging out the
argv
variable and the api response. Only difference between the two trials is the second wraps the zip arg in single quotes. Both incorrectly parse the zip code and the error returned from the API refers to the incorrect zip code.