Skip to content

Commit a0c02af

Browse files
alan-agius4dgp1130
authored andcommitted
refactor(@angular-devkit/core): remove deprecated fs, object and array APIs
BREAKING CHANGE: The below APIs have been removed without replacement. Users should leverage other Node.js or other APIs. - `fs` namespace - `clean` - `mapObject`
1 parent 0a1cd58 commit a0c02af

File tree

7 files changed

+2
-91
lines changed

7 files changed

+2
-91
lines changed

goldens/public-api/angular_devkit/core/node/index.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,6 @@ type FileBufferLike = ArrayBufferLike;
229229
// @public (undocumented)
230230
function fileBufferToString(fileBuffer: FileBuffer): string;
231231

232-
declare namespace fs {
233-
export {
234-
isFile,
235-
isDirectory
236-
}
237-
}
238-
export { fs }
239-
240232
// @public (undocumented)
241233
function getTypesOfSchema(schema: JsonSchema): Set<string>;
242234

@@ -293,12 +285,6 @@ class IndentLogger extends Logger {
293285
constructor(name: string, parent?: Logger | null, indentation?: string);
294286
}
295287

296-
// @public @deprecated (undocumented)
297-
function isDirectory(filePath: string): boolean;
298-
299-
// @public @deprecated (undocumented)
300-
function isFile(filePath: string): boolean;
301-
302288
// @public (undocumented)
303289
function isJobHandler<A extends JsonValue, I extends JsonValue, O extends JsonValue>(value: unknown): value is JobHandler<A, I, O>;
304290

goldens/public-api/angular_devkit/core/src/index.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ export class CircularDependencyFoundException extends BaseException {
189189
// @public
190190
function classify(str: string): string;
191191

192-
// @public @deprecated (undocumented)
193-
export function clean<T>(array: Array<T | undefined>): Array<T>;
194-
195192
// @public (undocumented)
196193
export class ContentHasMutatedException extends BaseException {
197194
constructor(path: string);
@@ -353,7 +350,7 @@ function dasherize(str: string): string;
353350
// @public
354351
function decamelize(str: string): string;
355352

356-
// @public (undocumented)
353+
// @public
357354
export function deepCopy<T>(value: T): T;
358355

359356
// @public (undocumented)
@@ -1037,13 +1034,6 @@ class LoggingAnalytics implements Analytics {
10371034
// @public (undocumented)
10381035
type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'fatal';
10391036

1040-
// @public @deprecated (undocumented)
1041-
export function mapObject<T, V>(obj: {
1042-
[k: string]: T;
1043-
}, mapper: (k: string, v: T) => V): {
1044-
[k: string]: V;
1045-
};
1046-
10471037
// @public (undocumented)
10481038
export class MergeConflictException extends BaseException {
10491039
constructor(path: string);

packages/angular_devkit/core/node/fs.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.

packages/angular_devkit/core/node/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
*/
88

99
import * as experimental from './experimental/jobs/job-registry';
10-
import * as fs from './fs';
1110

1211
export * from './cli-logger';
1312
export * from './host';
1413

15-
export { experimental, fs };
14+
export { experimental };

packages/angular_devkit/core/src/utils/array.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/angular_devkit/core/src/utils/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import * as tags from './literals';
1010
import * as strings from './strings';
1111

12-
export * from './array';
1312
export * from './object';
1413
export * from './template';
1514
export * from './partially-ordered-set';

packages/angular_devkit/core/src/utils/object.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,6 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
/** @deprecated Since v12.0, unused by the Angular tooling */
10-
export function mapObject<T, V>(
11-
obj: { [k: string]: T },
12-
mapper: (k: string, v: T) => V,
13-
): { [k: string]: V } {
14-
return Object.keys(obj).reduce((acc: { [k: string]: V }, k: string) => {
15-
acc[k] = mapper(k, obj[k]);
16-
17-
return acc;
18-
}, {});
19-
}
20-
219
const copySymbol = Symbol();
2210

2311
export function deepCopy<T>(value: T): T {

0 commit comments

Comments
 (0)