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( "tapered" )
local isdodd = require( "isdodd" )

t.nok( isdodd( "file.txt" ) )
t.nok( isdodd( ".hidden.txt" ) )
t.ok( isdodd( "." ) )
t.ok( isdodd( ".." ) )

t.done()