Skip to content

Commit

Permalink
refactor(@angular-devkit/core): remove deprecated fileBuffer functi…
Browse files Browse the repository at this point in the history
…on in favor of `stringToFileBuffer`

BREAKING CHANGE: The deprecated `fileBuffer` function is no longer available. Update your code to use `stringToFileBuffer` instead to maintain compatibility.

**Note:** that this change does not affect application developers.
  • Loading branch information
alan-agius4 committed Aug 21, 2024
1 parent 90b94e0 commit 0d8a100
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions goldens/public-api/angular_devkit/core/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,6 @@ export class FileAlreadyExistException extends BaseException {
// @public (undocumented)
type FileBuffer = ArrayBuffer;

// @public @deprecated (undocumented)
const fileBuffer: TemplateTag<FileBuffer>;

// @public (undocumented)
type FileBufferLike = ArrayBufferLike;

Expand Down Expand Up @@ -1324,7 +1321,6 @@ declare namespace virtualFs {
AliasHost,
stringToFileBuffer,
fileBufferToString,
fileBuffer,
createSyncHost,
SyncHostHandler,
Empty,
Expand Down
6 changes: 0 additions & 6 deletions packages/angular_devkit/core/src/virtual-fs/host/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

import { TextDecoder, TextEncoder } from 'node:util';
import { TemplateTag } from '../../utils/literals';
import { FileBuffer } from './interface';

export function stringToFileBuffer(str: string): FileBuffer {
Expand All @@ -21,8 +20,3 @@ export function fileBufferToString(fileBuffer: FileBuffer): string {

return new TextDecoder('utf-8').decode(new Uint8Array(fileBuffer));
}

/** @deprecated use `stringToFileBuffer` instead. */
export const fileBuffer: TemplateTag<FileBuffer> = (strings, ...values) => {
return stringToFileBuffer(String.raw(strings, ...values));
};

0 comments on commit 0d8a100

Please sign in to comment.