mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
chore: update util
This commit is contained in:
@@ -1281,23 +1281,6 @@ const str =
|
||||
extractUrls(str); // -> ['http://eustia.liriliri.io']
|
||||
```
|
||||
|
||||
## fileSize
|
||||
|
||||
Turn bytes into human readable file size.
|
||||
|
||||
|Name |Desc |
|
||||
|------|------------------|
|
||||
|bytes |File bytes |
|
||||
|return|Readable file size|
|
||||
|
||||
```javascript
|
||||
fileSize(5); // -> '5'
|
||||
fileSize(1500); // -> '1.46K'
|
||||
fileSize(1500000); // -> '1.43M'
|
||||
fileSize(1500000000); // -> '1.4G'
|
||||
fileSize(1500000000000); // -> '1.36T'
|
||||
```
|
||||
|
||||
## filter
|
||||
|
||||
Iterates over elements of collection, returning an array of all the values that pass a truth test.
|
||||
@@ -1346,10 +1329,6 @@ a.b = 2;
|
||||
console.log(a); // -> {b: 1}
|
||||
```
|
||||
|
||||
## fullUrl
|
||||
|
||||
Add origin to url if needed.
|
||||
|
||||
## getFileName
|
||||
|
||||
Extract file name from url.
|
||||
@@ -1704,20 +1683,6 @@ isNaN(0); // -> false
|
||||
isNaN(NaN); // -> true
|
||||
```
|
||||
|
||||
## isNative
|
||||
|
||||
Check if value is a native function.
|
||||
|
||||
|Name |Desc |
|
||||
|------|----------------------------------|
|
||||
|val |Value to check |
|
||||
|return|True if value is a native function|
|
||||
|
||||
```javascript
|
||||
isNative(function() {}); // -> false
|
||||
isNative(Math.min); // -> true
|
||||
```
|
||||
|
||||
## isNil
|
||||
|
||||
Check if value is null or undefined, the same as value == null.
|
||||
|
||||
Reference in New Issue
Block a user