
Security News
Rspack Introduces Rslint, a TypeScript-First Linter Written in Go
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Hash-class will extend the Hash object with assign_if
. This function reduces the verbosity when conditionaly assigning the value by key (within the basic Hash object).
Example:
# old
a = hash[:some_element] if hash.include?(:some_element)
# new
hash.assign_if(:some_element) {|e| a = e}
Logic
Block {|e| a = e}
is yielded when key :some_element
in hash
is found. e
contains the value of key :some_element
.
NOTE: When the key is not found, the block is not yielded!
Add gem to your Gemfile
gem 'hash-class', github: 'dblommesteijn/hash-class'
Use as standalone gem
gem install specific_install
gem specific_install https://github.com/dblommesteijn/hash-class
require 'hash-class'
a = 123
hash = {}
hash.assign_if(:some_element) {|e| a = e}
ruby -I test test/unit/test_hash.rb
FAQs
Unknown package
We found that hash-class demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.