Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8567e7d

Browse files
committed
extract identity function into util
1 parentcdd3687 commit8567e7d

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

‎src/core/config.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*@flow */
22

3-
import{no,noop}from'shared/util'
3+
import{no,noop,identity}from'shared/util'
44

55
exporttypeConfig={
66
// user
@@ -73,7 +73,7 @@ const config: Config = {
7373
/**
7474
* Parse the real tag name for the specific platform.
7575
*/
76-
parsePlatformTagName:(x:string):string=>x,
76+
parsePlatformTagName:identity,
7777

7878
/**
7979
* Check if an attribute must be bound using property, e.g. value

‎src/core/instance/render.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import VNode, {
99
}from'../vdom/vnode'
1010
import{
1111
warn,
12+
identity,
1213
isObject,
1314
toObject,
1415
nextTick,
@@ -167,7 +168,6 @@ export function renderMixin (Vue: Class<Component>) {
167168
}
168169

169170
// filter resolution helper
170-
constidentity=_=>_
171171
Vue.prototype._f=functionresolveFilter(id){
172172
returnresolveAsset(this.$options,'filters',id,true)||identity
173173
}

‎src/shared/util.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ export function noop () {}
189189
*/
190190
exportconstno=()=>false
191191

192+
/**
193+
* Return same value
194+
*/
195+
exportconstidentity=(_:any)=>_
196+
192197
/**
193198
* Generate a static keys string from compiler modules.
194199
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp