Skip to content

Commit

Permalink
Bumping 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KittyGiraudel committed Jul 1, 2014
1 parent 8a5de71 commit 9ec01d6
Show file tree
Hide file tree
Showing 17 changed files with 174 additions and 36 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Changelog

* `2.1.0`: adding `sl-is-empty()`, `sl-to-list()` and `sl-comma-list()`
* `2.0.0`:
* adding `to-map()`, `every()` and `some()`
* adding `sl-to-map()`, `sl-every()` and `sl-some()`
* adding and improved tests
* prefixing all functions with `sl-`
* fixing an issue with `random-value()` sometimes failing
Expand Down
3 changes: 3 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = function(grunt) {
'<%= dir.src %>/SassyLists/helpers/_str-compare.scss',
'<%= dir.src %>/SassyLists/helpers/_true.scss',
'<%= dir.src %>/SassyLists/_chunk.scss',
'<%= dir.src %>/SassyLists/_comma-list.scss',
'<%= dir.src %>/SassyLists/_contain.scss',
'<%= dir.src %>/SassyLists/_count-values.scss',
'<%= dir.src %>/SassyLists/_debug.scss',
Expand All @@ -34,6 +35,7 @@ module.exports = function(grunt) {
'<%= dir.src %>/SassyLists/_flatten.scss',
'<%= dir.src %>/SassyLists/_insert-nth.scss',
'<%= dir.src %>/SassyLists/_intersection.scss',
'<%= dir.src %>/SassyLists/_is-empty.scss',
'<%= dir.src %>/SassyLists/_is-symmetrical.scss',
'<%= dir.src %>/SassyLists/_last-index.scss',
'<%= dir.src %>/SassyLists/_last.scss',
Expand All @@ -53,6 +55,7 @@ module.exports = function(grunt) {
'<%= dir.src %>/SassyLists/_some.scss',
'<%= dir.src %>/SassyLists/_sum.scss',
'<%= dir.src %>/SassyLists/_tail.scss',
'<%= dir.src %>/SassyLists/_to-list.scss',
'<%= dir.src %>/SassyLists/_to-map.scss',
'<%= dir.src %>/SassyLists/_to-string.scss',
'<%= dir.src %>/SassyLists/_union.scss',
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Here is a powerful toolbox providing you all the functions you need to manipulat
## What's in there?

* `sl-chunk()`: returns whether list contains $value
* `sl-comma-list()`: initializes an empty comma-separated list
* `sl-contain()`: returns whether the list contains the value
* `sl-count-values()`: counts the number of occurrences of each value of list
* `sl-debug()`: returns list as a string
Expand All @@ -24,6 +25,7 @@ Here is a powerful toolbox providing you all the functions you need to manipulat
* `sl-flatten()`: turns multidimensional list into a one-level list
* `sl-insert-nth()`: inserts value at index
* `sl-intersection()`: returns a list of shared values across all given lists
* `sl-is-empty()`: checks if list is empty
* `sl-is-symmetrical()`: checks if list is symmetrical
* `sl-last()`: returns last item in list
* `sl-last-index()`: returns last index of value in list
Expand All @@ -43,6 +45,7 @@ Here is a powerful toolbox providing you all the functions you need to manipulat
* `sl-some()`: returns whether some items from list pass test from given function
* `sl-sum()`: sums all unitless values in list
* `sl-tail()`: returns anything but the first element in list
* `sl-to-list()`: casts value as list
* `sl-to-map()`: casts list as map using indexes as keys
* `sl-to-string()`: casts list as string (JS `.join()`)
* `sl-union()`: returns a list of values from given lists minus duplicates
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SassyLists",
"version": "1.0.0",
"version": "2.1.0",
"homepage": "https://github.com/Team-Sass/SassyLists",
"authors": [
"Hugo Giraudel"
Expand Down
100 changes: 72 additions & 28 deletions dist/_SassyLists.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! SassyLists - v2.0.0 - 2014-06-30 */
/*! SassyLists - v2.1.0 - 2014-07-01 */
// Checks whether `$functions` exist in global scope.
//
// @access private
Expand Down Expand Up @@ -63,7 +63,7 @@
}
// Chunks `$list` into `$size` large lists.
//
// @ignore Documentation: http://sassylists.com/documentation/#chunk
// @ignore Documentation: http://sassylists.com/documentation.html#sl-chunk
//
// @param {List} $list - list to chunk
// @param {Number} $size - length of lists
Expand Down Expand Up @@ -103,9 +103,16 @@

@return $result;
}
// Initialize an empty comma-separated list.
//
// @return {List}

@function sl-comma-list() {
@return zip((), ());
}
// Returns whether `$list` contains `$value`.
//
// @ignore Documentation: http://sassylists.com/documentation/#contain
// @ignore Documentation: http://sassylists.com/documentation.html#sl-contain
//
// @param {List} $list - list to check
// @param {*} $value - value to look for
Expand All @@ -123,7 +130,7 @@
}
// Counts the number of occurrences of each value of `$list`.
//
// @ignore Documentation: http://sassylists.com/documentation/#count-values
// @ignore Documentation: http://sassylists.com/documentation.html#sl-count-values
//
// @param {List} $list - list to count values from
//
Expand All @@ -142,7 +149,7 @@
}
// Returns `$list` as a string, prettified if `$pre` is set to true.
//
// @ignore Documentation: http://sassylists.com/documentation/#debug
// @ignore Documentation: http://sassylists.com/documentation.html#sl-debug
//
// @param {List} $list - list to debug
// @param {Bool} $pre (false) - enable/disable variables type and proper indentation
Expand Down Expand Up @@ -239,7 +246,7 @@

