Returns true if the given is falsey (according to JavaScript) or matches a 'falsey' keyword.
Test if a given value is falsey.
Casts the given value to a flatten array, and removes falsey items (similar to lodash compact).
returns a copy of an array with falsey values removed
Get native `Promise` or falsey value if not available.
Recursively remove deeply nested properties and/or falsey values (excluding 0), empty objects, and empty arrays.
Using key paths that may contain "falsey" patterns, check if a property on an object is enabled.
Trim empty, nullish, or falsey keys from your JSON object
Creates a deep clone of an object with all falsey values removed
A falsey object that returns itself for all properties and when invoked.
A micro-lib accepts n arguments of CSS classnames, removes falsey args & joins them into a space-separated string
A filter extension to get the truthy and falsey sides of a filter
Recursively remove falsey values from JS objects.
We are lazy, also [lazy-cache][]d and [browserify][]-ready - just arrayify, falsey values returns empty array. In bonus with `.isArray` method.
Checks if a value is 'falsey' or not.
Checks whether value has nested properties that are falsey. If truthy values are found returns false.
A specification backed popover for react
Let your JS API users either give you a callback or receive a promise
Remove falsey values from array and object
Extend an object with a defaults if the subject object's value is 'falsey'
Properly hijack require, i.e., properly define require hooks and customizations
Compare items in two sequences to find a longest common subsequence
Compare items in two sequences to find a longest common subsequence
The Spread physics simulation layout for Cytoscape.js
Simple Rust library determining whether strings indicate truey or falsy values
Simple rendering of mustache templates
✅ Get inputs, set outputs, and other basic operations for GitHub Actions
CLI for converting JSON logs to human-readable format
parse arbitrary strings as bools
A compiler for Lua-like scripts to HCB
A transactional relational-graph-vector database using Datalog — a maintained fork of CozoDB, tuned as a substrate for agentic memory
A gem for adding attr_boolean to objects, assigning by various 'falsey' values
PrettyFeed provides a modulizer you can include in a job, worker, class, rake task, etc, which allows for simple pass/fail logging colorization. Defaults are `truthy: 'green'` and `falsey: 'red'`.
Conditional statements, like if/else, have it's place, under libraries and frameworks, but not in application code. This library implements a collection of techniques to avoid if/else, initially by extending "Truthy" and "Falsey" classes with expressive yet Ruby idiomatic operations. Please look forward for more features to come.
IfElse is an implementation of the pure object-oriented conditional syntax found in languages of the SmallTalk family, including Self. Those languages distinguish themselves by taking the "everything is an object / everything is a method" approach to a further extreme than Ruby, and getting rid of almost all cases of special syntax other than object definition and method call. Ruby, of course, already works this way for some purposes -- thus most Ruby developers prefer to write [1, 17, 39].each {|x| puts x} rather than for x in [1, 17, 39] puts x end and 3.times {|n| puts n} instead of i = 1 while i <= 3 puts i i += 1 end This module extends that same preference to conditional statements, providing replacements for the Ruby keywords +if+, and +unless+: x = 1 (x >= 0).if {puts 'positive'} (x < 0).unless {puts 'positive'} Note that as with the built-in special forms these methods replace, these methods are available on any Ruby Object, and obey the usual rules of which values are considered "Truthy" and "Falsey". <b>Note that the primary purpose of this gem is to demonstrate that the built-in (special form) versions of conditionals provided with Ruby are mostly syntactic sugar -- as with the +for+ keyword, there is no real need for these to be built into the language. With that said, the gem is fully tested, has no particular performance penalty (beyond the usual cost of method dispatch), and should be fully useable in general purpose code.</b> <b>Note also that while Smalltalk-family languages also provide an equivalent to the Ruby +else+ keyword, this depends on the more general block/lambda capability of those languages, which allow a method to take multiple blocks as arguments. This could be imitated with a syntax like:</b> # NOT A REAL EXAMPLE (x > 42).if then: lambda {|x| :big }, else: lambda {|x| :small} <b>which is true to the SmallTalk original, but feels less Ruby-ish to me, so I didn't implement this -- perhaps in a later version.</b>
No description provided.
No description provided.
No description provided.