@design-edito/tools 0.5.14 → 0.5.16

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.
Files changed (60) hide show
  1. package/agnostic/arrays/index.d.ts +2 -2
  2. package/agnostic/arrays/index.js +2 -2
  3. package/agnostic/colors/index.d.ts +4 -4
  4. package/agnostic/colors/index.js +4 -4
  5. package/agnostic/css/index.d.ts +2 -2
  6. package/agnostic/css/index.js +2 -2
  7. package/agnostic/errors/index.d.ts +1 -1
  8. package/agnostic/errors/index.js +1 -1
  9. package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +15 -15
  10. package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +15 -15
  11. package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +4 -4
  12. package/agnostic/html/hyper-json/smart-tags/isolated/index.js +4 -4
  13. package/agnostic/html/index.d.ts +2 -2
  14. package/agnostic/html/index.js +2 -2
  15. package/agnostic/index.d.ts +2 -2
  16. package/agnostic/index.js +2 -2
  17. package/agnostic/misc/index.d.ts +5 -5
  18. package/agnostic/misc/index.js +5 -5
  19. package/agnostic/numbers/index.d.ts +2 -2
  20. package/agnostic/numbers/index.js +2 -2
  21. package/agnostic/objects/index.d.ts +2 -2
  22. package/agnostic/objects/index.js +2 -2
  23. package/agnostic/random/index.d.ts +1 -1
  24. package/agnostic/random/index.js +1 -1
  25. package/agnostic/strings/index.d.ts +1 -1
  26. package/agnostic/strings/index.js +1 -1
  27. package/agnostic/subtitles/index.d.ts +1 -1
  28. package/agnostic/subtitles/index.js +1 -1
  29. package/agnostic/time/dates/format-date/index.d.ts +19 -4
  30. package/agnostic/time/dates/format-date/index.js +24 -7
  31. package/agnostic/time/dates/format-date/index.test.js +20 -7
  32. package/agnostic/time/dates/format-date/parts.js +4 -4
  33. package/agnostic/time/dates/format-date/types.d.ts +9 -9
  34. package/agnostic/time/duration/format-duration/index.d.ts +18 -1
  35. package/agnostic/time/duration/format-duration/index.js +44 -7
  36. package/agnostic/time/duration/format-duration/index.test.js +27 -0
  37. package/agnostic/time/duration/format-duration/types.d.ts +21 -1
  38. package/agnostic/time/index.d.ts +1 -1
  39. package/agnostic/time/index.js +1 -1
  40. package/components/Video/index.controlled.d.ts +22 -2
  41. package/components/Video/index.controlled.js +21 -5
  42. package/components/Video/index.d.ts +13 -1
  43. package/components/Video/index.js +18 -2
  44. package/components/Video/utils.d.ts +0 -31
  45. package/components/Video/utils.js +0 -58
  46. package/node/@aws-s3/storage/file/index.d.ts +1 -1
  47. package/node/@aws-s3/storage/file/index.js +1 -1
  48. package/node/@google-cloud/storage/file/index.d.ts +4 -4
  49. package/node/@google-cloud/storage/file/index.js +4 -4
  50. package/node/cloud-storage/operations/index.d.ts +2 -2
  51. package/node/cloud-storage/operations/index.js +2 -2
  52. package/node/encryption/@aes-256-gcm/index.d.ts +1 -1
  53. package/node/encryption/@aes-256-gcm/index.js +1 -1
  54. package/node/files/index.d.ts +1 -1
  55. package/node/files/index.js +1 -1
  56. package/node/images/transform/operations/index.d.ts +3 -3
  57. package/node/images/transform/operations/index.js +3 -3
  58. package/node/process/index.d.ts +1 -1
  59. package/node/process/index.js +1 -1
  60. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
+ export * as dedupe from './dedupe/index.js'
1
2
  export * as findDuplicates from './find-duplicates/index.js'
2
3
  export * as isArrayOf from './is-array-of/index.js'
3
- export * as dedupe from './dedupe/index.js'
4
4
  export * as make from './make/index.js'
5
- export * as shuffle from './shuffle/index.js'
6
5
  export * as randomPick from './random-pick/index.js'
6
+ export * as shuffle from './shuffle/index.js'
@@ -1,6 +1,6 @@
1
+ export * as dedupe from './dedupe/index.js'
1
2
  export * as findDuplicates from './find-duplicates/index.js'
2
3
  export * as isArrayOf from './is-array-of/index.js'
3
- export * as dedupe from './dedupe/index.js'
4
4
  export * as make from './make/index.js'
