これは非常にシンプルで簡単です。コードを見てください。JavaScript拡張機能の背後にある基本概念を理解してみてください。
まず、JavaScript関数を拡張します。
function Base(props) {
    const _props = props
    this.getProps = () => _props
    // We can make method private by not binding it to this object. 
    // Hence it is not exposed when we return this.
    const privateMethod = () => "do internal stuff" 
    return this
}
次の方法で子関数を作成することにより、この関数を拡張できます
function Child(props) {
    const parent = Base(props)
    this.getMessage = () => `Message is ${parent.getProps()}`;
    // You can remove the line below to extend as in private inheritance, 
    // not exposing parent function properties and method.
    this.prototype = parent
    return this
}
これで、Child関数を次のように使用できます。
let childObject = Child("Secret Message")
console.log(childObject.getMessage())     // logs "Message is Secret Message"
console.log(childObject.getProps())       // logs "Secret Message"
このようにJavaScriptクラスを拡張することで、JavaScript関数を作成することもできます。
class BaseClass {
    constructor(props) {
        this.props = props
        // You can remove the line below to make getProps method private. 
        // As it will not be binded to this, but let it be
        this.getProps = this.getProps.bind(this)
    }
    getProps() {
        return this.props
    }
}
このクラスを次のようなChild関数で拡張してみましょう。
function Child(props) {
    let parent = new BaseClass(props)
    const getMessage = () => `Message is ${parent.getProps()}`;
    return { ...parent, getMessage} // I have used spread operator. 
}
ここでも同様に、Child関数を次のように使用して同様の結果を得ることができます。
let childObject = Child("Secret Message")
console.log(childObject.getMessage())     // logs "Message is Secret Message"
console.log(childObject.getProps())       // logs "Secret Message"
JavaScriptは非常に簡単な言語です。ほとんど何でもできます。JavaScriptをご利用いただきありがとうございます。あなたのケースで使用するアイデアを提供できたと思います。