// Explode `$string` into a list using `$delimiter` as a delimiter.
//
// @ignore Documentation: http://sassylists.com/documentation/#explode
// @ignore Documentation: http://sassylists.com/documentation.html#sl-explode
//
// @param {String} $string - string to explode
// @param {String} $separator ('') - string to use as a delimiter
Expand Down Expand Up @@ -310,7 +317,7 @@

// Returns first element of `$list`.
//
// @ignore Documentation: http://sassylists.com/documentation/#first
// @ignore Documentation: http://sassylists.com/documentation.html#sl-first
//
// @param {List} $list - list to retrieve first item from
//
Expand Down Expand Up @@ -370,7 +377,7 @@
}
// Adds `$value` at `$index` in `$list`.
//
// @ignore Documentation: http://sassylists.com/documentation/#insert-nth
// @ignore Documentation: http://sassylists.com/documentation.html#sl-insert-nth
//
// @requires sl-is-true
//
Expand Down Expand Up @@ -419,7 +426,7 @@

// Returns a list of shared value from `$list` and `$lists` minus duplicates.
//
// @ignore Documentation: http://sassylists.com/documentation/#intersection
// @ignore Documentation: http://sassylists.com/documentation.html#sl-intersection
//
// @requires sl-remove-duplicates
//
Expand Down Expand Up @@ -448,9 +455,27 @@
$result: sl-remove-duplicates($result);
@return if(length($result) == 1, nth($result, 1), $result);
}
// Tests whether `$list` is empty.
//
// @ignore Documentation: http://sassylists.com/documentation.html#sl-is-empty
//
// @param {List} $list - list to run test against
//
// @return {Bool}

@function sl-is-empty($list) {
@return length($list) == 0;
}

// @requires sl-is-empty
// @alias sl-is-empty

@function sl-empty($list) {
@return sl-is-empty($list);
}
// Checks whether `$list` is symmetrical.
//
// @ignore Documentation: http://sassylists.com/documentation/#is-symmetrical
// @ignore Documentation: http://sassylists.com/documentation.html#sl-is-symmetrical
//
// @requires sl-reverse
//
Expand All @@ -471,7 +496,7 @@
}
// Returns last index of `$value` in `$list`.
//
// @ignore Documentation: http://sassylists.com/documentation/#last-index
// @ignore Documentation: http://sassylists.com/documentation.html#sl-last-index
//
// @param {List} $list - list to search
// @param {*} $value - value to be searched for
Expand All @@ -492,7 +517,7 @@

// Returns last element of `$list`.
//
// @ignore Documentation: http://sassylists.com/documentation/#last
// @ignore Documentation: http://sassylists.com/documentation.html#sl-last
//
// @param {List} $list - list to retrieve last value from
//
Expand All @@ -512,7 +537,7 @@
//
// @author Ana Tudor
//
// @ignore Documentation: http://sassylists.com/documentation/#loop
// @ignore Documentation: http://sassylists.com/documentation.html#sl-loop
//
// @param {List} $list - list to update
// @param {Number} $value (1) - number of position between old and new indexes
Expand Down Expand Up @@ -548,7 +573,7 @@
}
// Adds `$value` as first index of `$list`.
//
// @ignore Documentation: http://sassylists.com/documentation/#prepend
// @ignore Documentation: http://sassylists.com/documentation.html#sl-prepend
//
// @requires sl-is-true
//
Expand Down Expand Up @@ -631,7 +656,7 @@
}
// Removes duplicate values from `$list`.
//
// @ignore Documentation: http://sassylists.com/documentation/#remove-duplicates
// @ignore Documentation: http://sassylists.com/documentation.html#sl-remove-duplicates
//
// @param {List} $list - list to remove duplicates from
//
Expand All @@ -656,7 +681,7 @@
}
// Removes value from `$list` at index `$index`.
//
// @ignore Documentation: http://sassylists.com/documentation/#remove-nth
// @ignore Documentation: http://sassylists.com/documentation.html#sl-remove-nth
//
// @requires sl-replace-nth
//
Expand All @@ -678,7 +703,7 @@
}
// Removes value(s) `$value` from `$list`.
//
// @ignore Documentation: http://sassylists.com/documentation/#remove
// @ignore Documentation: http://sassylists.com/documentation.html#sl-remove
//
// @requires sl-replace
//
Expand All @@ -701,7 +726,7 @@
}
// Replaces value at `$index` from `$list` by `$value`.
//
// @ignore Documentation: http://sassylists.com/documentation/#replace-nth
// @ignore Documentation: http://sassylists.com/documentation.html#sl-replace-nth
//
// @requires sl-purge
// @requires sl-is-true
Expand Down Expand Up @@ -761,7 +786,7 @@
}
// Reverses the order of `$list`.
//
// @ignore Documentation: http://sassylists.com/documentation/#reverse
// @ignore Documentation: http://sassylists.com/documentation.html#sl-reverse
//
// @param {List} $list - list to reverse
//
Expand Down Expand Up @@ -791,7 +816,7 @@
}
// Shuffle `$list` using Fisher-Yates method.
//
// @ignore Documentation: http://sassylists.com/documentation/#shuffle
// @ignore Documentation: http://sassylists.com/documentation.html#sl-shuffle
//
// @param {List} $list - list to shuffle
//
Expand Down Expand Up @@ -822,7 +847,7 @@