5
- export * as shuffle from './shuffle/index.js'
6
5
  export * as randomPick from './random-pick/index.js'
6
+ export * as shuffle from './shuffle/index.js'
@@ -1,12 +1,12 @@
1
- export * as channels from './channels/index.js'
2
- export * as contrast from './contrast/index.js'
3
1
  export * as convert from './convert/index.js'
2
+ export * as contrast from './contrast/index.js'
4
3
  export * as distance from './distance/index.js'
5
4
  export * as grayscale from './grayscale/index.js'
6
5
  export * as invert from './invert/index.js'
7
6
  export * as lerp from './lerp/index.js'
8
- export * as luminance from './luminance/index.js'
9
7
  export * as palette from './palette/index.js'
8
+ export * as luminance from './luminance/index.js'
10
9
  export * as rotate from './rotate/index.js'
11
- export * as typechecks from './typechecks/index.js'
12
10
  export * as tidy from './tidy/index.js'
11
+ export * as typechecks from './typechecks/index.js'
12
+ export * as channels from './channels/index.js'
@@ -1,12 +1,12 @@
1
- export * as channels from './channels/index.js'
2
- export * as contrast from './contrast/index.js'
3
1
  export * as convert from './convert/index.js'
2
+ export * as contrast from './contrast/index.js'
4
3
  export * as distance from './distance/index.js'
5
4
  export * as grayscale from './grayscale/index.js'
6
5
  export * as invert from './invert/index.js'
7
6
  export * as lerp from './lerp/index.js'
8
- export * as luminance from './luminance/index.js'
9
7
  export * as palette from './palette/index.js'
8
+ export * as luminance from './luminance/index.js'
10
9
  export * as rotate from './rotate/index.js'
11
- export * as typechecks from './typechecks/index.js'
12
10
  export * as tidy from './tidy/index.js'
11
+ export * as typechecks from './typechecks/index.js'
12
+ export * as channels from './channels/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as bem from './bem/index.js'
2
- export * as clss from './clss/index.js'
3
2
  export * as generateNiceColor from './generate-nice-color/index.js'
3
+ export * as clss from './clss/index.js'
4
+ export * as isValidCssClassName from './is-valid-css-class-name/index.js'
4
5
  export * as scale from './scale/index.js'
5
6
  export * as stylesSet from './styles-set/index.js'
6
- export * as isValidCssClassName from './is-valid-css-class-name/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as bem from './bem/index.js'
2
- export * as clss from './clss/index.js'
3
2
  export * as generateNiceColor from './generate-nice-color/index.js'
3
+ export * as clss from './clss/index.js'
4
+ export * as isValidCssClassName from './is-valid-css-class-name/index.js'
4
5
  export * as scale from './scale/index.js'
5
6
  export * as stylesSet from './styles-set/index.js'
6
- export * as isValidCssClassName from './is-valid-css-class-name/index.js'
@@ -1,2 +1,2 @@
1
- export * as unknownToString from './unknown-to-string/index.js'
2
1
  export * as register from './register/index.js'
2
+ export * as unknownToString from './unknown-to-string/index.js'
@@ -1,2 +1,2 @@
1
- export * as unknownToString from './unknown-to-string/index.js'
2
1
  export * as register from './register/index.js'
2
+ export * as unknownToString from './unknown-to-string/index.js'
@@ -1,52 +1,52 @@
1
- export * as add from './add/index.js'
2
1
  export * as addclass from './addclass/index.js'
3
2
  export * as and from './and/index.js'
4
3
  export * as append from './append/index.js'
5
4
  export * as at from './at/index.js'
5
+ export * as add from './add/index.js'
6
6
  export * as call from './call/index.js'
7
- export * as clone from './clone/index.js'
8
7
  export * as deleteproperties from './deleteproperties/index.js'
8
+ export * as clone from './clone/index.js'
9
9
  export * as equals from './equals/index.js'
10
10
  export * as getattribute from './getattribute/index.js'
11
- export * as getproperty from './getproperty/index.js'
12
11
  export * as getproperties from './getproperties/index.js'
12
+ export * as getproperty from './getproperty/index.js'
13
13
  export * as hjparse from './hjparse/index.js'
14
14
  export * as hjstringify from './hjstringify/index.js'
15
- export * as if from './if/index.js'
16
15
  export * as initialize from './initialize/index.js'
16
+ export * as if from './if/index.js'
17
17
  export * as join from './join/index.js'
18
18
  export * as length from './length/index.js'
19
19
  export * as map from './map/index.js'
20
20
  export * as negate from './negate/index.js'
