?? GreyFile — Mystic File Browser

Current path: home/webdevt/www/wdp/wp-content/plugins/brizy/public/editor-client/src/utils/reader/



?? Go up: /home/webdevt/www/wdp/wp-content/plugins/brizy/public/editor-client/src/utils

?? Viewing: number.ts

import { Reader } from "./types";

export const read: Reader<number> = (v) => {
  switch (typeof v) {
    case "string": {
      const v_ = v !== "" ? Number(v) : NaN;
      return isNaN(v_) ? undefined : v_;
    }
    case "number":
      return isNaN(v) ? undefined : v;
    default:
      return undefined;
  }
};


??

??