@ditojs/utils 2.100.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -9
- package/src/array/shuffle.js +1 -1
- package/src/string/formatPlainDate.js +14 -0
- package/src/string/index.js +2 -0
- package/src/string/isDomain.js +10 -3
- package/src/string/parsePlainDate.js +18 -0
- package/types/index.d.ts +13 -0
- package/src/__snapshots__/index.test.js.snap +0 -88
- package/src/array/flattten.test.js +0 -29
- package/src/array/shuffle.test.js +0 -25
- package/src/base/base.test.js +0 -590
- package/src/class/mixin.test.js +0 -70
- package/src/dataPath/getEntriesAtDataPath.test.js +0 -204
- package/src/dataPath/getValueAtDataPath.test.js +0 -140
- package/src/dataPath/normalizeDataPath.test.js +0 -36
- package/src/dataPath/parseDataPath.test.js +0 -67
- package/src/dataPath/setDataPathEntries.test.js +0 -36
- package/src/dataPath/setValueAtDataPath.test.js +0 -34
- package/src/function/toAsync.test.js +0 -31
- package/src/function/toCallback.test.js +0 -29
- package/src/function/toPromiseCallback.test.js +0 -24
- package/src/html/escapeHtml.test.js +0 -19
- package/src/html/stripHtml.test.js +0 -37
- package/src/index.test.js +0 -7
- package/src/object/clone.test.js +0 -131
- package/src/object/equals.test.js +0 -278
- package/src/object/groupBy.test.js +0 -70
- package/src/object/mapKeys.test.js +0 -16
- package/src/object/mapValues.test.js +0 -38
- package/src/object/mergeDeeply.test.js +0 -152
- package/src/object/pick.test.js +0 -23
- package/src/object/pickBy.test.js +0 -48
- package/src/string/camelize.test.js +0 -37
- package/src/string/capitalize.test.js +0 -33
- package/src/string/decamelize.test.js +0 -83
- package/src/string/deindent.test.js +0 -181
- package/src/string/format.test.js +0 -196
- package/src/string/formatDate.test.js +0 -28
- package/src/string/getCommonPrefix.test.js +0 -23
- package/src/string/isAbsoluteUrl.test.js +0 -15
- package/src/string/isCreditCard.test.js +0 -50
- package/src/string/isDomain.test.js +0 -15
- package/src/string/isEmail.test.js +0 -37
- package/src/string/isHostname.test.js +0 -12
- package/src/string/isUrl.test.js +0 -1595
- package/src/string/labelize.test.js +0 -39
- package/src/timer/debounce.test.js +0 -101
- package/src/timer/debounceAsync.test.js +0 -143
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { isDomain } from './isDomain.js'
|
|
2
|
-
|
|
3
|
-
describe('isDomain()', () => {
|
|
4
|
-
it('should return true for domains', () => {
|
|
5
|
-
expect(isDomain('lineto.com')).toBe(true)
|
|
6
|
-
expect(isDomain('www.lineto.com')).toBe(true)
|
|
7
|
-
expect(isDomain('www.lineto.ch')).toBe(true)
|
|
8
|
-
expect(isDomain('sub2.sub1.lineto.com')).toBe(true)
|
|
9
|
-
expect(isDomain('www.lineto.c')).toBe(false)
|
|
10
|
-
expect(isDomain('lineto_com')).toBe(false)
|
|
11
|
-
expect(isDomain('line-to.com')).toBe(true)
|
|
12
|
-
expect(isDomain('line_to.com')).toBe(false)
|
|
13
|
-
expect(isDomain('lünéto.com')).toBe(true)
|
|
14
|
-
})
|
|
15
|
-
})
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { isEmail } from './isEmail.js'
|
|
2
|
-
|
|
3
|
-
describe('isEmail()', () => {
|
|
4
|
-
describe.each([
|
|
5
|
-
'foo@bar.com',
|
|
6
|
-
'x@x.au',
|
|
7
|
-
'foo@bar.com.au',
|
|
8
|
-
'foo+bar@bar.com',
|
|
9
|
-
'hans.m端ller@test.com',
|
|
10
|
-
'hans@m端ller.com',
|
|
11
|
-
'test|123@m端ller.com',
|
|
12
|
-
'test+ext@gmail.com',
|
|
13
|
-
'some.name.midd.leNa.me.+extension@GoogleMail.com'
|
|
14
|
-
])(
|
|
15
|
-
'isEmail(%o)',
|
|
16
|
-
str => {
|
|
17
|
-
it('returns true', () => {
|
|
18
|
-
expect(isEmail(str)).toBe(true)
|
|
19
|
-
})
|
|
20
|
-
}
|
|
21
|
-
)
|
|
22
|
-
describe.each([
|
|
23
|
-
'invalidemail@',
|
|
24
|
-
'invalid.com',
|
|
25
|
-
'@invalid.com',
|
|
26
|
-
'foo@bar.com.',
|
|
27
|
-
'foo@bar.co.uk.',
|
|
28
|
-
'Name foo@bar.co.uk'
|
|
29
|
-
])(
|
|
30
|
-
'isEmail(%o)',
|
|
31
|
-
str => {
|
|
32
|
-
it('returns false', () => {
|
|
33
|
-
expect(isEmail(str)).toBe(false)
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
})
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isHostname } from './isHostname.js'
|
|
2
|
-
|
|
3
|
-
describe('isHostname()', () => {
|
|
4
|
-
it('should return true for hostnames', () => {
|
|
5
|
-
expect(isHostname('lineto.com')).toBe(true)
|
|
6
|
-
expect(isHostname('www.lineto.com')).toBe(true)
|
|
7
|
-
expect(isHostname('lineto_com')).toBe(false)
|
|
8
|
-
expect(isHostname('line-to.com')).toBe(true)
|
|
9
|
-
expect(isHostname('line_to.com')).toBe(false)
|
|
10
|
-
expect(isHostname('linéto.com')).toBe(false)
|
|
11
|
-
})
|
|
12
|
-
})
|