title: Which alternative for type "object" could be in TypeScript?
body: <p>The rule <a href="https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-types.md" rel="noreferrer">ban-types</a> of newest <a href="https://github.com/typescript-eslint/typescript-eslint" rel="noreferrer">@typescript-eslint/ban-types</a> disallows <code>object</code> type as default.
  I need to refactor my type analyzing functions according this rule.</p>
  
  <p>I understand that TypeScript-ESLint is not source of truth, but wherever I follow to <code>ban-types</code> or violate it, I need to comprehend my decision.</p>
  
  <pre class="lang-js prettyprint-override"><code>function isNonNullObject(potentialObject: unknown): potentialObject is object {
    return typeof potentialObject === "object" &amp;&amp; potentialObject !== null;
  }
  
  function isNonEmptyObject(potentialObject: unknown): potentialObject is object {
    if (typeof potentialObject !== "object" || potentialObject === null) {
      return false;
    }
    return Object.entries(potentialObject as {[key: string]: unknown}).length &gt; 0;
  }
  
  
  function isEmptyObject(potentialObject: unknown): potentialObject is object {
    if (typeof potentialObject !== "object" || potentialObject === null) {
      return false;
    }
    return Object.entries(potentialObject as {[key: string]: unknown}).length === 0;
  }
  </code></pre>
  
  <p>The basic usage of this function external data analysis (from API or files):</p>
  
  <pre class="lang-js prettyprint-override"><code>if (isNonNullObject(data)) {
    throw new Error("The data is invalid; object expected.");
  }
  </code></pre>
  
  <p>Should I replace <code>object</code> to other type in this case, or exclusively here <code>object</code> is allowable?</p>
  
  <h2>Usage example: data fetching</h2>
  
  <p>In real projects, data analyzing functionality is being wrapped to special utility, but it's the concept as below:</p>
  
  <pre class="lang-js prettyprint-override"><code>type ValidResponseData = {
      products: Array&lt;Products&gt;;
      productsCount: number;
  };
  
  
  @Component
  class ProductsListPage extends Vue {
  
    private products: Array&lt;Products&gt; = [];
    private productsCount: number = 0;
  
    private async created(): Promise&lt;void&gt; {
  
      try {
  
        // We must not trust to external data, so it's 'unknown'
        const responseData: unknown = await ProductFetchingAPI.fetchAllProducts();
  
        if (!isNonNullObject(responseData)) {
         throw new Error(
           `The response data data is invalid: non-null object expected, real type: ${typeof responseData},` +
           `, value: ${responseData}.`
         );
        }
  
        // Below checks are meaningless if "responseData" is not object.
        if (!Object.prototype.hasOwnProperty.call(responseData, "products")) {
          throw new Error(
            "Expected that response data has 'products' property but it's missing".
          );
        }
        if (!Object.prototype.hasOwnProperty.call(responseData, "productsCount")) {
           throw new Error(
             "Expected that response data has 'productsCount' property but it's missing".
           );
        }
  
        // 'products' and 'productsCount' analysis ....
        const validResponseData: ValidResponseData = responseData as ValidResponseData;
  
        this.products = validResponseData.products;
        this.productsCount = validResponseData.productsCount;
  
      } catch (error) {
        NotificationBarService.displayNotificationBar({
          type: NotificationBarService.NotificationsTypes.error,
          originalError: error,
          text: "Failed to fetch products."
        });           
      }
    }
  }
  </code></pre>
  
  <h2>Usage example: data analyze from file</h2>
  
  <pre class="lang-js prettyprint-override"><code>const rawData: unknown = /* parse data from the file by appropriate library ... */;
  
  if (!isNonNullObject(rawData)) {
   throw new Error(
     `The file content is invalid: non-null object expected, real type: ${typeof rawData},` +
       `, value: ${rawData}.`
   );
  }
  
  // Without isNonNullObject(rawData), we can not execute below loop
  for (const value of Object.entires(rawData)) {
      // check each property
  }
  </code></pre>