menu arrow_back 湛蓝安全空间 |狂野湛蓝,暴躁每天 chevron_right ... chevron_right node_modules chevron_right boolbase
  • home 首页
  • brightness_4 暗黑模式
  • cloud
    xLIYhHS7e34ez7Ma
    cloud
    湛蓝安全
    code
    Github
    lightbulb_outline README

    boolbase

    This very simple module provides two basic functions, one that always returns true (trueFunc) and one that always returns false (falseFunc).

    WTF?

    By having only a single instance of these functions around, it's possible to do some nice optimizations. Eg. CSSselect uses these functions to determine whether a selector won't match any elements. If that's the case, the DOM doesn't even have to be touched.

    And why is this a separate module?

    I'm trying to modularize CSSselect and most modules depend on these functions. IMHO, having a separate module is the easiest solution to this problem.