@ditojs/utils 3.0.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 -3
- package/src/__snapshots__/index.test.js.snap +0 -90
- 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/formatPlainDate.test.js +0 -13
- 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 -24
- 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/string/parsePlainDate.test.js +0 -20
- package/src/timer/debounce.test.js +0 -101
- package/src/timer/debounceAsync.test.js +0 -143
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { isCreditCard } from './isCreditCard.js'
|
|
2
|
-
|
|
3
|
-
describe('isCreditCard()', () => {
|
|
4
|
-
describe.each([
|
|
5
|
-
'375556917985515',
|
|
6
|
-
'36050234196908',
|
|
7
|
-
'4716461583322103',
|
|
8
|
-
'4716-2210-5188-5662',
|
|
9
|
-
'4929 7226 5379 7141',
|
|
10
|
-
'5398228707871527',
|
|
11
|
-
'6283875070985593',
|
|
12
|
-
'6263892624162870',
|
|
13
|
-
'6234917882863855',
|
|
14
|
-
'6234698580215388',
|
|
15
|
-
'6226050967750613',
|
|
16
|
-
'6246281879460688',
|
|
17
|
-
'2222155765072228',
|
|
18
|
-
'2225855203075256',
|
|
19
|
-
'2720428011723762',
|
|
20
|
-
'2718760626256570'
|
|
21
|
-
])(
|
|
22
|
-
'isCreditCard(%o)',
|
|
23
|
-
str => {
|
|
24
|
-
it('returns true', () => {
|
|
25
|
-
expect(isCreditCard(str)).toBe(true)
|
|
26
|
-
})
|
|
27
|
-
}
|
|
28
|
-
)
|
|
29
|
-
describe.each([
|
|
30
|
-
false,
|
|
31
|
-
'foo',
|
|
32
|
-
'foo',
|
|
33
|
-
'5398228707871528',
|
|
34
|
-
'2718760626256571',
|
|
35
|
-
'2721465526338453',
|
|
36
|
-
'2220175103860763',
|
|
37
|
-
'375556917985515999999993',
|
|
38
|
-
'899999996234917882863855',
|
|
39
|
-
'prefix6234917882863855',
|
|
40
|
-
'623491788middle2863855',
|
|
41
|
-
'6234917882863855suffix'
|
|
42
|
-
])(
|
|
43
|
-
'isCreditCard(%o)',
|
|
44
|
-
str => {
|
|
45
|
-
it('returns false', () => {
|
|
46
|
-
expect(isCreditCard(str)).toBe(false)
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
})
|
|
@@ -1,24 +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
|
-
|
|
16
|
-
it('should return false for anything beyond a domain', () => {
|
|
17
|
-
expect(isDomain('')).toBe(false)
|
|
18
|
-
expect(isDomain('lineto.com:80')).toBe(false)
|
|
19
|
-
expect(isDomain('lineto.com/path')).toBe(false)
|
|
20
|
-
expect(isDomain('user@lineto.com')).toBe(false)
|
|
21
|
-
expect(isDomain('line%74o.com')).toBe(false)
|
|
22
|
-
expect(isDomain('line to.com')).toBe(false)
|
|
23
|
-
})
|
|
24
|
-
})
|
|
@@ -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
|
-
})
|