isFunction static method

bool isFunction(
  1. String value, {
  2. String? functionName,
})

Implementation

static bool isFunction(String value, { String? functionName }) {
  if (functionName != null) {
    bool isMatch;
    final int functionNameLength = functionName.length;

    if (value.length < functionNameLength) {
      return false;
    }

    for (int i = 0; i < functionNameLength; i++) {
      isMatch = functionName.codeUnitAt(i) == value.codeUnitAt(i);
      if (!isMatch) {
        return false;
      }
    }
  }

  return _functionRegExp.hasMatch(value);
}