SassyLists 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -0
  3. data/README.md +1 -1
  4. data/lib/SassyLists.rb +2 -2
  5. data/stylesheets/SassyLists/_chunk.scss +15 -13
  6. data/stylesheets/SassyLists/_comma-list.scss +7 -5
  7. data/stylesheets/SassyLists/_contain.scss +15 -11
  8. data/stylesheets/SassyLists/_count-values.scss +10 -8
  9. data/stylesheets/SassyLists/_debug.scss +22 -18
  10. data/stylesheets/SassyLists/_every.scss +12 -8
  11. data/stylesheets/SassyLists/_explode.scss +15 -13
  12. data/stylesheets/SassyLists/_first.scss +17 -14
  13. data/stylesheets/SassyLists/_flatten.scss +16 -12
  14. data/stylesheets/SassyLists/_has-multiple-values.scss +10 -8
  15. data/stylesheets/SassyLists/_has-values.scss +9 -8
  16. data/stylesheets/SassyLists/_insert-nth.scss +16 -15
  17. data/stylesheets/SassyLists/_intersection.scss +14 -12
  18. data/stylesheets/SassyLists/_is-empty.scss +14 -10
  19. data/stylesheets/SassyLists/_is-single.scss +10 -8
  20. data/stylesheets/SassyLists/_is-symmetrical.scss +16 -12
  21. data/stylesheets/SassyLists/_last-index.scss +11 -9
  22. data/stylesheets/SassyLists/_last.scss +14 -12
  23. data/stylesheets/SassyLists/_loop.scss +21 -17
  24. data/stylesheets/SassyLists/_prepend.scss +14 -12
  25. data/stylesheets/SassyLists/_purge.scss +16 -13
  26. data/stylesheets/SassyLists/_random-value.scss +22 -16
  27. data/stylesheets/SassyLists/_range.scss +14 -12
  28. data/stylesheets/SassyLists/_remove-duplicates.scss +16 -12
  29. data/stylesheets/SassyLists/_remove-nth.scss +17 -13
  30. data/stylesheets/SassyLists/_remove.scss +18 -14
  31. data/stylesheets/SassyLists/_replace-nth.scss +18 -16
  32. data/stylesheets/SassyLists/_replace.scss +16 -14
  33. data/stylesheets/SassyLists/_reverse.scss +16 -12
  34. data/stylesheets/SassyLists/_shuffle.scss +16 -12
  35. data/stylesheets/SassyLists/_slice.scss +18 -16
  36. data/stylesheets/SassyLists/_some.scss +11 -7
  37. data/stylesheets/SassyLists/_sort.scss +19 -15
  38. data/stylesheets/SassyLists/_sum.scss +16 -14
  39. data/stylesheets/SassyLists/_tail.scss +16 -12
  40. data/stylesheets/SassyLists/_to-list.scss +15 -15
  41. data/stylesheets/SassyLists/_to-map.scss +31 -24
  42. data/stylesheets/SassyLists/_to-string.scss +18 -14
  43. data/stylesheets/SassyLists/_union.scss +17 -12
  44. data/stylesheets/SassyLists/_walk.scss +17 -15
  45. data/stylesheets/SassyLists/helpers/_is-number.scss +10 -8
  46. data/stylesheets/SassyLists/helpers/_missing-dependencies.scss +10 -8
  47. data/stylesheets/SassyLists/helpers/_str-compare.scss +12 -10
  48. data/stylesheets/SassyLists/helpers/_true.scss +10 -8
  49. metadata +2 -2
@@ -1,18 +1,22 @@
1
- // Tests whether `$list` is empty.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-is-empty
4
- //
5
- // @param {List} $list - list to run test against
6
- //
7
- // @return {Bool}
1
+ /**
2
+ * Tests whether `$list` is empty.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-is-empty
5
+ *
6
+ * @param {List} $list - list to run test against
7
+ *
8
+ * @return {Bool}
9
+ */
8
10
 
9
11
  @function sl-is-empty($list) {
10
12
  @return length($list) == 0;
11
13
  }
12
14
 
13
- // @requires sl-is-empty
14
- // @alias sl-is-empty
15
-
15
+ /**
16
+ * @requires sl-is-empty
17
+ * @alias sl-is-empty
18
+ */
19
+
16
20
  @function sl-empty($list) {
17
21
  @return sl-is-empty($list);
18
22
  }
