-
Notifications
You must be signed in to change notification settings - Fork 23
adding 'to-string' function #84
base: master
Are you sure you want to change the base?
Changes from 2 commits
4329c3e
d5ef5b5
dd8c241
14562d0
d420558
dfcf250
0116f6d
d6f6aef
e26165c
14379ba
5adf9a3
466e255
7a69544
120ce69
2bc8959
03a85bd
eb851f8
ff12bb6
ee2c0c5
5c23b87
fa42555
16642dd
b32b51b
8bff9ea
d10c03b
f05f125
12484c3
ca95884
f7217de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // Helpers | ||
| @import "helpers/to-string"; | ||
| @import "helpers/quote"; | ||
|
|
||
| // Type specific encoding functions | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // Joins all elements of `$list` with `$glue` | ||
| // @access private | ||
| // @param {List} $list - list to cast | ||
| // @param {String} $glue ('') - value to use as a join string | ||
|
|
||
| @function to-string($list, $glue: '', $is-nested: false, $recursive: false) { | ||
| $result: null; | ||
| @for $i from 1 through length($list) { | ||
| $e: nth($list, $i); | ||
| @if type-of($e) == list and $recursive { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing empty line.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| $result: $result#{to-string($e, $glue, true)}; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Concatenation with
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing |
||
| } | ||
| @else { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Else directive should be on the same line as closing if. |
||
| $result: if( | ||
| $i != length($list) or $is-nested, | ||
| $result#{$e}#{$glue}, $result#{$e} | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Concatenation with |
||
| ); | ||
| } | ||
| } | ||
| @return $result; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing empty line. |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be
''.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too large indentation, I'd say?