21
- export * as notrailing from './notrailing/index.js'
22
21
  export * as or from './or/index.js'
22
+ export * as notrailing from './notrailing/index.js'
23
23
  export * as pickrandom from './pickrandom/index.js'
24
24
  export * as populate from './populate/index.js'
25
- export * as push from './push/index.js'
26
25
  export * as print from './print/index.js'
26
+ export * as push from './push/index.js'
27
27
  export * as pusheach from './pusheach/index.js'
28
28
  export * as recordtoarray from './recordtoarray/index.js'
29
29
  export * as removeattribute from './removeattribute/index.js'
30
30
  export * as removeclass from './removeclass/index.js'
31
31
  export * as renameproperty from './renameproperty/index.js'
32
32
  export * as replace from './replace/index.js'
33
- export * as set from './set/index.js'
34
33
  export * as select from './select/index.js'
35
- export * as setattribute from './setattribute/index.js'
36
34
  export * as setproperty from './setproperty/index.js'
35
+ export * as setattribute from './setattribute/index.js'
36
+ export * as set from './set/index.js'
37
+ export * as sorton from './sorton/index.js'
37
38
  export * as split from './split/index.js'
38
39
  export * as spread from './spread/index.js'
39
40
  export * as toarray from './toarray/index.js'
40
- export * as toboolean from './toboolean/index.js'
41
- export * as toggleclass from './toggleclass/index.js'
42
41
  export * as toelement from './toelement/index.js'
42
+ export * as toggleclass from './toggleclass/index.js'
43
43
  export * as tonodelist from './tonodelist/index.js'
44
- export * as tonumber from './tonumber/index.js'
45
- export * as sorton from './sorton/index.js'
46
44
  export * as tonull from './tonull/index.js'
47
- export * as toref from './toref/index.js'
45
+ export * as tonumber from './tonumber/index.js'
46
+ export * as toboolean from './toboolean/index.js'
47
+ export * as torecord from './torecord/index.js'
48
48
  export * as tostring from './tostring/index.js'
49
- export * as transformselected from './transformselected/index.js'
49
+ export * as toref from './toref/index.js'
50
50
  export * as totext from './totext/index.js'
51
+ export * as transformselected from './transformselected/index.js'
51
52
  export * as trim from './trim/index.js'
52
- export * as torecord from './torecord/index.js'
@@ -1,52 +1,52 @@
1
- export * as add from './add/index.js'
2
1
  export * as addclass from './addclass/index.js'
3
2
  export * as and from './and/index.js'
4
3
  export * as append from './append/index.js'
5
4
  export * as at from './at/index.js'
5
+ export * as add from './add/index.js'
6
6
  export * as call from './call/index.js'
7
- export * as clone from './clone/index.js'
8
7
  export * as deleteproperties from './deleteproperties/index.js'
8
+ export * as clone from './clone/index.js'
9
9
  export * as equals from './equals/index.js'
10
10
  export * as getattribute from './getattribute/index.js'
11
- export * as getproperty from './getproperty/index.js'
12
11
  export * as getproperties from './getproperties/index.js'
12
+ export * as getproperty from './getproperty/index.js'
13
13
  export * as hjparse from './hjparse/index.js'
14
14
  export * as hjstringify from './hjstringify/index.js'
15
- export * as if from './if/index.js'
16
15
  export * as initialize from './initialize/index.js'
16
+ export * as if from './if/index.js'
17
17
  export * as join from './join/index.js'
18
18
  export * as length from './length/index.js'
19
19
  export * as map from './map/index.js'
20
20
  export * as negate from './negate/index.js'
21
- export * as notrailing from './notrailing/index.js'
22
21
  export * as or from './or/index.js'
22
+ export * as notrailing from './notrailing/index.js'
23
23
  export * as pickrandom from './pickrandom/index.js'
24
24
  export * as populate from './populate/index.js'
25
- export * as push from './push/index.js'
26
25
  export * as print from './print/index.js'
26
+ export * as push from './push/index.js'
27
27
  export * as pusheach from './pusheach/index.js'
28
28
  export * as recordtoarray from './recordtoarray/index.js'
29
29
  export * as removeattribute from './removeattribute/index.js'
30
30
  export * as removeclass from './removeclass/index.js'
31
31
  export * as renameproperty from './renameproperty/index.js'
32
32
  export * as replace from './replace/index.js'
33
- export * as set from './set/index.js'
34
33
  export * as select from './select/index.js'
35
- export * as setattribute from './setattribute/index.js'
36
34
  export * as setproperty from './setproperty/index.js'
