Acme.BookStore.HttpApi.Host/node_modules/copy-props/index.js
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
'use strict';
var eachProps = require('each-props');
var isPlainObject = require('is-plain-object');
module.exports = function(src, dst, fromto, converter, reverse) {
if (!isObject(src)) {
src = {};
}
if (!isObject(dst)) {
dst = {};
}
if (isPlainObject(fromto)) {
fromto = onlyValueIsString(fromto);
} else if (Array.isArray(fromto)) {
fromto = arrayToObject(fromto);
} else if (typeof fromto === 'boolean') {
reverse = fromto;
converter = noop;
fromto = null;
} else if (typeof fromto === 'function') {
reverse = converter;
converter = fromto;
fromto = null;
} else {
fromto = null;
}
if (typeof converter !== 'function') {
if (typeof converter === 'boolean') {
reverse = converter;
converter = noop;
} else {
converter = noop;
}
}
if (typeof reverse !== 'boolean') {
reverse = false;
}
if (reverse) {
var tmp = src;
src = dst;
dst = tmp;
if (fromto) {
fromto = invert(fromto);
}
}
var opts = {
dest: dst,
fromto: fromto,
convert: converter,
};
后面还有 166 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
