ctx-core 5.36.1 → 5.36.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,17 +30,6 @@ export class TextDecoderStream extends TransformStream {
30
30
  controller.enqueue(decoded)
31
31
  }
32
32
  },
33
- flush(controller) {
34
- // If {fatal: false} is in options (the default), then the final call to
35
- // decode() can produce extra output (usually the unicode replacement
36
- // character 0xFFFD). When fatal is true, this call is just used for its
37
- // side-effect of throwing a TypeError exception if the input is
38
- // incomplete.
39
- const output = decoder.decode()
40
- if (output.length > 0) {
41
- controller.enqueue(output)
42
- }
43
- }
44
33
  })
45
34
  this.encoding = encoding
46
35
  this.fatal = fatal
@@ -23,17 +23,6 @@ export class TextEncoderStream extends TransformStream {
23
23
  controller.enqueue(encoded)
24
24
  }
25
25
  },
26
- flush(controller) {
27
- // If {fatal: false} is in options (the default), then the final call to
28
- // decode() can produce extra output (usually the unicode replacement
29
- // character 0xFFFD). When fatal is true, this call is just used for its
30
- // side-effect of throwing a TypeError exception if the input is
31
- // incomplete.
32
- const output = decoder.encode()
33
- if (output.length > 0) {
34
- controller.enqueue(output)
35
- }
36
- }
37
26
  })
38
27
  }
39
28
  }
@@ -9,16 +9,14 @@ export function url__join(...url_segment_a) {
9
9
  for (let url_segment of url_segment_a.flat(Infinity)) {
10
10
  let url_segment_str = '' + url_segment
11
11
  url += (
12
- ~[
13
- '/',
14
- '?',
15
- '&'
16
- ].indexOf(url_segment_str[0])
17
- || (!url && url_segment_str.includes('://'))
18
- ? url_segment_str
19
- : in_query
20
- ? '&' + url_segment_str
21
- : '/' + url_segment_str
12
+ url_segment_str[0] === '/' && url.slice(-1) === '/'
13
+ ? url_segment_str.slice(1)
14
+ : ~['/', '?', '&'].indexOf(url_segment_str[0])
15
+ || (!url && url_segment_str.includes('://'))
16
+ ? url_segment_str
17
+ : in_query
18
+ ? '&' + url_segment_str
19
+ : '/' + url_segment_str
22
20
  )
23
21
  if (url_segment_str.includes('?')) in_query = 1
24
22
  }
@@ -23,5 +23,8 @@ test('url__join', ()=>{
23
23
  equal(
24
24
  url__join(['http://localhost/foo/bar/baz?id=1', [['something=else']]]),
25
25
  'http://localhost/foo/bar/baz?id=1&something=else')
26
+ equal(
27
+ url__join(['http://localhost/', '/foo/bar/baz?id=1', 'something=else']),
28
+ 'http://localhost/foo/bar/baz?id=1&something=else')
26
29
  })
27
30
  test.run()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ctx-core",
3
- "version": "5.36.1",
3
+ "version": "5.36.3",
4
4
  "description": "ctx-core core library",
5
5
  "keywords": [
6
6
  "ctx-core",