35
+ export * as setattribute from './setattribute/index.js'
36
+ export * as set from './set/index.js'
37
+ export * as sorton from './sorton/index.js'
37
38
  export * as split from './split/index.js'
38
39
  export * as spread from './spread/index.js'
39
40
  export * as toarray from './toarray/index.js'
40
- export * as toboolean from './toboolean/index.js'
41
- export * as toggleclass from './toggleclass/index.js'
42
41
  export * as toelement from './toelement/index.js'
42
+ export * as toggleclass from './toggleclass/index.js'
43
43
  export * as tonodelist from './tonodelist/index.js'
44
- export * as tonumber from './tonumber/index.js'
45
- export * as sorton from './sorton/index.js'
46
44
  export * as tonull from './tonull/index.js'
47
- export * as toref from './toref/index.js'
45
+ export * as tonumber from './tonumber/index.js'
46
+ export * as toboolean from './toboolean/index.js'
47
+ export * as torecord from './torecord/index.js'
48
48
  export * as tostring from './tostring/index.js'
49
- export * as transformselected from './transformselected/index.js'
49
+ export * as toref from './toref/index.js'
50
50
  export * as totext from './totext/index.js'
51
+ export * as transformselected from './transformselected/index.js'
51
52
  export * as trim from './trim/index.js'
52
- export * as torecord from './torecord/index.js'
@@ -1,13 +1,13 @@
1
- export * as any from './any/index.js'
2
1
  export * as array from './array/index.js'
2
+ export * as any from './any/index.js'
3
3
  export * as boolean from './boolean/index.js'
4
- export * as guess from './guess/index.js'
5
4
  export * as get from './get/index.js'
6
5
  export * as element from './element/index.js'
6
+ export * as guess from './guess/index.js'
7
7
  export * as nodelist from './nodelist/index.js'
8
- export * as number from './number/index.js'
9
- export * as null from './null/index.js'
10
8
  export * as record from './record/index.js'
9
+ export * as null from './null/index.js'
11
10
  export * as ref from './ref/index.js'
12
11
  export * as string from './string/index.js'
13
12
  export * as text from './text/index.js'
13
+ export * as number from './number/index.js'
@@ -1,13 +1,13 @@
1
- export * as any from './any/index.js'
2
1
  export * as array from './array/index.js'
2
+ export * as any from './any/index.js'
3
3
  export * as boolean from './boolean/index.js'
4
- export * as guess from './guess/index.js'
5
4
  export * as get from './get/index.js'
6
5
  export * as element from './element/index.js'
6
+ export * as guess from './guess/index.js'
7
7
  export * as nodelist from './nodelist/index.js'
8
- export * as number from './number/index.js'
9
- export * as null from './null/index.js'
10
8
  export * as record from './record/index.js'
9
+ export * as null from './null/index.js'
11
10
  export * as ref from './ref/index.js'
12
11
  export * as string from './string/index.js'
13
12
  export * as text from './text/index.js'
13
+ export * as number from './number/index.js'
@@ -1,10 +1,10 @@
1
- export * as deepSelect from './deep-select/index.js'
2
1
  export * as getNodeAncestors from './get-node-ancestors/index.js'
3
2
  export * as getPositionInsideParent from './get-position-inside-parent/index.js'
4
3
  export * as hyperJson from './hyper-json/index.js'
5
4
  export * as insertNode from './insert-node/index.js'
5
+ export * as deepSelect from './deep-select/index.js'
6
6
  export * as placeholders from './placeholders/index.js'
7
7
  export * as replaceInElement from './replace-in-element/index.js'
8
- export * as stringToNodes from './string-to-nodes/index.js'
9
8
  export * as selectorToElement from './selector-to-element/index.js'
9
+ export * as stringToNodes from './string-to-nodes/index.js'
10
10
  export * as watchSelection from './watch-selection/index.js'
@@ -1,10 +1,10 @@
1
- export * as deepSelect from './deep-select/index.js'
2
1
  export * as getNodeAncestors from './get-node-ancestors/index.js'
3
2
  export * as getPositionInsideParent from './get-position-inside-parent/index.js'
4
3
  export * as hyperJson from './hyper-json/index.js'
5
4
  export * as insertNode from './insert-node/index.js'
5
+ export * as deepSelect from './deep-select/index.js'
6
6
  export * as placeholders from './placeholders/index.js'
7
7
  export * as replaceInElement from './replace-in-element/index.js'
8
- export * as stringToNodes from './string-to-nodes/index.js'
9
8
  export * as selectorToElement from './selector-to-element/index.js'
