字符串化配置值
@method config#_stringify
@param {Object} [opts={}] 参数
@example
opts参数:{
value: 配置值(可选, 默认null)
expire: 过期时间, 单位秒, 0代表永不过期(可选, 默认0)
}
返回结果字符串
967658
function (opts) {
      var value = opts.value
      if (value === undefined) value = null
      var expire = opts.expire || 0
      var time = Date.now()
      var v = {
        value: value,
        time: time,
        expire: expire
      }
      return JSON.stringify(v)
    }
1017237
function opt(pattern, defval) {
        return new Pattern(pattern + '?', function (str, pos) {
            return pattern.exec(str, pos) || { res: defval, end: pos };
        });
    }
942643
function stringify() { /* private dangler */
	let err_open = '', err_close = '';
	if (this.options.errorHandling) {
		err_open  = '\napp.beginSuppressDialogs();\ntry {\n\n';
		err_close = '\n} catch (err) {\n' +
		(is(this.result_file,String) ? '\n\t$.result = err instanceof Error ? err : new Error(err);\n' : '') +
		'\n}\napp.endSuppressDialogs(false);';
	}

	let args = '';
	if (is(this.arguments, Array) && this.arguments.length > 0)
		args =  ',' + JSON.stringify(this.arguments);

	let res_get = '', res_write = '';
	if (is(this.result_file, String)) {
		res_get = '$.result = ';
		res_write = '\n\n'+
		'(function(result){\n'+
		'\tvar file = File(Folder.temp.absoluteURI+"/' + this.result_file + '");\n'+
		'\tfile.open("w");\n'+
		'\tvar str = "module.exports = " + {\n'+
		'\t\tlogs: typeof console === "object" && typeof console.clearCache === "function" ? console.clearCache() : null,\n'+
		'\t\treturned: result\n'+
		'\t}.toSource();\n' +
		'\tfile.write(str);\n' +
		'\tfile.close();\n' +
		'\tdelete $.result;\n'+
		'})($.result);';
	}

	const inc = this.includes.join(';');
	const main = err_open + res_get + this.code + '.apply(this' + args + ');\n' + err_close + res_write;

	return inc + main;
}
1207768
function stringify(key, value) {
  if (value instanceof RegExp) {
    return value.toString();
  }
  if (value instanceof Function) {
    return '[function]';
  }
  return value;
}
469454
function handleCipherSuccess(opts, err) {
  console.log(chalk.green(
    '\nSuccess: ' + opts.input + ' → ' + opts.output + '\n'
  ));
}
1010381
function json (opts) {
  return {
    ...opts,
    headers: {
      ...opts.headers,
      'content-type': 'application/json'
    },
    body: JSON.stringify(opts.body)
  }
}
394150
function optionString(options) {
    return Object.keys(options).map(function (key) {
        var value = options[key];
        if (value === null) {
            return '-' + key;
        } else if (typeof value === 'number') {
            value += '';
        } else if (typeof value === 'string') {
            value = '"' + value.replace(/"/g, '\\"') + '"';
        }
        return '-' + key + '=' + value.replace(/`/g, '');
    }).join(' ');
}
1075259
function(opts) {
  var self = this;

  opts = _.defaults(opts || {}, {
    clientId:         null,
    clientSecret:     null,
    redirectUri:      null,
    authEndpoint:     AUTH_ENDPOINT,
    testAuthEndpoint: TEST_AUTH_ENDPOINT,
    loginUri:         LOGIN_URI,
    testLoginUri:     TEST_LOGIN_URI,
    apiVersion:       38,
    environment:      'production',
    mode:             'multi',
    gzip:             false,
    autoRefresh:      false,
    onRefresh:        undefined,
    timeout:          undefined,
    oauth:            undefined,
    username:         undefined,
    password:         undefined,
    securityToken:    undefined
  });

  // convert option values
  opts.apiVersion = opts.apiVersion.toString().toLowerCase().replace('v', '').replace('.0', '');
  opts.environment = opts.environment.toLowerCase();
  opts.mode = opts.mode.toLowerCase();

  self = _.assign(this, opts);

  // validate options
  if(!_.isString(this.clientId)) throw new Error('invalid or missing clientId');
  if(!_.isString(this.authEndpoint)) throw new Error('invalid or missing authEndpoint');
  if(!_.isString(this.testAuthEndpoint)) throw new Error('invalid or missing testAuthEndpoint');
  if(!_.isString(this.loginUri)) throw new Error('invalid or missing loginUri');
  if(!_.isString(this.testLoginUri)) throw new Error('invalid or missing testLoginUri');
  if(!_.isBoolean(this.gzip)) throw new Error('gzip must be a boolean');
  if(!_.isString(this.environment) || _.indexOf(ENVS, this.environment) === -1) {
    throw new Error('invalid environment, only ' + ENVS.join(' and ') + ' are allowed');
  }
  if(!_.isString(this.mode) || _.indexOf(MODES, this.mode) === -1) {
    throw new Error('invalid mode, only ' + MODES.join(' and ') + ' are allowed');
  }
  if(!_.isString(this.redirectUri) && this.mode != 'single') {
    throw new Error('invalid or missing redirectUri');
  }
  if(this.onRefresh && !_.isFunction(this.onRefresh)) throw new Error('onRefresh must be a function');
  if(this.timeout && !_.isNumber(this.timeout)) throw new Error('timeout must be a number');

  // parse api version
  try {
    this.apiVersion = 'v' + parseInt(this.apiVersion, 10) + '.0';
  } catch (err) {
    throw new Error('invalid apiVersion number');
  }

  // parse timeout into integer in case it's a floating point.
  this.timeout = parseInt(this.timeout, 10);

  // load plugins
  if(opts.plugins && _.isArray(opts.plugins)) {
    opts.plugins.forEach(function(pname) {
      if(!plugins[pname]) throw new Error('plugin ' + pname + ' not found');
      // clone the object
      self[pname] = _.clone(plugins[pname]._fns);

      // now bind to the connection object
      _.forOwn(self[pname], function(fn, key) {
        self[pname][key] = _.bind(self[pname][key], self);
      });
    });
  }
}
1236940
function stringify (val) {
  var stack = val.stack

  if (stack) {
    return String(stack)
  }

  var str = String(val)

  return str === toString.call(val)
    ? inspect(val)
    : str
}
654927
function mergeEnv(opts, env) {
    //用环境变量替换当前配置
    for (var i in env) {
        //console.log("", i);
        if (i.startsWith('pomjs_')) {

            var config = i.substring(6);
            if (config.indexOf('_') == -1) {
                opts[config] = env[i];
            } else {
                var temp = 'opts';
                var vs = config.split('_');
                for (var index = 0; index < vs.length; index++) {
                    temp += '.' + vs[index];
                    //console.log(temp, eval(temp));
                    if (!eval(temp) || index === vs.length - 1) {
                        var tempValue = index < vs.length - 1 ? '{}' : "'" + env[i] + "'";
                        eval(temp + '=' + tempValue);
                    }
                }
            }
        }
    }

    console.log(opts.saluki);
}
670540
function stringify(object) {
    var seen = [];
    return JSON.stringify(object, function(key, val) {
        if (val !== null && typeof val === 'object') {
            if (seen.indexOf(val) >= 0) {
                return undefined;
            }
            seen.push(val);
        }
        return val;
    });
}
1357303
function stringifyValue(value, replacer, space, indent) {
  // boolean, null, number, string, or date
  if (typeof value === 'boolean' || value instanceof Boolean ||
      value === null ||
      typeof value === 'number' || value instanceof Number ||
      typeof value === 'string' || value instanceof String ||
      value instanceof Date) {
    return JSON.stringify(value);
  }

  // lossless number, the secret ingredient :)
  if (value && value.isLosslessNumber) {
    return value.value;
  }

  // array
  if (Array.isArray(value)) {
    return stringifyArray(value, replacer, space, indent);
  }

  // object (test lastly!)
  if (value && typeof value === 'object') {
    return stringifyObject(value, replacer, space, indent);
  }

  return undefined;
}
1146824
function (str, opts) {
    opts = extend({marker: 'snippet', action: 'add'}, opts);
    opts = extend({}, this.options, opts);

    var snippet = this.toSnippet(str, opts);
    return utils.inject(this, snippet, opts);
  }
777173
function expand(str, opts) {
  opts = opts || {};

  if (typeof str !== 'string') {
    throw new TypeError('expand-object expects a string.');
  }

  if (!/[.|:=]/.test(str) && /,/.test(str)) {
    return toArray(str);
  }

  var m;
  if ((m = /(\w+[:=]\w+\.)+/.exec(str)) && !/[|,+]/.test(str)) {
    var val = m[0].split(':').join('.');
    str = val + str.slice(m[0].length);
  }

  var arr = splitString(str, '|');
  var len = arr.length, i = -1;
  var res = {};

  if (isArrayLike(str) && arr.length === 1) {
    return expandArrayObj(str, opts);
  }

  while (++i < len) {
    var val = arr[i];
    // test for `https://foo`
    if (/\w:\/\/\w/.test(val)) {
      res[val] = '';
      continue;
    }

    var re = /^((?:\w+)\.(?:\w+))[:.]((?:\w+,)+)+((?:\w+):(?:\w+))/;
    var m = re.exec(val);
    if (m && m[1] && m[2] && m[3]) {
      var arrVal = m[2];
      arrVal = arrVal.replace(/,$/, '');
      var prop = arrVal.split(',');
      prop = prop.concat(toObject(m[3]));
      res = set(res, m[1], prop);
    } else if (!/[.,\|:=]/.test(val)) {
      res[val] = opts.toBoolean ? true : '';
    } else {
      res = expandObject(res, val, opts);
    }
  }
  return res;
}
449995
function slugify(s, opts) {
  opts = opts || {};
  s = str(s);
  if (!opts.mixedCase) { s = s.toLowerCase(); }
  return s
    .replace(/&/g, '-and-')
    .replace(/\+/g, '-plus-')
    .replace((opts.allow ?
      new RegExp('[^-.a-zA-Z0-9' + _.escapeRegExp(opts.allow) + ']+', 'g') :
      /[^-.a-zA-Z0-9]+/g), '-')
    .replace(/--+/g, '-')
    .replace(/^-(.)/, '$1')
    .replace(/(.)-$/, '$1');
}
602464
function stringify(input, options) {
  if (!options) options = {};
  return JSON.stringify(input, options.replacer, options.spaces);
}
1158559
function stringify (obj, replacer, spacer) {
  decirc(obj, '', [], undefined)
  var res = JSON.stringify(obj, replacer, spacer)
  while (arr.length !== 0) {
    var part = arr.pop()
    part[0][part[1]] = part[2]
  }
  return res
}