将路径中的变量引用注入，{}
@param value 路径表达式
@returns {string} 文件的真是路径
@private
167955
function _injectVaribles(value) {
    return value.replace(/\{([\w]+)\}/g, function(exp, varibleName, index, val) {
        return _options[varibleName];
    });
}
1089457
public static String toJsonString(Object value) {
        if (value == null) {
            return "null";
        }
        else if (value.getClass().equals(String.class)) {
            return "\"" + StringUtils.jsonEncoding(value.toString()) + "\"";
        }
        // else it's a RawJson, Boolean or Number so no escaping or quotes
        else {
            return value.toString();
        }
    }
632892
function (value, encoding) {
    encoding = (typeof encoding === 'undefined') ? 'utf8' : encoding
    if (Buffer.isBuffer(value)) {
      value = value.toString(encoding)
    }
    return value
  }
844394
function (value) {
      if (fp.is(String, value) && value.indexOf(':') > 0) {
        let [path, id] = value.split(':');
        return { _id: value, _type: path, [options.idField]: id };
      } else {
        // keep original value in _value
        return { _id: value, _type: value, [options.idField]: null, _value: value };
      }
    }
195758
public static String serialize(Object value) {
        if (value instanceof String) {
            return (String) value;
        } else if (value instanceof byte[]) {
            return new String((byte[]) value);
        }
1351063
function toPrintString(value) {
  if (isUndefined(value)) {
    return 'undefined';
  } else if (value === null) {
    return 'null';
  } else if (Number.isNaN(value)) {
    return 'NaN';
  } else {
    var str = coerceToStr(value);
    var lines = str.split('\n', 2);
    if (lines.length > 1) {
      str = lines[0] + '...';
    }
    if (str.length > _MAX_STR_WIDTH) {
      str = str.slice(0, _MAX_STR_WIDTH - 3) + '...';
    }
    return str;
  }
}
563894
function getStringValue(value)
{
	var return_value = '';
	switch(typeof(value))
	{
		case 'string':
			return_value = "'" + value + "'";
			break;

		case 'number':
			return_value = value;
			break;

		case 'object':

			if(value==null)
					return_value = value;
			else
			{
					var valuestring = JSON.stringify(value);
					return_value = "'" + valuestring + "'";
			}
			break;

		default:
			return_value = "'" + value + "'";
			break;
	}
  return return_value;
}
270940
function(value) {
      if (!arguments.length) return mimeType;
      mimeType = value == null ? null : value + "";
      return request;
    }
810907
public String format(final Object value) {
        
        if(value == null) {
            return "null";
        }
        
        final Class<?> clazz = value.getClass();
        if(clazz.isPrimitive()) {
            if(clazz.equals(Boolean.TYPE)) {
                return format((boolean) value);
            } else if(clazz.equals(Byte.TYPE)) {
                return format((byte) value);
            } else if(clazz.equals(Character.TYPE)) {
                return format((char) value);
            } else if(clazz.equals(Short.TYPE)) {
                return format((short) value);
            } else if(clazz.equals(Integer.TYPE)) {
                return format((int) value);
            } else if(clazz.equals(Long.TYPE)) {
                return format((long) value);
            } else if(clazz.equals(Float.TYPE)) {
                return format((float) value);
            } else if(clazz.equals(Double.TYPE)) {
                return format((double) value);
            } 
            
        } else if(clazz.isArray()) {
            if(value instanceof boolean[]) {
                return format((boolean[]) value);
            } else if(value instanceof char[]) {
                return format((char[]) value);
            }
526696
def file_or_token(value):
    
    if isfile(value):
        with open(value) as fd:
            return fd.read().strip()

    if any(char in value for char in '/\\.'):
        # This chars will never be in a token value, but may be in a path
        # The error message will be handled by the parser
        raise ValueError()

    return value
473046
function decodeLink(value) {                                // '</1/2>;pmin=10;pmax=60,</1/2/1>,</1/2/2>'
    var allowedAttrs = [ 'pmin', 'pmax', 'gt', 'lt', 'st' ],
        valueArray = value.split(','),                      // ['</1/2>;pmin=10;pmax=60', '</1/2/1>', '</1/2/2>']
        resrcArray = valueArray.slice(1),                   // ['</1/2/1>', '</1/2/2>']
        attrsArray = valueArray[0].split(';').slice(1),     // ['pmin=10', 'pmax=60']
        path = valueArray[0].split(';')[0].slice(1, -1),
        data = {
            path: path
        },
        rid;    

    if (!_.isEmpty(attrsArray)) {
        data.attrs = {};
        _.forEach(attrsArray, function (val) {
            var attr = val.split('=');

            if (_.includes(allowedAttrs, attr[0]))
                data.attrs[attr[0]] = Number(attr[1]);
        });
    }

    if (!_.isEmpty(resrcArray)) {
        data.resrcList = [];
        _.forEach(resrcArray, function (resrc, idx) {     
            data.resrcList.push(resrc.slice(1, -1));  
        });
    }

    return data;     // { path: '/1/2', attrs: { pmin: 10, pmax: 60 }, resrcList: ['/1/2/1', '/1/2/2'] }
}
1174304
function typeOf(value) {
  var returned = Object.prototype.toString.call(value);
  return returned.substring(1, returned.length - 1).split(' ')[1].toLowerCase();
}
418010
public String format(Object value) {
    ValueFormatter<Object> valueFormatter = VALUE_FORMATTERS.get(value.getClass());
    if (valueFormatter != null) {
      return valueFormatter.format(this, value);
    } else {
      return value.toString();
    }
  }
1001900
function getObjectToStringValue(value) {
            var result = objectToString.call(value);
            switch (result) {
                case '[object Undefined]':
                    return '#Undefined';
                case '[object Null]':
                    return '#Null';
                case '[object Object]':
                    return 'Object';
                case '[object Function]':
                    return 'Function';
                case '[object String]':
                    return 'String';
                case '[object Number]':
                    return (value != +value) ? '#NaN' : 'Number';
                case '[object Array]':
                    return 'Array';
                case '[object Boolean]':
                    return 'Boolean';
                case '[object RegExp]':
                    return 'RegExp';
                case '[object Symbol]':
                    return 'Symbol';
                case '[object Map]':
                    return 'Map';
                case '[object WeakMap]':
                    return 'WeakMap';
                case '[object Set]':
                    return 'Set';
                case '[object WeakSet]':
                    return 'WeakSet';
                case '[object Int8Array]':
                    return 'Int8Array';
                case '[object Uint8Array]':
                    return 'Uint8Array';
                case '[object Uint8ClampedArray]':
                    return 'Uint8ClampedArray';
                case '[object Int16Array]':
                    return 'Int16Array';
                case '[object Uint16Array]':
                    return 'Uint16Array';
                case '[object Int32Array]':
                    return 'Int32Array';
                case '[object Uint32Array]':
                    return 'Uint32Array';
                case '[object Float32Array]':
                    return 'Float32Array';
                case '[object Float64Array]':
                    return 'Float64Array';
                case '[object ArrayBuffer]':
                    return 'ArrayBuffer';
                case '[object DataView]':
                    return 'DataView';
                case '[object Error]':
                    return 'Error';
                case '[object Arguments]':
                    return 'Arguments';
                case '[object JSON]':
                    return 'JSON';
                case '[object Math]':
                    return 'Math';
                case '[object Date]':
                    return 'Date';
                default: //handle the rest (HTML element, future global objects,...)
                    return result.slice(8, -1);
            }
        }
1069326
function (value) {

            if (!Array.isArray(value)) {

                // null/undefined or anything else must be safely convert to string

                value = value + '';
            }

            if (Array.isArray(value)) {

                // map all values again
                value = value.map(v => this.parseValue(v));

            } else if (validator.isNumeric(value)) {

                value = value * 1; // parse as a number

            } else if (validator.isBoolean(value)) {

                value = (value === 'true');

            } else {

                // convert to JS date
                const date = validator.toDate(value);

                // date is valid, assign
                if (date !== null) {

                    value = date;
                }

                if (value === 'null') {

                    value = null;
                }

                if (value === 'undefined') {

                    value = undefined;
                }
            }

            return value;
        }
645093
function( value ) {
      var result = (value === undefined || value === null || value === "" || (value.hasOwnProperty("length") && value.length == 0));

      return result;
    }
737374
function typeOf (value) {
  var type = {
    hasValue: false,
    isArray: false,
    isPOJO: false,
    isNumber: false,
  };

  if (value !== undefined && value !== null) {
    type.hasValue = true;
    var typeName = typeof value;

    if (typeName === 'number') {
      type.isNumber = !isNaN(value);
    }
    else if (Array.isArray(value)) {
      type.isArray = true;
    }
    else {
      type.isPOJO =
        (typeName === 'object') &&
        !(value instanceof RegExp) &&
        !(value instanceof Date);
    }
  }

  return type;
}