first commit

This commit is contained in:
jefferyzhao
2025-07-31 17:44:12 +08:00
commit b9bdc8598b
42390 changed files with 4467935 additions and 0 deletions

50
node_modules/babel-helper-vue-jsx-merge-props/index.js generated vendored Normal file
View File

@ -0,0 +1,50 @@
var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/
module.exports = function mergeJSXProps (objs) {
return objs.reduce(function (a, b) {
var aa, bb, key, nestedKey, temp
for (key in b) {
aa = a[key]
bb = b[key]
if (aa && nestRE.test(key)) {
// normalize class
if (key === 'class') {
if (typeof aa === 'string') {
temp = aa
a[key] = aa = {}
aa[temp] = true
}
if (typeof bb === 'string') {
temp = bb
b[key] = bb = {}
bb[temp] = true
}
}
if (key === 'on' || key === 'nativeOn' || key === 'hook') {
// merge functions
for (nestedKey in bb) {
aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey])
}
} else if (Array.isArray(aa)) {
a[key] = aa.concat(bb)
} else if (Array.isArray(bb)) {
a[key] = [aa].concat(bb)
} else {
for (nestedKey in bb) {
aa[nestedKey] = bb[nestedKey]
}
}
} else {
a[key] = b[key]
}
}
return a
}, {})
}
function mergeFn (a, b) {
return function () {
a && a.apply(this, arguments)
b && b.apply(this, arguments)
}
}

View File

@ -0,0 +1,21 @@
{
"name": "babel-helper-vue-jsx-merge-props",
"version": "2.0.3",
"description": "babel helper for vue jsx spread.",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/babel-helper-vue-jsx-merge-props.git"
},
"keywords": [
"babel",
"vue",
"jsx"
],
"author": "Evan You",
"license": "MIT",
"bugs": {
"url": "https://github.com/vuejs/babel-helper-vue-jsx-merge-props/issues"
},
"homepage": "https://github.com/vuejs/babel-helper-vue-jsx-merge-props#readme"
}