ByteNote LogoByteNote

Navigation

  • Blog
  • 工具

    © 2025 ByteNote. All rights reserved.

    JS 深度 merge 一个对象

    Aug 2, 20229 min read
    const merge = (target, source) => {
      const keys = Object.keys(target);
      keys.forEach(k => {
        if (source.hasOwnProperty(k)) {
          if (Object.prototype.toString.call(source[k]) === '[object Object]') {
            merge(target[k], source[k]);
          } else {
            target[k] = source[k];
          }
        }
      });
    };
    

    相关文章

    next.js image onError fallback

    The provided Next.js component implements an `Avatar` function that uses the `next/image` component with an `onError` handler to switch to a fallback image URL if the primary image source fails.

    Linux下使用nc检测服务器端口是否正常

    使用nc工具通过命令"nc -zv IP地址 端口号"可以检测服务器端口是否开放,输出结果显示"Connection succeeded"表示端口开放,"Connection refused"表示端口未开放。

    CSS中fill属性有哪些实用场景?

    在CSS中,`fill`属性主要用于指定SVG图形中的填充颜色,适用于填充形状和路径,且可通过`opacity`调整透明度。

    FunctionCompute 价格计算器 serverless 费用计算

    该链接提供了阿里云函数计算服务的定价信息。

    解决 ssh默认端口修改报错

    解决SSH默认端口修改报错的方法包括关闭SELinux、修改SELINUX配置、重启sshd服务以及更新防火墙设置。