9
+ export * as stringToNodes from './string-to-nodes/index.js'
10
10
  export * as watchSelection from './watch-selection/index.js'
@@ -1,9 +1,9 @@
1
- export * as arrays from './arrays/index.js'
2
1
  export * as booleans from './booleans/index.js'
3
2
  export * as colors from './colors/index.js'
4
3
  export * as css from './css/index.js'
5
- export * as html from './html/index.js'
6
4
  export * as errors from './errors/index.js'
5
+ export * as arrays from './arrays/index.js'
6
+ export * as html from './html/index.js'
7
7
  export * as misc from './misc/index.js'
8
8
  export * as numbers from './numbers/index.js'
9
9
  export * as objects from './objects/index.js'
package/agnostic/index.js CHANGED
@@ -1,9 +1,9 @@
1
- export * as arrays from './arrays/index.js'
2
1
  export * as booleans from './booleans/index.js'
3
2
  export * as colors from './colors/index.js'
4
3
  export * as css from './css/index.js'
5
- export * as html from './html/index.js'
6
4
  export * as errors from './errors/index.js'
5
+ export * as arrays from './arrays/index.js'
6
+ export * as html from './html/index.js'
7
7
  export * as misc from './misc/index.js'
8
8
  export * as numbers from './numbers/index.js'
9
9
  export * as objects from './objects/index.js'
@@ -1,12 +1,12 @@
1
+ export * as assert from './assert/index.js'
1
2
  export * as cast from './cast/index.js'
2
- export * as connection from './connection/index.js'
3
3
  export * as crawler from './crawler/index.js'
4
- export * as assert from './assert/index.js'
5
4
  export * as dataSize from './data-size/index.js'
6
- export * as isNullish from './is-nullish/index.js'
7
- export * as crossenv from './crossenv/index.js'
5
+ export * as connection from './connection/index.js'
8
6
  export * as isConstructorFunction from './is-constructor-function/index.js'
9
7
  export * as logs from './logs/index.js'
10
8
  export * as loremIpsum from './lorem-ipsum/index.js'
11
- export * as normalizeExtension from './normalize-extension/index.js'
9
+ export * as crossenv from './crossenv/index.js'
12
10
  export * as outcome from './outcome/index.js'
11
+ export * as isNullish from './is-nullish/index.js'
12
+ export * as normalizeExtension from './normalize-extension/index.js'
@@ -1,12 +1,12 @@
1
+ export * as assert from './assert/index.js'
1
2
  export * as cast from './cast/index.js'
2
- export * as connection from './connection/index.js'
3
3
  export * as crawler from './crawler/index.js'
4
- export * as assert from './assert/index.js'
5
4
  export * as dataSize from './data-size/index.js'
6
- export * as isNullish from './is-nullish/index.js'
7
- export * as crossenv from './crossenv/index.js'
5
+ export * as connection from './connection/index.js'
8
6
  export * as isConstructorFunction from './is-constructor-function/index.js'
9
7
  export * as logs from './logs/index.js'
10
8
  export * as loremIpsum from './lorem-ipsum/index.js'
11
- export * as normalizeExtension from './normalize-extension/index.js'
9
+ export * as crossenv from './crossenv/index.js'
12
10
  export * as outcome from './outcome/index.js'
11
+ export * as isNullish from './is-nullish/index.js'
12
+ export * as normalizeExtension from './normalize-extension/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as absoluteModulo from './absolute-modulo/index.js'
2
- export * as clamp from './clamp/index.js'
3
2
  export * as approximateRational from './approximate-rational/index.js'
3
+ export * as clamp from './clamp/index.js'
4
4
  export * as geometricProgressions from './geometric-progressions/index.js'
5
- export * as round from './round/index.js'
6
5
  export * as interpolate from './interpolate/index.js'
6
+ export * as round from './round/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as absoluteModulo from './absolute-modulo/index.js'
2
- export * as clamp from './clamp/index.js'
3
2
  export * as approximateRational from './approximate-rational/index.js'
3
+ export * as clamp from './clamp/index.js'
4
4
  export * as geometricProgressions from './geometric-progressions/index.js'
5
- export * as round from './round/index.js'
6
5
  export * as interpolate from './interpolate/index.js'
6
+ export * as round from './round/index.js'
@@ -1,9 +1,9 @@
1
1
  export * as deepGetProperty from './deep-get-property/index.js'
2
- export * as enums from './enums/index.js'
3
2
  export * as flattenGetters from './flatten-getters/index.js'
4
3
  export * as isObject from './is-object/index.js'
4
+ export * as isRecord from './is-record/index.js'
5
5
  export * as recordFormat from './record-format/index.js'
