- 将所有图片路径从绝对路径改为使用 process.env.PUBLIC_URL - 修复 HomePage.tsx 中所有图片引用 - 修复 CoursePage.tsx 中所有图片引用 - 确保图片在 GitHub Pages 上正确加载 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
23 lines
745 B
JavaScript
23 lines
745 B
JavaScript
import isFunction from './isFunction.js';
|
|
import toPath from './_toPath.js';
|
|
|
|
// Traverses the children of `obj` along `path`. If a child is a function, it
|
|
// is invoked with its parent as context. Returns the value of the final
|
|
// child, or `fallback` if any child is undefined.
|
|
export default function result(obj, path, fallback) {
|
|
path = toPath(path);
|
|
var length = path.length;
|
|
if (!length) {
|
|
return isFunction(fallback) ? fallback.call(obj) : fallback;
|
|
}
|
|
for (var i = 0; i < length; i++) {
|
|
var prop = obj == null ? void 0 : obj[path[i]];
|
|
if (prop === void 0) {
|
|
prop = fallback;
|
|
i = length; // Ensure we don't continue iterating.
|
|
}
|
|
obj = isFunction(prop) ? prop.call(obj) : prop;
|
|
}
|
|
return obj;
|
|
}
|