isdodd

function isdodd( e ) --> res

Description

The function name stands for "is dot or dot dot" and helps to keep your code small in cases where you want to detect the default hardlinks "." and "..".

Parameters

e

Dir entry value that should be checked.

Return Values

res

true if the entry value is "." or "..", otherwise false.

Code

--ZFUNC-isdodd-v1
local function isdodd( e ) --> res
   if e == "." or e == ".." then
      return true
   end

   return false
end

return isdodd

Examples

local t = require( "taptest" )
local isdodd = require( "isdodd" )

t( isdodd( "file.txt" ), false )
t( isdodd( ".hidden.txt" ), false )
t( isdodd( "." ), true )
t( isdodd( ".." ), true )

t()