@@ -1,11 +1,13 @@
1
- // Tests whether `$list` has a single item.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-is-single
4
- //
5
- // @param {List} $list - list to run test against
6
- //
7
- // @return {Bool}
8
-
1
+ /**
2
+ * Tests whether `$list` has a single item.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-is-single
5
+ *
6
+ * @param {List} $list - list to run test against
7
+ *
8
+ * @return {Bool}
9
+ */
10
+
9
11
  @function sl-is-single($list) {
10
12
  @return length($list) == 1;
11
13
  }
@@ -1,12 +1,14 @@
1
- // Checks whether `$list` is symmetrical.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-is-symmetrical
4
- //
5
- // @requires sl-reverse
6
- //
7
- // @param {List} $list - list to check
8
- //
9
- // @return {Bool}
1
+ /**
2
+ * Checks whether `$list` is symmetrical.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-is-symmetrical
5
+ *
6
+ * @requires sl-reverse
7
+ *
8
+ * @param {List} $list - list to check
9
+ *
10
+ * @return {Bool}
11
+ */
10
12
 
11
13
  @function sl-is-symmetrical($list) {
12
14
  @if sl-missing-dependencies(sl-reverse) == true { @return null; }
@@ -14,9 +16,11 @@
14
16
  @return $list == sl-reverse($list);
15
17
  }
16
18
 
17
- // @requires sl-is-symmetrical
18
- // @alias sl-is-symmetrical
19
-
19
+ /**
20
+ * @requires sl-is-symmetrical
21
+ * @alias sl-is-symmetrical
22
+ */
23
+
20
24
  @function sl-is-mirror($list) {
21
25
  @return sl-is-symmetrical($list);
22
26
  }
