Skip to content

Commit

Permalink
Adding more examples for comparing table literals
Browse files Browse the repository at this point in the history
  • Loading branch information
benwilber committed May 19, 2024
1 parent 5e475c1 commit 388ac63
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ assert(not is_valid) -- false

local is_valid = valid.literal("abc", {icase = true})("ABC")
assert(is_valid) -- true

local price_table = {price = 1.00}

local is_valid = valid.literal(price_table)({price = 1.00})
assert(not is_valid) -- false, not the same table

local is_valid = valid.literal(price_table)(price_table)
assert(is_valid) -- true
```

#### Parameters
Expand Down

0 comments on commit 388ac63

Please sign in to comment.