first commit

This commit is contained in:
monjack
2025-06-20 18:01:48 +08:00
commit 6daa6d65c1
24611 changed files with 2512443 additions and 0 deletions

View File

@ -0,0 +1,30 @@
## @vue/babel-helper-vue-jsx-merge-props
A package used internally by vue jsx transformer to merge props spread. It is required to merge some prop trees like this:
```js
import mergeProps from '@vue/babel-helper-vue-jsx-merge-props'
const MyComponent = {
render(h) {
// original: <button onClick={$event => console.log($event)} {...{ on: { click: $event => doSomething($event) } }} />
return h(
'button',
mergeProps([
{
on: {
click: $event => console.log($event),
},
},
{
on: {
click: $event => doSomething($event),
},
},
]),
)
},
}
```
This tool is used internally and there is no reason for you to ever use it.

View File

@ -0,0 +1 @@
"use strict";function _extends(){return _extends=Object.assign?Object.assign.bind():function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}var normalMerge=["attrs","props","domProps"],toArrayMerge=["class","style","directives"],functionalMerge=["on","nativeOn"],mergeJsxProps=function(a){return a.reduce(function(c,a){for(var b in a)if(!c[b])c[b]=a[b];else if(-1!==normalMerge.indexOf(b))c[b]=_extends({},c[b],a[b]);else if(-1!==toArrayMerge.indexOf(b)){var d=c[b]instanceof Array?c[b]:[c[b]],e=a[b]instanceof Array?a[b]:[a[b]];c[b]=[].concat(d,e)}else if(-1!==functionalMerge.indexOf(b)){for(var f in a[b])if(c[b][f]){var g=c[b][f]instanceof Array?c[b][f]:[c[b][f]],h=a[b][f]instanceof Array?a[b][f]:[a[b][f]];c[b][f]=[].concat(g,h)}else c[b][f]=a[b][f];}else if("hook"===b)for(var i in a[b])c[b][i]=c[b][i]?mergeFn(c[b][i],a[b][i]):a[b][i];else c[b]=a[b];return c},{})},mergeFn=function(a,b){return function(){a&&a.apply(this,arguments),b&&b.apply(this,arguments)}};module.exports=mergeJsxProps;

View File

@ -0,0 +1,38 @@
{
"name": "@vue/babel-helper-vue-jsx-merge-props",
"version": "1.4.0",
"description": "Babel helper for Vue JSX spread",
"main": "dist/helper.js",
"repository": "https://github.com/vuejs/jsx/tree/master/packages/babel-helper-vue-jsx-merge-props",
"author": "Evan You",
"license": "MIT",
"private": false,
"publishConfig": {
"access": "public"
},
"files": [],
"scripts": {
"build:testing": "rollup -c rollup.config.testing.js",
"build": "rollup -c",
"pretest": "yarn build:testing",
"test": "nyc --reporter=html --reporter=text-summary ava -v test/test.js",
"prepublish": "yarn build"
},
"devDependencies": {
"@babel/core": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"ava": "^0.25.0",
"nyc": "^13.1.0",
"rollup": "^0.67.4",
"rollup-plugin-babel": "4.0.3",
"rollup-plugin-babel-minify": "^6.2.0",
"rollup-plugin-istanbul": "^2.0.1"
},
"nyc": {
"exclude": [
"dist",
"test"
]
},
"gitHead": "6566e12067f5d6c02d3849b574a1b84de5634008"
}