-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from fastcodejava/master
Modified jsonapter.js, added skip template feature.
- Loading branch information
Showing
5 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
"use strict"; | ||
|
||
var dog = { | ||
content: { | ||
dogName: { | ||
dataKey: 'name' | ||
}, | ||
dogAge: { | ||
value: function (input) { | ||
return 2015 - input; | ||
}, | ||
dataKey: 'birthYear' | ||
} | ||
}, | ||
skip: true, | ||
dataKey: 'dog' | ||
}; | ||
|
||
var person = { | ||
content: { | ||
personName: { | ||
dataKey: 'name' | ||
}, | ||
personAge: { | ||
value: function (input) { | ||
return 2015 - input; | ||
}, | ||
dataKey: 'birthYear' | ||
} | ||
}, | ||
dataKey: 'person' | ||
}; | ||
|
||
exports.template = { | ||
assign: [{ | ||
constant: { | ||
title: 'Person & Dog', | ||
comment: 'dogs are good' | ||
} | ||
}, dog, person], | ||
dataKey: 'team' | ||
}; | ||
|
||
exports.input = { | ||
team: { | ||
person: { | ||
name: 'DOE, JOE', | ||
birthYear: 1980 | ||
}, | ||
dog: { | ||
name: 'Paws', | ||
birthYear: 2010 | ||
} | ||
} | ||
}; | ||
|
||
exports.expected = { | ||
title: 'Person & Dog', | ||
comment: 'dogs are good', | ||
personName: 'DOE, JOE', | ||
personAge: 35 | ||
}; |