Skip to content

Releases: Legitcode/legible

0.2.11

12 Apr 22:33
Compare
Choose a tag to compare

fix for usage in node, where FormData is null

0.2.10

08 Mar 15:57
Compare
Choose a tag to compare

Block requests by returning false from a url function, heres the use case!

You can globally prevent duplicating requests within the same time period.

let lastUrl;

const onURL = url => {
  //block repeat requests within a second of each other
  if (url === lastUrl) return false;
  lastUrl = url;
  setTimeout(() => lastUrl = '', 1000);
  return url
};

let response = await partial`
  url: ${onURL}
`;

//request was made multiple times in a second, return false!
if(response.requestBlocked) return false

0.2.9

23 Feb 22:38
Compare
Choose a tag to compare

Cancel rest of request after headers are sent back, ex on a 401 redirect

await request`
  url: https://freegeoip.net/json/github.com
  onResponse: ${response => {
    expect(response.headers.get('content-type')).to.equal('application/json')
    return true
  }}
`

0.2.8

07 Feb 20:06
Compare
Choose a tag to compare

0.2.7

20 Jan 01:00
Compare
Choose a tag to compare

9b531fc

Support getting response headers

await request`
  url: https://freegeoip.net/json/github.com
  onResponse: ${response => {
    expect(response.headers.get('content-type')).to.equal('application/json')
  }}
`

0.2.6

10 Jan 14:59
Compare
Choose a tag to compare

01bda82
Fix bug when merging partial to empty HTTP method

119c307
fix bug merging body

74d4b7c

Header callback, allows you to do this:

let response = await partial`
  url: https://google.com
  headers: ${partial => {
    if(partial.options.method === 'POST') return {...headers, 'Content-Type': 'application/json' }
    return headers
  }}
`

0.2.2

06 Jan 16:01
Compare
Choose a tag to compare

0.2.1

06 Jan 14:22
Compare
Choose a tag to compare

0.2.0

23 Dec 19:42
Compare
Choose a tag to compare
0.2.0 Pre-release
Pre-release

adds #16

0.1.0

09 Dec 20:07
Compare
Choose a tag to compare
0.1.0 Pre-release
Pre-release

Better parsing #3