Skip to content

Commit

Permalink
Merge 79ab097 into a093b7f
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Sep 13, 2018
2 parents a093b7f + 79ab097 commit 049f519
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 96 deletions.
1 change: 1 addition & 0 deletions masonite/helpers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .static import static
from .password import password
from .validator import validate
from .misc import dot
15 changes: 15 additions & 0 deletions masonite/helpers/misc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def dot(data, compile_to=None):
notation_list = data.split('.')

compiling = ""
compiling += notation_list[0]
dot_split = compile_to.replace('{1}', '').split('{.}')

if any(len(x) > 1 for x in dot_split):
raise ValueError("Cannot have multiple values between {1} and {.}")

for notation in notation_list[1:]:
compiling += dot_split[0]
compiling += notation
compiling += dot_split[1]
return compiling
Loading

0 comments on commit 049f519

Please sign in to comment.