
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@hyurl/utils
Advanced tools
Utility functions of HyURL collection.
This package currently contains the following functions, more functions may be included in the future. Each function is stored in a separated file.
count
.tsdefine
.tsdiff
.tsensureType
.tsflatObject
.tsgetGlobal
.tsisEmpty
.tskeysOf
.tsomitVoid
.tspatch
.tssort
.tssplit
.tstimestamp
.tstrim
.tstypeOf
.tsDeprecated
Since v0.3.0, the following functions have been merged to @ayonli/jsext. The two packages serve different purposes, while @ayonli/jsext provides basic and semantic APIs for the JavaScript language, @hyurl/utils provides higher level functions that are used in more specific scenarios.
This package still keeps a link to these functions, but they have been marked deprecated and will be removed in v0.4.0.
isFloat
use Number.isFloat
from @ayonli/jsext/number/augment
instead.isInteger
use Number.isInteger
instead.isNumeric
use Number.isNumeric
from @ayonli/jsext/number/augment
instead.isBetween
use Number.isBetween
from @ayonli/jsext/number/augment
instead.isOwnKey
use Object.hasOwn
from @ayonli/jsext/object/augment
instead.isOwnMethod
use Object.hasOwnMethod
from @ayonli/jsext/object/augment
instead.isSubClassOf
use jsext.jsSubclassOf
from @ayonli/jsext
instead.isVoid
use !Object.isValid
from @ayonli/jsext/object/augment
instead.omit
use Object.omit
from @ayonli/jsext/object/augment
instead.pick
use Object.pick
from @ayonli/jsext/object/augment
instead.rand
use Number.random
from @ayonli/jsext/number/augment
instead.randStr
use String.random
from @ayonli/jsext/string/augment
instead.sleep
use Promise.sleep
from @ayonli/jsext/promise/augment
instead.typeAs
use Object.as
from @ayonli/jsext/object/augment
instead.until
use Promise.until
from @ayonli/jsext/promise/augment
instead.useThrottle
use jsext.throttle
from @ayonli/jsext
instead.wrap
use jsext.wrap
from @ayonli/jsext
instead.There are two ways to import these functions.
This method will load all functions into memory, even if you don't need some of them.
import * as utils from "@hyurl/utils";
// or import specific functions
import { count, ensureType } from "@hyurl/utils";
This method will only load needed functions, which is recommended.
import count from "@hyurl/utils/count";
import ensureType from "@hyurl/utils/ensureType";
Other than utility functions, this package also provides some utility types for TypeScript, they are located in the following file and exposed to the global namespace.
import "@hyurl/utils/types";
When using this package in the browser, there are three ways to import this package.
node_modules
This is the same as above, but requires a module bundler such as webpack.
<script type="module">
import * as utils from "https://deno.land/x/hyurl_utils/esm/index.js";
// or individuals
import count from "https://deno.land/x/hyurl_utils/esm/count.js";
import split from "https://deno.land/x/hyurl_utils/esm/split.js";
</script>
Note: the ES module can also be used in Deno.
<script src="https://deno.land/x/hyurl_utils/bundle/index.js"></script>
<script>
const utils = window["@hyurl/utils"];
<script>
FAQs
Utility functions of HyURL collection.
The npm package @hyurl/utils receives a total of 140 weekly downloads. As such, @hyurl/utils popularity was classified as not popular.
We found that @hyurl/utils demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.