File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
packages/metro-service/src/asset Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ---
Original file line number Diff line number Diff line change 11// https://github.com/react-native-community/cli/blob/716555851b442a83a1bf5e0db27b6226318c9a69/packages/cli-plugin-metro/src/commands/bundle/saveAssets.ts
22
33import { info , warn } from "@rnx-kit/console" ;
4- import * as fs from "fs" ;
5- import * as path from "path" ;
4+ import * as fs from "node: fs" ;
5+ import * as path from "node: path" ;
66import { filterPlatformAssetScales } from "./filter" ;
77import type { AssetData , SaveAssetsPlugin } from "./types" ;
88
9- function copy (
10- src : string ,
11- dest : string ,
12- callback : ( error : NodeJS . ErrnoException ) => void
13- ) : void {
9+ type CopyCallback = ( error ?: NodeJS . ErrnoException ) => void ;
10+
11+ function copy ( src : string , dest : string , callback : CopyCallback ) : void {
1412 const destDir = path . dirname ( dest ) ;
15- fs . mkdir ( destDir , { recursive : true } , ( err ? ) => {
13+ fs . mkdir ( destDir , { recursive : true } , ( err ) => {
1614 if ( err ) {
1715 callback ( err ) ;
1816 return ;
@@ -31,7 +29,7 @@ function copyAll(filesToCopy: Record<string, string>) {
3129
3230 info ( `Copying ${ queue . length } asset files` ) ;
3331 return new Promise < void > ( ( resolve , reject ) => {
34- const copyNext = ( error ?: NodeJS . ErrnoException ) => {
32+ const copyNext : CopyCallback = ( error ) => {
3533 if ( error ) {
3634 reject ( error ) ;
3735 return ;
You can’t perform that action at this time.
0 commit comments