@quenty/fzy 5.15.0 → 5.16.0
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/CHANGELOG.md +10 -0
- package/package.json +2 -2
- package/src/Shared/Fzy.lua +1 -1
- package/src/Shared/Fzy.spec.lua +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.16.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/fzy@5.15.1...@quenty/fzy@5.16.0) (2026-07-18)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- pin translation behavior with tests and fix camelCase key generation ([#737](https://github.com/Quenty/NevermoreEngine/issues/737)) ([1b7a536](https://github.com/Quenty/NevermoreEngine/commit/1b7a536dde7e124f8432e57612ec8138dd835d75))
|
|
11
|
+
|
|
12
|
+
## [5.15.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/fzy@5.15.0...@quenty/fzy@5.15.1) (2026-05-30)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @quenty/fzy
|
|
15
|
+
|
|
6
16
|
# [5.15.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/fzy@5.14.0...@quenty/fzy@5.15.0) (2026-05-29)
|
|
7
17
|
|
|
8
18
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/fzy",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.16.0",
|
|
4
4
|
"description": "Lua implementation of fzy string search algorithm",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "647acfad93dca41c38f59cda247d2bfc0fff36d4"
|
|
38
38
|
}
|
package/src/Shared/Fzy.lua
CHANGED
package/src/Shared/Fzy.spec.lua
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
--!
|
|
1
|
+
--!strict
|
|
2
2
|
--[[
|
|
3
3
|
Tests for fzy-lua
|
|
4
4
|
|
|
@@ -35,9 +35,7 @@ THE SOFTWARE.
|
|
|
35
35
|
|
|
36
36
|
local EPSILON = 0.000001
|
|
37
37
|
|
|
38
|
-
local require = (
|
|
39
|
-
game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent
|
|
40
|
-
).bootstrapStory(script) :: typeof(require(script.Parent.loader).load(script))
|
|
38
|
+
local require = require(script.Parent.loader).load(script)
|
|
41
39
|
|
|
42
40
|
local Fzy = require("Fzy")
|
|
43
41
|
local Jest = require("Jest")
|
|
@@ -49,7 +47,9 @@ local it = Jest.Globals.it
|
|
|
49
47
|
local MIN_SCORE = Fzy.getMinScore()
|
|
50
48
|
local MAX_SCORE = Fzy.getMaxScore()
|
|
51
49
|
|
|
52
|
-
|
|
50
|
+
-- Fzy.positions returns (positions, score); callers pass it as the second arg, so the
|
|
51
|
+
-- trailing score expands into this ignored third parameter.
|
|
52
|
+
local function compareTables(a: { [any]: any }, b: { [any]: any }, _score: any?)
|
|
53
53
|
for key, value in a do
|
|
54
54
|
if b[key] ~= value then
|
|
55
55
|
return false
|
|
@@ -221,7 +221,7 @@ describe("positioning", function()
|
|
|
221
221
|
expect(Fzy.score(config, longstring, longstring)).toBe(MIN_SCORE)
|
|
222
222
|
end)
|
|
223
223
|
it("is case-sensitive when requested", function()
|
|
224
|
-
expect(compareTables({ 2, 5 }, Fzy.positions(caseSensitiveConfig, "AB", "aAabBb", true))).toBe(true)
|
|
224
|
+
expect(compareTables({ 2, 5 }, (Fzy.positions :: any)(caseSensitiveConfig, "AB", "aAabBb", true))).toBe(true)
|
|
225
225
|
end)
|
|
226
226
|
it("returns the same score as `score()`", function()
|
|
227
227
|
local _, s = Fzy.positions(config, "ab", "aaabbb")
|
|
@@ -236,15 +236,15 @@ end)
|
|
|
236
236
|
describe("filtering", function()
|
|
237
237
|
it("repeats application of hasMatch and positions", function()
|
|
238
238
|
-- compare the result of `filter` with repeated calls to `positions`
|
|
239
|
-
local function check_filter(needle, haystacks, case)
|
|
240
|
-
local result = Fzy.filter(config, needle, haystacks, case)
|
|
239
|
+
local function check_filter(needle: string, haystacks: { string }, case: boolean?)
|
|
240
|
+
local result = (Fzy.filter :: any)(config, needle, haystacks, case)
|
|
241
241
|
local r = 0
|
|
242
242
|
for i, line in ipairs(haystacks) do
|
|
243
|
-
local match = Fzy.hasMatch(config, needle, line, case)
|
|
243
|
+
local match = (Fzy.hasMatch :: any)(config, needle, line, case)
|
|
244
244
|
if match then
|
|
245
245
|
r = r + 1
|
|
246
246
|
expect(i).toBe(result[r][1])
|
|
247
|
-
local p, s = Fzy.positions(config, needle, line, case)
|
|
247
|
+
local p, s = (Fzy.positions :: any)(config, needle, line, case)
|
|
248
248
|
expect(compareTables(p, result[r][2])).toBe(true)
|
|
249
249
|
expect(s).toBe(result[r][3])
|
|
250
250
|
end
|