6
6
  export * as recordMap from './record-map/index.js'
7
+ export * as enums from './enums/index.js'
7
8
  export * as sortKeys from './sort-keys/index.js'
8
9
  export * as validation from './validation/index.js'
9
- export * as isRecord from './is-record/index.js'
@@ -1,9 +1,9 @@
1
1
  export * as deepGetProperty from './deep-get-property/index.js'
2
- export * as enums from './enums/index.js'
3
2
  export * as flattenGetters from './flatten-getters/index.js'
4
3
  export * as isObject from './is-object/index.js'
4
+ export * as isRecord from './is-record/index.js'
5
5
  export * as recordFormat from './record-format/index.js'
6
6
  export * as recordMap from './record-map/index.js'
7
+ export * as enums from './enums/index.js'
7
8
  export * as sortKeys from './sort-keys/index.js'
8
9
  export * as validation from './validation/index.js'
9
- export * as isRecord from './is-record/index.js'
@@ -1,3 +1,3 @@
1
+ export * as hexChar from './hex-char/index.js'
1
2
  export * as random from './random/index.js'
2
3
  export * as uuid from './uuid/index.js'
3
- export * as hexChar from './hex-char/index.js'
@@ -1,3 +1,3 @@
1
+ export * as hexChar from './hex-char/index.js'
1
2
  export * as random from './random/index.js'
2
3
  export * as uuid from './uuid/index.js'
3
- export * as hexChar from './hex-char/index.js'
@@ -3,6 +3,6 @@ export * as matches from './matches/index.js'
3
3
  export * as normalizeIndent from './normalize-indent/index.js'
4
4
  export * as parseTable from './parse-table/index.js'
5
5
  export * as replaceAll from './replace-all/index.js'
6
- export * as toAlphanum from './to-alphanum/index.js'
7
6
  export * as splitTrim from './split-trim/index.js'
7
+ export * as toAlphanum from './to-alphanum/index.js'
8
8
  export * as trim from './trim/index.js'
@@ -3,6 +3,6 @@ export * as matches from './matches/index.js'
3
3
  export * as normalizeIndent from './normalize-indent/index.js'
4
4
  export * as parseTable from './parse-table/index.js'
5
5
  export * as replaceAll from './replace-all/index.js'
6
- export * as toAlphanum from './to-alphanum/index.js'
7
6
  export * as splitTrim from './split-trim/index.js'
7
+ export * as toAlphanum from './to-alphanum/index.js'
8
8
  export * as trim from './trim/index.js'
@@ -1,2 +1,2 @@
1
- export * as srtTimecodeToMs from './srt-timecode-to-ms/index.js'
2
1
  export * as parseSrt from './parse-srt/index.js'
2
+ export * as srtTimecodeToMs from './srt-timecode-to-ms/index.js'
@@ -1,2 +1,2 @@
1
- export * as srtTimecodeToMs from './srt-timecode-to-ms/index.js'
2
1
  export * as parseSrt from './parse-srt/index.js'
2
+ export * as srtTimecodeToMs from './srt-timecode-to-ms/index.js'
@@ -4,10 +4,10 @@
4
4
  * Supported tokens (placeholders must be wrapped in `{{...}}`):
5
5
  *
6
6
  * **Day**
7
- * - `D` : Day of month (1–31)
8
- * - `DD` : Day of month, padded (01–31)
9
- * - `d` : Short weekday name (Mon, Tue, ...)
10
- * - `dd` : Full weekday name (Monday, Tuesday, ...)
7
+ * - `D` / `d` : Day of month (1–31)
8
+ * - `DD` / `dd` : Day of month, padded (01–31)
9
+ * - `ddd` : Short weekday name (Mon, Tue, ...)
10
+ * - `dddd` : Full weekday name (Monday, Tuesday, ...)
11
11
  *
12
12
  * **Month**
13
13
  * - `M` : Month number (1–12)
@@ -45,6 +45,21 @@
45
45
  * @returns Formatted date string. An unknown token is left untouched, braces
46
46
  * included.
47
47
  * @see {@link getDateParts} to reach the same parts as plain values, unpadded.
48
+ * @see {@link formatDuration} — the same template grammar, for a length of time
49
+ * rather than a point in it.
50
+ *
51
+ * @remarks
52
+ * This function and `formatDuration` share one grammar, so a reader who has learnt
53
+ * either knows the other: tokens are delimited by `{{…}}` and everything outside
54
+ * them is literal; the bare token is the plain number and the doubled one is that
55
+ * same number padded to two digits; `ms` is padded to three; and an unknown token
56
+ * is left as written rather than blanked, so a typo shows.
57
+ *
58
+ * No token means two different kinds of thing across the two. What differs is only
59
+ * what each domain has to offer: a date has a meridiem, an ordinal suffix and a
60
+ * 12-hour clock (`h`/`hh`, against `H`/`HH` for the 24-hour one), while a duration
61
+ * has weeks and frames. The weekday names are `ddd`/`dddd`, mirroring `MMM`/`MMMM`
62
+ * — `d`/`dd` are the day number, as they are in a duration.
48
63
  *
49
64
  * @example
50
65
  * formatDate(new Date(2026, 0, 1, 15, 5), '{{YYYY}}-{{MM}}-{{DD}} {{hh}}:{{mm}} {{A}}')
@@ -2,7 +2,7 @@ import { getDateParts } from './parts.js';
2
2
  // Alternation is ordered, and the first branch that fits wins — so the longest
3
3
  // tokens come first. `MM` ahead of `MMMM` would only work by backtracking off the
4
4
  // closing braces, which is true but not something a reader should have to derive.
5
- const tokenRegexp = /\{\{(MMMM|YYYY|MMM|DD|dd|MM|YY|HH|hh|mm|ss|th|ms|D|d|M|H|h|m|s|A|a)\}\}/gv;
5
+ const tokenRegexp = /\{\{(MMMM|YYYY|dddd|MMM|ddd|DD|dd|MM|YY|HH|hh|mm|ss|th|ms|D|d|M|H|h|m|s|A|a)\}\}/gv;
6
6
  function pad(value, length) {
7
7
  return `${value}`.padStart(length, '0');
8
8
  }
@@ -14,8 +14,10 @@ function pad(value, length) {
14
14
  const renderers = {
15
15
  'D': parts => `${parts.D}`,
16
16
  'DD': parts => pad(parts.D, 2),
17
- 'd': parts => parts.d,
18
- 'dd': parts => parts.dd,
17
+ 'd': parts => `${parts.D}`,
18
+ 'dd': parts => pad(parts.D, 2),
19
+ 'ddd': parts => parts.ddd,
20
+ 'dddd': parts => parts.dddd,
19
21
  'M': parts => `${parts.M}`,
20
22
  'MM': parts => pad(parts.M, 2),
21
23
  'MMM': parts => parts.MMM,
@@ -41,10 +43,10 @@ const renderers = {
41
43
  * Supported tokens (placeholders must be wrapped in `{{...}}`):
42
44
  *
43
45
  * **Day**
44
- * - `D` : Day of month (1–31)
45
- * - `DD` : Day of month, padded (01–31)
46
- * - `d` : Short weekday name (Mon, Tue, ...)
47
- * - `dd` : Full weekday name (Monday, Tuesday, ...)
46
+ * - `D` / `d` : Day of month (1–31)
47
+ * - `DD` / `dd` : Day of month, padded (01–31)
48
+ * - `ddd` : Short weekday name (Mon, Tue, ...)
49
+ * - `dddd` : Full weekday name (Monday, Tuesday, ...)
48
50
  *
49
51
  * **Month**
50
52
  * - `M` : Month number (1–12)
@@ -82,6 +84,21 @@ const renderers = {
82
84
  * @returns Formatted date string. An unknown token is left untouched, braces
83
85
  * included.
84
86
  * @see {@link getDateParts} to reach the same parts as plain values, unpadded.
87
+ * @see {@link formatDuration} — the same template grammar, for a length of time
88
+ * rather than a point in it.
89
+ *
90
+ * @remarks
91
+ * This function and `formatDuration` share one grammar, so a reader who has learnt
92
+ * either knows the other: tokens are delimited by `{{…}}` and everything outside
93
+ * them is literal; the bare token is the plain number and the doubled one is that
94
+ * same number padded to two digits; `ms` is padded to three; and an unknown token
95
+ * is left as written rather than blanked, so a typo shows.
96
+ *
97
+ * No token means two different kinds of thing across the two. What differs is only
98
+ * what each domain has to offer: a date has a meridiem, an ordinal suffix and a
99
+ * 12-hour clock (`h`/`hh`, against `H`/`HH` for the 24-hour one), while a duration
100
+ * has weeks and frames. The weekday names are `ddd`/`dddd`, mirroring `MMM`/`MMMM`
101
+ * — `d`/`dd` are the day number, as they are in a duration.
85
102
  *
86
103
  * @example
87
104
  * formatDate(new Date(2026, 0, 1, 15, 5), '{{YYYY}}-{{MM}}-{{DD}} {{hh}}:{{mm}} {{A}}')
@@ -53,11 +53,24 @@ describe('formatDate', () => {
53
53
  });
54
54
  describe('locales', () => {
55
55
  it('names the weekday and the month in English by default', () => {
56
- expect(formatDate(thursdayAfternoon, '{{dd}} {{d}} {{MMMM}} {{MMM}}'))
56
+ expect(formatDate(thursdayAfternoon, '{{dddd}} {{ddd}} {{MMMM}} {{MMM}}'))
57
57
  .toBe('Thursday Thu January Jan');
58
58
  });
59
59
  it('names them in the requested locale', () => {
60
- expect(formatDate(thursdayAfternoon, '{{dd}} {{MMMM}}', 'fr')).toBe('jeudi janvier');
60
+ expect(formatDate(thursdayAfternoon, '{{dddd}} {{MMMM}}', 'fr')).toBe('jeudi janvier');
61
+ });
62
+ });
63
+ describe('day of month', () => {
64
+ it('reads the day number under d as well as under D', () => {
65
+ expect(formatDate(thursdayAfternoon, '{{d}} {{D}}')).toBe('1 1');
66
+ expect(formatDate(thursdayAfternoon, '{{dd}} {{DD}}')).toBe('01 01');
67
+ });
68
+ // The whole point of moving the weekday names to `ddd`/`dddd`: `{{d}}` and
69
+ // `{{dd}}` now read as a number here and in `formatDuration` alike, and the
70
+ // doubled form is the padded twin of the bare one everywhere.
71
+ it('does not let the shorter spellings swallow the weekday names', () => {
72
+ expect(formatDate(thursdayAfternoon, '{{ddd}}')).toBe('Thu');
73
+ expect(formatDate(thursdayAfternoon, '{{dddd}}')).toBe('Thursday');
61
74
  });
62
75
  });
63
76
  describe('ordinal suffix', () => {
@@ -104,8 +117,8 @@ describe('getDateParts', () => {
104
117
  const parts = getDateParts(thursdayAfternoon);
105
118
  expect(parts).toMatchObject({
106
119
  dayOfMonth: parts.D,
107
- shortWeekdayName: parts.d,
108
- fullWeekdayName: parts.dd,
120
+ shortWeekdayName: parts.ddd,
121
+ fullWeekdayName: parts.dddd,
109
122
  monthNumber: parts.M,
110
123
  shortMonthName: parts.MMM,
111
124
  fullMonthName: parts.MMMM,
@@ -134,15 +147,15 @@ describe('getDateParts', () => {
134
147
  describe('locales', () => {
135
148
  it('localises the weekday and month names', () => {
136
149
  expect(getDateParts(thursdayAfternoon, 'fr')).toMatchObject({
137
- d: 'jeu.',
138
- dd: 'jeudi',
150
+ ddd: 'jeu.',
151
+ dddd: 'jeudi',
139
152
  MMM: 'janv.',
140
153
  MMMM: 'janvier'
141
154
  });
142
155
  });
143
156
  it('falls back to English on a locale the runtime does not support', () => {
144
157
  expect(getDateParts(thursdayAfternoon, 'xx')).toMatchObject({
145
- dd: 'Thursday',
158
+ dddd: 'Thursday',
146
159
  MMMM: 'January',
147
160
  th: 'st'
148
161
  });
@@ -68,9 +68,9 @@ export function getDateParts(date, locale = 'en') {
68
68
  const tokens = {
69
69
  'D': day,
70
70
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
71
- 'd': weekdayNames(safeLocale, 'short')[dayOfWeek],
71
+ 'ddd': weekdayNames(safeLocale, 'short')[dayOfWeek],
72
72
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
73
- 'dd': weekdayNames(safeLocale, 'long')[dayOfWeek],
73
+ 'dddd': weekdayNames(safeLocale, 'long')[dayOfWeek],
74
74
  'M': month + 1,
75
75
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
76
76
  'MMM': monthNames(safeLocale, 'short')[month],
@@ -89,8 +89,8 @@ export function getDateParts(date, locale = 'en') {
89
89
  return {
90
90
  ...tokens,
91
91
  dayOfMonth: tokens.D,
92
- shortWeekdayName: tokens.d,
93
- fullWeekdayName: tokens.dd,
92
+ shortWeekdayName: tokens.ddd,
93
+ fullWeekdayName: tokens.dddd,
94
94
  monthNumber: tokens.M,
95
95
  shortMonthName: tokens.MMM,
96
96
  fullMonthName: tokens.MMMM,