@noita-ts/pollnet 0.5.2 → 0.5.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.
package/dist/index.lua CHANGED
@@ -7,8 +7,9 @@ local SyntaxError = ____lualib.SyntaxError
7
7
  local TypeError = ____lualib.TypeError
8
8
  local URIError = ____lualib.URIError
9
9
  local __TS__New = ____lualib.__TS__New
10
- local __TS__StringSplit = ____lualib.__TS__StringSplit
10
+ local __TS__StringSlice = ____lualib.__TS__StringSlice
11
11
  local __TS__ArrayIsArray = ____lualib.__TS__ArrayIsArray
12
+ local __TS__StringSplit = ____lualib.__TS__StringSplit
12
13
  local ____exports = {}
13
14
  local ____api = require("api")
14
15
  local pollnet = ____api.default
@@ -36,12 +37,10 @@ function HttpResponse.prototype.parseHeaders(self)
36
37
  local headers = {}
37
38
  for ____, line in ipairs(__TS__StringSplit(self.headers, "\n")) do
38
39
  do
39
- local key, value = unpack(
40
- __TS__StringSplit(line, ": ", 2),
41
- 1,
42
- 2
43
- )
44
- if not key or not value then
40
+ local sep = (string.find(line, ": ", nil, true) or 0) - 1
41
+ local key = __TS__StringSlice(line, 0, sep)
42
+ local value = __TS__StringSlice(line, sep + 2)
43
+ if sep <= 0 or not value then
45
44
  goto __continue6
46
45
  end
47
46
  local prev = headers[key]
@@ -131,6 +131,26 @@ do
131
131
  URIError = createErrorClass(nil, "URIError")
132
132
  end
133
133
 
134
+ local function __TS__StringSlice(self, start, ____end)
135
+ if start == nil or start ~= start then
136
+ start = 0
137
+ end
138
+ if ____end ~= ____end then
139
+ ____end = 0
140
+ end
141
+ if start >= 0 then
142
+ start = start + 1
143
+ end
144
+ if ____end ~= nil and ____end < 0 then
145
+ ____end = ____end - 1
146
+ end
147
+ return string.sub(self, start, ____end)
148
+ end
149
+
150
+ local function __TS__ArrayIsArray(value)
151
+ return type(value) == "table" and (value[1] ~= nil or next(value) == nil)
152
+ end
153
+
134
154
  local __TS__StringSplit
135
155
  do
136
156
  local sub = string.sub
@@ -168,10 +188,6 @@ do
168
188
  end
169
189
  end
170
190
 
171
- local function __TS__ArrayIsArray(value)
172
- return type(value) == "table" and (value[1] ~= nil or next(value) == nil)
173
- end
174
-
175
191
  return {
176
192
  __TS__Class = __TS__Class,
177
193
  Error = Error,
@@ -181,6 +197,7 @@ return {
181
197
  TypeError = TypeError,
182
198
  URIError = URIError,
183
199
  __TS__New = __TS__New,
184
- __TS__StringSplit = __TS__StringSplit,
185
- __TS__ArrayIsArray = __TS__ArrayIsArray
200
+ __TS__StringSlice = __TS__StringSlice,
201
+ __TS__ArrayIsArray = __TS__ArrayIsArray,
202
+ __TS__StringSplit = __TS__StringSplit
186
203
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noita-ts/pollnet",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "files": [
5
5
  "dist/**/*.{lua,dll,d.ts}",
6
6
  "LICENSE-pollnet"
@@ -19,11 +19,11 @@
19
19
  }
20
20
  },
21
21
  "scripts": {
22
- "build": "tstl -p . && cp *.{lua,d.ts,dll} dist/",
22
+ "build": "tstl -p . && cp src/*.{lua,d.ts} pollnet.dll dist/",
23
23
  "prepublishOnly": "rm -rf dist && npm run build"
24
24
  },
25
25
  "dependencies": {
26
- "@noita-ts/ffi": "^0.6.3",
26
+ "@noita-ts/ffi": "^0.7.0",
27
27
  "@typescript-to-lua/language-extensions": "^1.19.0",
28
28
  "lua-types": "^2.13.1"
29
29
  },