File tree 3 files changed +40
-0
lines changed
3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ node_modules
2
+ * .log
Original file line number Diff line number Diff line change
1
+ module . exports = function ( model ) {
2
+ model . get ( function ( value , type ) {
3
+ return value === undefined
4
+ ? type . defaultValue
5
+ : value ;
6
+ } ) ;
7
+
8
+ model . default = function ( value ) {
9
+ return this . use ( function ( model ) {
10
+ model . defaultValue = value ;
11
+ } ) ;
12
+ } ;
13
+ } ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " defaults" ,
3
+ "version" : " 0.1.0" ,
4
+ "description" : " Add default value support to immodel" ,
5
+ "main" : " index.js" ,
6
+ "scripts" : {
7
+ "test" : " mocha"
8
+ },
9
+ "repository" : {
10
+ "type" : " git" ,
11
+ "url" : " http://github.com/immodel/defaults"
12
+ },
13
+ "keywords" : [
14
+ " defaults" ,
15
+ " immodel" ,
16
+ " default" ,
17
+ " values"
18
+ ],
19
+ "author" : " ashaffer (http://github.com/ashaffer)" ,
20
+ "license" : " MIT" ,
21
+ "bugs" : {
22
+ "url" : " https://github.com/immodel/defaults/issues"
23
+ },
24
+ "homepage" : " https://github.com/immodel/defaults"
25
+ }
You can’t perform that action at this time.
0 commit comments