File tree 3 files changed +7
-2
lines changed
3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @secjs/utils" ,
3
- "version" : " 1.9.1 " ,
3
+ "version" : " 1.9.2 " ,
4
4
"description" : " Utils functions and classes for Node.js" ,
5
5
"license" : " MIT" ,
6
6
"author" : " João Lenon <lenon@athenna.io>" ,
Original file line number Diff line number Diff line change @@ -23,15 +23,16 @@ import {
23
23
} from 'node:fs'
24
24
25
25
import { lookup } from 'mime-types'
26
+ import { pathToFileURL } from 'node:url'
26
27
import { randomBytes } from 'node:crypto'
27
28
import { isAbsolute , parse , sep } from 'node:path'
28
29
30
+ import { Path } from '#src/Helpers/Path'
29
31
import { Json } from '#src/Helpers/Json'
30
32
import { Debug } from '#src/Helpers/Debug'
31
33
import { Parser } from '#src/Helpers/Parser'
32
34
import { Options } from '#src/Helpers/Options'
33
35
import { NotFoundFileException } from '#src/Exceptions/NotFoundFileException'
34
- import { Path } from '#src/Helpers/Path'
35
36
36
37
export class File {
37
38
/**
@@ -238,6 +239,7 @@ export class File {
238
239
name : this . name ,
239
240
base : this . base ,
240
241
path : this . path ,
242
+ href : this . href ,
241
243
mime : this . mime ,
242
244
createdAt : this . createdAt ,
243
245
accessedAt : this . accessedAt ,
@@ -682,6 +684,7 @@ export class File {
682
684
this . name = buffer . toString ( 'base64' ) . replace ( / [ ^ a - z A - Z 0 - 9 ] / g, '' )
683
685
this . base = this . name + this . extension
684
686
this . path = this . dir + '/' + this . base
687
+ this . href = pathToFileURL ( this . path ) . href
685
688
686
689
return
687
690
}
Original file line number Diff line number Diff line change @@ -170,6 +170,8 @@ export declare class File {
170
170
public base : string
171
171
172
172
public path : string
173
+
174
+ public href : string
173
175
174
176
public isCopy : boolean
175
177
You can’t perform that action at this time.
0 commit comments