
Security News
ESLint Adds Support for Parallel Linting, Closing 10-Year-Old Feature Request
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
此為針對 台灣營利事業統一編號 (UBN) 所開發的驗證套件。
您可以使用它進行驗證,確認使用者提供的公司統一編號是否有效。
驗證之規則與細節參考,皆來自台灣財政部財政資訊中心之公告 「 [營利事業統一編號檢查碼邏輯修正說明][fia_rule] 」
via Rubygems
gem install tw_ubn
In your Gemfile:
gem 'tw_ubn'
使用很簡單,僅需要呼叫 TwUbn::Validator.call 即可確認是否正確
TwUbn::Validator.call("8碼公司統編")
# 有效的公司統一編號
TwUbn::Validator.call("22099131") # true
TwUbn::Validator.call("47217677") # true
TwUbn::Validator.call("22822281") # true
# 錯誤的公司統編
TwUbn::Validator.call("22822280") # false
TwUbn::Validator.call("47217977") # false
TwUbn::Validator.call("88123") # false
TwUbn::Validator.call("11099131") # false
在 Ruby on Rails 內,您也可以將 TwUbn::Validator 導入到自建的 validator 內使用。
https://api.rubyonrails.org/classes/ActiveModel/Validator.html
class TaxDataValidator < ActiveModel::Validator
def validate(record)
if !TwUbn::Validator.call(record.tax_number)
record.errors.add(:tax_number, '統一編號格式不正確。')
end
end
end
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that tw_ubn 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
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.
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.