From e2ea9b7fc6bea62bebc9016ceba986d08be41230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LAURENS=20J=C3=A9r=C3=B4me?= Date: Tue, 4 Jun 2024 11:20:25 +0200 Subject: [PATCH] fix(docs): add 2 missing methods of Map.lua (#477) --- lua/pl/Map.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/pl/Map.lua b/lua/pl/Map.lua index 572b22ad..06fd0963 100644 --- a/lua/pl/Map.lua +++ b/lua/pl/Map.lua @@ -37,10 +37,14 @@ local function makelist(t) return setmetatable(t, require('pl.List')) end ---- list of keys. +--- return a List of all keys. +-- @class function +-- @name Map:keys Map.keys = tablex.keys ---- list of values. +--- return a List of all values. +-- @class function +-- @name Map:values Map.values = tablex.values --- return an iterator over all key-value pairs. @@ -48,7 +52,7 @@ function Map:iter () return pairs(self) end ---- return a List of all key-value pairs, sorted by the keys. +--- return a List of all key-value pairs, sorted by the keys in ascending order. function Map:items() local ls = makelist(tablex.pairmap (function (k,v) return makelist {k,v} end, self)) ls:sort(function(t1,t2) return t1[1] < t2[1] end)