// Slices `$list` between `$start` and `$end`.
//
// @ignore Documentation: http://sassylists.com/documentation/#slice
// @ignore Documentation: http://sassylists.com/documentation.html#sl-slice
//
// @param {List} $list - list to slice
// @param {Number} $start (1) - start index
Expand Down Expand Up @@ -876,7 +901,7 @@
}
// Sorts values of `$list` using quick-sort algorithm using `$order`.
//
// @ignore Documentation: http://sassylists.com/documentation/#sort
// @ignore Documentation: http://sassylists.com/documentation.html#sl-sort
//
// @requires sl-str-compare
//
Expand Down Expand Up @@ -937,7 +962,7 @@

// Sums up all numeric values in `$list`, stripping unit if `$force` set to `true`.
//
// @ignore Documentation: http://sassylists.com/documentation/#sum
// @ignore Documentation: http://sassylists.com/documentation.html#sl-sum
//
// @param {List} $list - list
// @param {Bool} $force (false) - enable/disable parseInt
Expand Down Expand Up @@ -966,7 +991,7 @@

// Returns the tail of `$list`: all items except the first (head).
//
// @ignore Documentation: http://sassylists.com/documentation/#tail
// @ignore Documentation: http://sassylists.com/documentation.html#sl-tail
//
// @requires sl-slice
//
Expand All @@ -985,13 +1010,32 @@
@function sl-rest($list) {
@return sl-tail($list);
}
// Cast `$value` into list
//
// @ignore Documentation: http://sassylists.com/documentation.html#sl-to-list
//
// @param {*} $value - value to cast to list
//
// @return {List}

@function sl-to-list($value) {
@return if(type-of($value) == "list", $value, ($value,));
}

// @requires sl-to-list
// @alias sl-to-list

@function sl-listify($value) {
@return sl-to-list($value);
}

// Cast a `$list` into a map, using indexes as keys (starting with `$start`).
// Useful for iterating through a list with an index variable.
// e.g. `@each $i, $value in to-map($list)`
//
// @author Andrey "Lolmaus" Mikhaylov
//
// @ignore Documentation: http://sassylists.com/documentation/#to-map
// @ignore Documentation: http://sassylists.com/documentation.html#sl-to-map
//
// @param {List} $list - list to turn into map
// @param {Number} $start (1) - index to start with
Expand Down Expand Up @@ -1038,7 +1082,7 @@
}
// Joins all elements of `$list` with `$glue`.
//
// @ignore Documentation: http://sassylists.com/documentation/#to-string
// @ignore Documentation: http://sassylists.com/documentation.html#sl-to-string
//
// @param {List} $list - list to cast
// @param {String} $glue ('') - value to use as a join string
Expand All @@ -1064,7 +1108,7 @@
}
// Returns a list of values from `$lists` minus duplicates.
//
// @ignore Documentation: http://sassylists.com/documentation/#union
// @ignore Documentation: http://sassylists.com/documentation.html#sl-union
//
// @requires sl-flatten
// @requires sl-remove-duplicates
Expand All @@ -1089,7 +1133,7 @@

// Apply `$function` to every item from `$list` passing $args as parameters.
//
// @ignore Documentation: http://sassylists.com/documentation/#walk
// @ignore Documentation: http://sassylists.com/documentation.html#sl-walk
//
// @param {List} $list - list to update
// @param {String} $function - function to call on each value
Expand Down
4 changes: 2 additions & 2 deletions lib/SassyLists.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Version is a number. If a version contains alphas, it will be created as a prerelease version
# Date is in the form of YYYY-MM-DD
module SassyLists
VERSION = "2.0.0"
DATE = "2014-06-30"
VERSION = "2.1.0"
DATE = "2014-07-01"
end

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SassyLists",
"version": "2.0.0",
"version": "2.1.0",
"description": "A Sass API for lists.",
"scripts": {
"test": "grunt test"
Expand Down
9 changes: 9 additions & 0 deletions stylesheets/SassyLists/_comma-list.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Initialize an empty comma-separated list.
//
// @ignore Documentation: http://sassylists.com/documentation.html#sl-comma-list
//
// @return {List}

@function sl-comma-list() {
@return zip((), ());
}
Loading

0 comments on commit 9ec01d6

Please sign in to comment.