Skip to content

Commit 8152c10

Browse files
committed
docs(changeset):
1 parent a0668cb commit 8152c10

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

.changeset/new-forks-cough.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/metro-service/src/asset/write.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
// https://github.com/react-native-community/cli/blob/716555851b442a83a1bf5e0db27b6226318c9a69/packages/cli-plugin-metro/src/commands/bundle/saveAssets.ts
22

33
import { 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";
66
import { filterPlatformAssetScales } from "./filter";
77
import 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;

0 commit comments

Comments
 (0)