@@ -1,12 +1,14 @@
1
- // Returns last index of `$value` in `$list`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-last-index
4
- //
5
- // @param {List} $list - list to search
6
- // @param {*} $value - value to be searched for
7
- //
8
- // @return {Number | Null}
9
-
1
+ /**
2
+ * Returns last index of `$value` in `$list`.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-last-index
5
+ *
6
+ * @param {List} $list - list to search
7
+ * @param {*} $value - value to be searched for
8
+ *
9
+ * @return {Number | Null}
10
+ */
11
+
10
12
  @function sl-last-index($list, $value) {
11
13
  @for $i from length($list) through 1 {
12
14
  @if nth($list, $i) == $value {
@@ -1,15 +1,17 @@
1
- // Returns last element of `$list`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-last
4
- //
5
- // @param {List} $list - list to retrieve last value from
6
- //
7
- // @throws Cannot find last item of empty list.
8
- //
9
- // @requires sl-is-empty
10
- //
11
- // @return {*}
12
-
1
+ /**
2
+ * Returns last element of `$list`.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-last
5
+ *
6
+ * @param {List} $list - list to retrieve last value from
7
+ *
8
+ * @throws Cannot find last item of empty list.
9
+ *
10
+ * @requires sl-is-empty
11
+ *
12
+ * @return {*}
13
+ */
14
+
13
15
  @function sl-last($list) {
14
16
  @if sl-missing-dependencies(sl-is-empty) == true { @return null; }
15
17
 
@@ -1,17 +1,19 @@
1
- // Shift indexes from `$list` of `$value`.
2
- //
3
- // @author Ana Tudor
4
- //
5
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-loop
6
- //
7
- // @param {List} $list - list to update
8
- // @param {Number} $value (1) - number of position between old and new indexes
9
- //
10
- // @throws $value is not a number for `loop`.
11
- //
12
- // @requires sl-has-multiple-values
13
- //
14
- // @return {List | Null}
1
+ /**
2
+ * Shift indexes from `$list` of `$value`.
3
+ *
4
+ * @author Ana Tudor
5
+ *
6
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-loop
7
+ *
8
+ * @param {List} $list - list to update
9
+ * @param {Number} $value (1) - number of position between old and new indexes
10
+ *
11
+ * @throws $value is not a number for `loop`.
12
+ *
13
+ * @requires sl-has-multiple-values
14
+ *
15
+ * @return {List | Null}
16
+ */
15
17
 
16
18
  @function sl-loop($list, $value: 1) {
17
19
  @if sl-missing-dependencies(sl-has-multiple-values) == true { @return null; }
@@ -35,9 +37,11 @@
35
37
  @return $result;
36
38
  }
37
39
 
38
- // @requires sl-loop
39
- // @alias sl-loop
40
-
40
+ /**
41
+ * @requires sl-loop
42
+ * @alias sl-loop
43
+ */
44
+
41
45
  @function sl-shift-indexes($list, $value: 1) {
42
46
  @return sl-loop($list, $value);
43
47
  }
@@ -1,15 +1,17 @@
1
- // Adds `$value` as first index of `$list`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-prepend
4
- //
5
- // @requires sl-is-true
6
- // @requires sl-to-list
7
- //
8
- // @param {List} $list - list to preprend value to
9
- // @param {*} $value - value to prepend to the list
10
- //
11
- // @return {List}
12
-
1
+ /**
2
+ * Adds `$value` as first index of `$list`.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-prepend
5
+ *
6
+ * @requires sl-is-true
7
+ * @requires sl-to-list
8
+ *
9
+ * @param {List} $list - list to preprend value to
10
+ * @param {*} $value - value to prepend to the list
11
+ *
12
+ * @return {List}
13
+ */
14
+
13
15
  @function sl-prepend($list, $value) {
14
16
  @if sl-missing-dependencies(sl-is-true, sl-to-list) == true { @return null; }
15
17
 
@@ -1,13 +1,14 @@
1
- // Removes all false and null values from `$list`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#purge
4
- //
5
- // @requires sl-is-true
6
- // @requires sl-to-list
7
- //
8
- // @param {List} $list - list to purge
9
- //
10
- // @return {List}
1
+ /** Removes all false and null values from `$list`.
2
+ *
3
+ * @ignore Documentation: http://sassylists.com/documentation.html#purge
4
+ *
5
+ * @requires sl-is-true
6
+ * @requires sl-to-list
7
+ *
8
+ * @param {List} $list - list to purge
9
+ *
10
+ * @return {List}
11
+ */
11
12
 
12
13
  @function sl-purge($list) {
13
14
  @if sl-missing-dependencies(sl-is-true, sl-to-list) == true { @return null; }
@@ -23,9 +24,11 @@
23
24
  @return sl-to-list($result);
24
25
  }
25
26
 
26
- // @requires sl-purge
27
- // @alias sl-purge
28
-
27
+ /**
28
+ * @requires sl-purge
29
+ * @alias sl-purge
30
+ */
31
+
29
32
  @function sl-clean($list) {
30
33
  @return sl-purge($list);
31
34
  }
@@ -1,14 +1,16 @@
1
- // Returns a random value of `$list`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#random-value
4
- //
5
- // @param {List} $list - list to random value from
6
- //
7
- // @throws Cannot find a random value in an empty list.
8
- //
9
- // @requires sl-is-empty
10
- //
11
- // @return {*}
1
+ /**
2
+ * Returns a random value of `$list`.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#random-value
5
+ *
6
+ * @param {List} $list - list to random value from
7
+ *
8
+ * @throws Cannot find a random value in an empty list.
9
+ *
10
+ * @requires sl-is-empty
11
+ *
12
+ * @return {*}
13
+ */
12
14
 
13
15
  @function sl-random-value($list) {
14
16
  @if sl-missing-dependencies(sl-is-empty) == true { @return null; }
@@ -21,16 +23,20 @@
21
23
  @return nth($list, random(length($list) - 1) + 1);
22
24
  }
23
25
 
24
- // @requires sl-random-value
25
- // @alias sl-random-value
26
+ /**
27
+ * @requires sl-random-value
28
+ * @alias sl-random-value
29
+ */
26
30
 
27
31
  @function sl-roll($list) {
28
32
  @return sl-random-value($list);
29
33
  }
30
34
 
31
- // @requires sl-random-value
32
- // @alias sl-random-value
33
-
35
+ /**
36
+ * @requires sl-random-value
37
+ * @alias sl-random-value
38
+ */
39
+
34
40
  @function sl-luck($list) {
35
41
  @return sl-random-value($list);
36
42
  }
@@ -1,15 +1,17 @@
1
- // Build a list of values from 1 through `$n`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-range
4
- //
5
- // @param {Number} $n - maximum value
6
- //
7
- // @throws `$n` is not a number for `sl-range`.
8
- // @throws `$n` is not unitless for `sl-range`.
9
- // @throws `$n` is not greater than 0 for `sl-range`.
10
- //
11
- // @return {List | Number | Null}
12
-
1
+ /**
2
+ * Build a list of values from 1 through `$n`.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-range
5
+ *
6
+ * @param {Number} $n - maximum value
7
+ *
8
+ * @throws `$n` is not a number for `sl-range`.
9
+ * @throws `$n` is not unitless for `sl-range`.
10
+ * @throws `$n` is not greater than 0 for `sl-range`.
11
+ *
12
+ * @return {List | Number | Null}
13
+ */
14
+
13
15
  @function sl-range($n) {
14
16
  @if type-of($n) != "number" {
15
17
  @warn "`#{inspect($n)}` is not a number for `sl-range`.";
@@ -1,12 +1,14 @@
1
- // Removes duplicate values from `$list`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-remove-duplicates
4
- //
5
- // @param {List} $list - list to remove duplicates from
6
- //
7
- // @requires sl-to-list
8
- //
9
- // @return {List}
1
+ /**
2
+ * Removes duplicate values from `$list`.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-remove-duplicates
5
+ *
6
+ * @param {List} $list - list to remove duplicates from
7
+ *
8
+ * @requires sl-to-list
9
+ *
10
+ * @return {List}
11
+ */
10
12
 
11
13
  @function sl-remove-duplicates($list) {
12
14
  @if sl-missing-dependencies(sl-to-list) == true { @return null; }
@@ -22,9 +24,11 @@
22
24
  @return sl-to-list($result);
23
25
  }
24
26
 
25
- // @requires sl-remove-duplicates
26
- // @alias sl-remove-duplicates
27
-
27
+ /**
28
+ * @requires sl-remove-duplicates
29
+ * @alias sl-remove-duplicates
30
+ */
31
+
28
32
  @function sl-unique($list) {
29
33
  @return sl-remove-duplicates($list);
30
34
  }
@@ -1,13 +1,15 @@
1
- // Removes value from `$list` at index `$index`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-remove-nth
4
- //
5
- // @requires sl-replace-nth
6
- //
7
- // @param {List} $list - list to remove value from
8
- // @param {Number} $index - index to remove
9
- //
10
- // @return {List | Null}
1
+ /**
2
+ * Removes value from `$list` at index `$index`.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-remove-nth
5
+ *
6
+ * @requires sl-replace-nth
7
+ *
8
+ * @param {List} $list - list to remove value from
9
+ * @param {Number} $index - index to remove
10
+ *
11
+ * @return {List | Null}
12
+ */
11
13
 
12
14
  @function sl-remove-nth($list, $index) {
13
15
  @if sl-missing-dependencies(sl-replace-nth) == true { @return null; }
@@ -15,9 +17,11 @@
15
17
  @return sl-replace-nth($list, $index, "");
16
18
  }
17
19
 
18
- // @requires sl-remove-nth
19
- // @alias sl-remove-nth
20
-
20
+ /**
21
+ * @requires sl-remove-nth
22
+ * @alias sl-remove-nth
23
+ */
24
+
21
25
  @function sl-without-nth($list, $index) {
22
26
  @return sl-remove-nth($list, $index);
23
27
  }
@@ -1,14 +1,16 @@
1
- // Removes value(s) `$value` from `$list`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-remove
4
- //
5
- // @requires sl-replace
6
- //
7
- // @param {List} $list - list to update
8
- // @param {*} $value - value to remove
9
- // @param {Bool} $recursive - enable/disable recursion
10
- //
11
- // @return {List}
1
+ /**
2
+ * Removes value(s) `$value` from `$list`.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-remove
5
+ *
6
+ * @requires sl-replace
7
+ *
8
+ * @param {List} $list - list to update
9
+ * @param {*} $value - value to remove
10
+ * @param {Bool} $recursive - enable/disable recursion
11
+ *
12
+ * @return {List}
13
+ */
12
14
 
13
15
  @function sl-remove($list, $value) {
14
16
  @if sl-missing-dependencies(sl-replace) == true { @return null; }
@@ -16,9 +18,11 @@
16
18
  @return sl-replace($list, $value, null);
17
19
  }
18
20
 
19
- // @requires sl-remove
20
- // @alias sl-remove
21
-
21
+ /**
22
+ * @requires sl-remove
23
+ * @alias sl-remove
24
+ */
25
+
22
26
  @function sl-without($list, $value) {
23
27
  @return sl-remove($list, $value);
24
28
  }