-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: 修复
matchUtil.domainMapRegexply()
方法BUG导致部分配置丢失有问题
- Loading branch information
1 parent
b6e3b5c
commit 64d5ae5
Showing
3 changed files
with
80 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,28 @@ | ||
const assert = require('node:assert') | ||
const lodash = require('lodash') | ||
|
||
// test lodash.isEqual | ||
const arr1 = [1, 2, 3] | ||
const arr2 = [3, 2, 1] | ||
console.log(lodash.isEqual(arr1.sort(), arr2.sort())) | ||
const arr2 = [1, 2, 3] | ||
const arr3 = [3, 2, 1] | ||
assert.strictEqual(lodash.isEqual(arr1, arr2), true) | ||
assert.strictEqual(lodash.isEqual(arr1.sort(), arr3.sort()), true) | ||
|
||
// test lodash.isEmpty | ||
|
||
function isEmpty (obj) { | ||
return obj == null || (lodash.isObject(obj) && lodash.isEmpty(obj)) | ||
} | ||
|
||
// true | ||
assert.strictEqual(isEmpty(null), true) | ||
assert.strictEqual(isEmpty({}), true) | ||
assert.strictEqual(isEmpty([]), true) | ||
// false | ||
assert.strictEqual(isEmpty(true), false) | ||
assert.strictEqual(isEmpty(false), false) | ||
assert.strictEqual(isEmpty(1), false) | ||
assert.strictEqual(isEmpty(0), false) | ||
assert.strictEqual(isEmpty(-1), false) | ||
assert.strictEqual(isEmpty(''), false) | ||
assert.strictEqual(isEmpty('1'), false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters