Skip to content

Commit 34edb7d

Browse files
committed
build(deps): bump @flex-development/tutils from 6.0.0-alpha.10 to 6.0.0-alpha.12
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 68ce28c commit 34edb7d

35 files changed

+247
-177
lines changed

.eslintrc.base.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ const config = {
246246
allowedNames: ['self']
247247
}
248248
],
249-
'@typescript-eslint/no-throw-literal': 2,
249+
'@typescript-eslint/no-throw-literal': 0,
250250
'@typescript-eslint/no-type-alias': 0,
251251
'@typescript-eslint/no-unnecessary-boolean-literal-compare': [
252252
2,
@@ -581,6 +581,7 @@ const config = {
581581
'no-return-await': 0,
582582
'no-shadow': 0,
583583
'no-sparse-arrays': 0,
584+
'no-throw-literal': 0,
584585
'no-unused-expressions': 0,
585586
'no-unused-vars': 0,
586587
'no-use-before-define': 0,
@@ -661,7 +662,7 @@ const config = {
661662
terms: ['@fixme', '@todo']
662663
}
663664
],
664-
'unicorn/explicit-length-check': 2,
665+
'unicorn/explicit-length-check': 0,
665666
'unicorn/filename-case': [
666667
2,
667668
{
@@ -858,7 +859,6 @@ const config = {
858859
'promise/valid-params': 0,
859860
'unicorn/consistent-destructuring': 0,
860861
'unicorn/error-message': 0,
861-
'unicorn/explicit-length-check': 0,
862862
'unicorn/no-array-for-each': 0,
863863
'unicorn/no-hex-escape': 0,
864864
'unicorn/no-useless-undefined': 0,

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
"typecheck:watch": "vitest typecheck"
8181
},
8282
"dependencies": {
83-
"@flex-development/errnode": "1.5.0",
84-
"@flex-development/tutils": "6.0.0-alpha.10"
83+
"@flex-development/errnode": "2.0.0",
84+
"@flex-development/tutils": "6.0.0-alpha.12"
8585
},
8686
"devDependencies": {
8787
"@commitlint/cli": "17.6.3",
@@ -164,7 +164,7 @@
164164
},
165165
"resolutions": {
166166
"@ardatan/sync-fetch": "larsgw/sync-fetch#head=worker_threads",
167-
"@flex-development/tutils": "6.0.0-alpha.10"
167+
"@flex-development/tutils": "6.0.0-alpha.12"
168168
},
169169
"engines": {
170170
"node": ">=16.20.0",

src/interfaces/__tests__/parsed-path.spec-d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ import type TestSubject from '../parsed-path'
77

88
describe('unit-d:interfaces/ParsedPath', () => {
99
it('should match [base: string]', () => {
10-
expectTypeOf<TestSubject>().toHaveProperty('base').toBeString()
10+
expectTypeOf<TestSubject>().toHaveProperty('base').toEqualTypeOf<string>()
1111
})
1212

1313
it('should match [dir: string]', () => {
14-
expectTypeOf<TestSubject>().toHaveProperty('dir').toBeString()
14+
expectTypeOf<TestSubject>().toHaveProperty('dir').toEqualTypeOf<string>()
1515
})
1616

1717
it('should match [ext: string]', () => {
18-
expectTypeOf<TestSubject>().toHaveProperty('ext').toBeString()
18+
expectTypeOf<TestSubject>().toHaveProperty('ext').toEqualTypeOf<string>()
1919
})
2020

2121
it('should match [name: string]', () => {
22-
expectTypeOf<TestSubject>().toHaveProperty('name').toBeString()
22+
expectTypeOf<TestSubject>().toHaveProperty('name').toEqualTypeOf<string>()
2323
})
2424

2525
it('should match [root: string]', () => {
26-
expectTypeOf<TestSubject>().toHaveProperty('root').toBeString()
26+
expectTypeOf<TestSubject>().toHaveProperty('root').toEqualTypeOf<string>()
2727
})
2828
})

src/interfaces/__tests__/path-object.spec-d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
* @module pathe/interfaces/tests/unit-d/PathObject
44
*/
55

6-
import type { KeysRequired } from '@flex-development/tutils'
6+
import type { RequiredKeys } from '@flex-development/tutils'
77
import type TestSubject from '../path-object'
88

99
describe('unit-d:interfaces/PathObject', () => {
1010
it('should allow empty object', () => {
11-
expectTypeOf<KeysRequired<TestSubject>>().toBeNever()
11+
expectTypeOf<RequiredKeys<TestSubject>>().toBeNever()
1212
})
1313

1414
it('should match [base?: string]', () => {

src/interfaces/parsed-path.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @module pathe/interfaces/ParsedPath
44
*/
55

6-
import type { ExactOptionalPropertyTypes } from '@flex-development/tutils'
6+
import type { Shake } from '@flex-development/tutils'
77
import type PathObject from './path-object'
88

99
/**
@@ -17,8 +17,8 @@ import type PathObject from './path-object'
1717
*
1818
* @see [`PathObject`][3]
1919
*
20-
* @extends {ExactOptionalPropertyTypes<Required<PathObject>>}
20+
* @extends {Required<Shake<PathObject>>}
2121
*/
22-
interface ParsedPath extends ExactOptionalPropertyTypes<Required<PathObject>> {}
22+
interface ParsedPath extends Required<Shake<PathObject>> {}
2323

2424
export type { ParsedPath as default }

src/interfaces/path-object.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* @module pathe/interfaces/PathObject
44
*/
55

6+
import type { Optional } from '@flex-development/tutils'
7+
68
/**
79
* Object representing a path.
810
*/
@@ -15,7 +17,7 @@ interface PathObject {
1517
* @example
1618
* 'index.html'
1719
*/
18-
base?: string | undefined
20+
base?: Optional<string>
1921

2022
/**
2123
* Directory name or full directory path.
@@ -27,7 +29,7 @@ interface PathObject {
2729
* @example
2830
* '/home/user/dir'
2931
*/
30-
dir?: string | undefined
32+
dir?: Optional<string>
3133

3234
/**
3335
* File extension (if any).
@@ -39,7 +41,7 @@ interface PathObject {
3941
* @example
4042
* 'ts'
4143
*/
42-
ext?: string | undefined
44+
ext?: Optional<string>
4345

4446
/**
4547
* File name without extension (if any).
@@ -49,7 +51,7 @@ interface PathObject {
4951
* @example
5052
* 'index'
5153
*/
52-
name?: string | undefined
54+
name?: Optional<string>
5355

5456
/**
5557
* Root of path.
@@ -61,7 +63,7 @@ interface PathObject {
6163
* @example
6264
* 'c:\\'
6365
*/
64-
root?: string | undefined
66+
root?: Optional<string>
6567
}
6668

6769
export type { PathObject as default }

src/interfaces/pathe.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import type { Ext } from '#src/types'
7-
import type { EmptyString, Nullable } from '@flex-development/tutils'
7+
import type { EmptyString, Nilable } from '@flex-development/tutils'
88
import type PlatformPath from './platform-path'
99

1010
/**
@@ -20,11 +20,11 @@ interface Pathe extends PlatformPath {
2020
* Does nothing if a file extension is not provided.
2121
*
2222
* @param {string} path - Path to evaluate
23-
* @param {Nullable<string>} [ext] - File extension to add
23+
* @param {Nilable<string>} [ext] - File extension to add
2424
* @return {string} `path` unmodified or with `ext` appended
2525
* @throws {TypeError} If `path` is not a string or `ext` is not a string
2626
*/
27-
addExt(path: string, ext?: Nullable<string>): string
27+
addExt(path: string, ext?: Nilable<string>): string
2828

2929
/**
3030
* Changes the file extension of the given `path`.
@@ -33,11 +33,11 @@ interface Pathe extends PlatformPath {
3333
* an empty string, however, `path`'s file extension will be removed.
3434
*
3535
* @param {string} path - Path to evaluate
36-
* @param {Nullable<string>} [ext] - New file extension
36+
* @param {Nilable<string>} [ext] - New file extension
3737
* @return {string} `path` unmodified or with changed file extension
3838
* @throws {TypeError} If `path` is not a string or `ext` is not a string
3939
*/
40-
changeExt(path: string, ext?: Nullable<string>): string
40+
changeExt(path: string, ext?: Nilable<string>): string
4141

4242
/**
4343
* Appends a file extension to the given `path` if and only if the path does
@@ -47,12 +47,12 @@ interface Pathe extends PlatformPath {
4747
* Does nothing if a file extension isn't provided.
4848
*
4949
* @param {string} path - Path to evaluate
50-
* @param {Nullable<string>} [ext] - Default file extension
50+
* @param {Nilable<string>} [ext] - Default file extension
5151
* @param {string[]} [ignore] - File extensions to ignore if found
5252
* @return {string} `path` unmodified or with `ext` appended
5353
* @throws {TypeError} If `path` is not a string or `ext` is not a string
5454
*/
55-
defaultExt(path: string, ext?: Nullable<string>, ignore?: string[]): string
55+
defaultExt(path: string, ext?: Nilable<string>, ignore?: string[]): string
5656

5757
/**
5858
* Formats a file extension.
@@ -75,11 +75,11 @@ interface Pathe extends PlatformPath {
7575
* a file extension isn't provided.
7676
*
7777
* @param {string} path - Path to evaluate
78-
* @param {Nullable<string>} [ext] - File extension to removed
78+
* @param {Nilable<string>} [ext] - File extension to removed
7979
* @return {string} `path` unmodified or with `ext` removed
8080
* @throws {TypeError} If `path` is not a string or `ext` is not a string
8181
*/
82-
removeExt(path: string, ext?: Nullable<string>): string
82+
removeExt(path: string, ext?: Nilable<string>): string
8383
}
8484

8585
export type { Pathe as default }

src/internal/constants.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
* @module pathe/internal/constants
44
*/
55

6-
/**
7-
* Dot character.
8-
*
9-
* @const {string} DOT
10-
*/
11-
const DOT: string = '.'
12-
136
/**
147
* Drive path regex.
158
*
@@ -19,6 +12,8 @@ const DOT: string = '.'
1912
*
2013
* @see https://regex101.com/r/FsoDwJ
2114
*
15+
* @internal
16+
*
2217
* @const {RegExp} DRIVE_PATH_REGEX
2318
*/
2419
const DRIVE_PATH_REGEX: RegExp = /^(?<drive>(?<letter>[a-z]):(?:\/|\\{2})?)/i
@@ -29,9 +24,11 @@ const DRIVE_PATH_REGEX: RegExp = /^(?<drive>(?<letter>[a-z]):(?:\/|\\{2})?)/i
2924
* @see https://regex101.com/r/3P8YKp
3025
* @see https://learn.microsoft.com/dotnet/standard/io/file-path-formats#unc-paths
3126
*
27+
* @internal
28+
*
3229
* @const {RegExp} UNC_PATH_REGEX
3330
*/
3431
const UNC_PATH_REGEX: RegExp =
3532
/^(?<volume>[/\\]{2,}(?<host>[^/\\]+)[/\\]+(?<share>[^/\\]+)[/\\]*)(?:(?<dir>.+?)[/\\]*(?<file>[^/\\]+\..[^/\\]+)?[/\\]*(?=[/\\]*\n?$))?/
3633

37-
export { DOT, DRIVE_PATH_REGEX, UNC_PATH_REGEX }
34+
export { DRIVE_PATH_REGEX, UNC_PATH_REGEX }

src/internal/ensure-posix.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import validateString from './validate-string'
1919
* @see https://nodejs.org/api/path.html#pathdelimiter
2020
* @see https://nodejs.org/api/path.html#pathsep
2121
*
22+
* @internal
23+
*
2224
* @param {string} [path=''] - Path to ensure
2325
* @return {string} POSIX-compliant `path`
2426
* @throws {TypeError} If `path` is not a string

src/internal/is-drive-path.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import validateString from './validate-string'
2020
* @example
2121
* isDrivePath('myfile.html') // false
2222
*
23+
* @internal
24+
*
2325
* @param {string} path - Path to evaluate
2426
* @return {boolean} `true` if path starts with [drive letter][1]
2527
* @throws {TypeError} If `path` is not a string

0 commit comments

Comments
 (0)