Cloud Defense Logo

Products

Solutions

Company

Book A Live Demo

Top 10 Examples of "ts-util-is in functional component" in JavaScript

Dive into secure and efficient coding practices with our curated list of the top 10 examples showcasing 'ts-util-is' in functional components in JavaScript. Our advanced machine learning engine meticulously scans each line of code, cross-referencing millions of open source libraries to ensure your implementation is not just functional, but also robust and secure. Elevate your React applications to new heights by mastering the art of handling side effects, API calls, and asynchronous operations with confidence and precision.

function getConns(config) {
    if (config.connection) {
        // deprecated (v1.1.0)
        console.warn(chalk_1.default.yellow('Warning! The config `connection` object is deprecated. Use `connections` instead.'));
        var legacyConn = config.connection;
        config.connections = (ts_util_is_1.isString(legacyConn) ? legacyConn : [legacyConn]);
    }
    if (ts_util_is_1.isString(config.connections)) {
        // get form web config
        return getWebConfigConns(config.connections);
    }
    else {
        return config.connections;
    }
}
exports.getConns = getConns;
function getConns(config) {
    if (config.connection) {
        // deprecated (v1.1.0)
        console.warn(chalk_1.default.yellow('Warning! The config `connection` object is deprecated. Use `connections` instead.'));
        var legacyConn = config.connection;
        config.connections = (ts_util_is_1.isString(legacyConn) ? legacyConn : [legacyConn]);
    }
    if (ts_util_is_1.isString(config.connections)) {
        // get form web config
        return getWebConfigConns(config.connections);
    }
    else {
        return config.connections;
    }
}
exports.getConns = getConns;
getConnections() {
    if (!isString(this.connections)) {
      return this.connections;
    }

    const configFile = /\.config$/;

    if (configFile.test(this.connections)) {
      return Config.getConnectionsFromWebConfig(this.connections);
    } else {
      return this.getConnectionsFromJson(this.connections);
    }
  }
private safeValue(value: any): any {
    if (isNull(value)) {
      return 'NULL';
    }

    if (isString(value)) {
      value = value.replace("'", "''");
      return `'${value}'`;
    }

    if (isDate(value)) {
      value = value.toISOString();
      return `'${value}'`;
    }

    if (isBoolean(value)) {
      return value ? 1 : 0;
    }

    return value;
  }
function safeValue(value: any): any {
  if (isString(value)) {
    value = value.replace("'", "''");
    return `'${value}'`;
  }

  if (isDate(value)) {
    value = value.toISOString();
    return `'${value}'`;
  }

  if (isBoolean(value)) {
    return value ? 1 : 0;
  }

  return value;
}
private safeValue(value: any): any {
    if (isNull(value)) {
      return 'NULL';
    }

    if (isString(value)) {
      value = value.replace("'", "''");
      return `'${value}'`;
    }

    if (isDate(value)) {
      value = value.toISOString();
      return `'${value}'`;
    }

    if (isBoolean(value)) {
      return value ? 1 : 0;
    }

    return value;
  }
function safeValue(value: any): any {
  if (isString(value)) {
    value = value.replace("'", "''");
    return `'${value}'`;
  }

  if (isDate(value)) {
    value = value.toISOString();
    return `'${value}'`;
  }

  if (isBoolean(value)) {
    return value ? 1 : 0;
  }

  return value;
}
private safeValue(value: any): any {
    if (isNull(value)) {
      return 'NULL';
    }

    if (isString(value)) {
      value = value.replace("'", "''");
      return `'${value}'`;
    }

    if (isDate(value)) {
      value = value.toISOString();
      return `'${value}'`;
    }

    if (isBoolean(value)) {
      return value ? 1 : 0;
    }

    return value;
  }
function safeValue(value: any): any {
  if (isString(value)) {
    value = value.replace("'", "''");
    return `'${value}'`;
  }

  if (isDate(value)) {
    value = value.toISOString();
    return `'${value}'`;
  }

  if (isBoolean(value)) {
    return value ? 1 : 0;
  }

  return value;
}
function include(config, file) {
    if (!config.files || !config.files.length) {
        return true;
    }
    if (!ts_util_is_1.isArray(file)) {
        file = [file];
    }
    var results = multimatch(file, config.files);
    return !!results.length;
}
/**

Is your System Free of Underlying Vulnerabilities?
Find Out Now