Home > @rushstack/node-core-library > LegacyAdapters

LegacyAdapters class

Helper functions used when interacting with APIs that do not follow modern coding practices.

Signature:

export declare class LegacyAdapters 

Methods

Method Modifiers Description
convertCallbackToPromise(fn) static This function wraps a function with a callback in a promise.
convertCallbackToPromise(fn, arg1) static  
convertCallbackToPromise(fn, arg1, arg2) static  
convertCallbackToPromise(fn, arg1, arg2, arg3) static  
convertCallbackToPromise(fn, arg1, arg2, arg3, arg4) static  
scrubError(error) static Normalizes an object into an Error object.
sortStable(array, compare) static Prior to Node 11.x, the Array.sort() algorithm is not guaranteed to be stable. If you need a stable sort, you can use sortStable() as a workaround.