Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Commit

Permalink
remove unneeded funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Nov 13, 2015
1 parent cc16748 commit 1175add
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions lib/flint/functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,32 +96,4 @@ def flint_ruby_str_replace(string, find, replace)
end
declare :flint_ruby_str_replace, :args => [:string, :find, :replace]

#
# Check if key exists in map
#
# @param {Map} map - map to search
# @param {String} key - key to search for
#
# @return {Bool}
#
def flint_ruby_exists(map, key)
assert_type map, :Map, :map
assert_type key, :String, :key

hash = map.to_h

if hash.fetch(key, false)
return Sass::Script::Bool.new(true)
else
hash.each do |_, value|
if value.is_a?(Sass::Script::Value::Map)
return Sass::Script::Bool.new(true) if flint_ruby_exists(value, key).value
end
end
end

Sass::Script::Bool.new(false)
end
declare :flint_ruby_exists, :args => [:map, :key]

end

0 comments on commit 1175add

Please sign in to comment.