+50
-17
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="ChangeListManager"> | ||
| <list default="true" id="cb3542d0-f5bc-44d0-b974-2b08364acb7d" name="Default" comment=""> | ||
| <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.gitignore" afterPath="$PROJECT_DIR$/.gitignore" /> | ||
| <list default="true" id="cb3542d0-f5bc-44d0-b974-2b08364acb7d" name="Default" comment="update package.json"> | ||
| <change type="MODIFICATION" beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" /> | ||
@@ -37,3 +36,3 @@ </list> | ||
| </file> | ||
| <file leaf-file-name="package.json" pinned="false" current-in-tab="true"> | ||
| <file leaf-file-name="package.json" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/package.json"> | ||
@@ -58,7 +57,7 @@ <provider selected="true" editor-type-id="text-editor"> | ||
| </file> | ||
| <file leaf-file-name=".gitignore" pinned="false" current-in-tab="false"> | ||
| <file leaf-file-name=".gitignore" pinned="false" current-in-tab="true"> | ||
| <entry file="file://$PROJECT_DIR$/.gitignore"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="35"> | ||
| <caret line="3" column="9" selection-start-line="3" selection-start-column="9" selection-end-line="3" selection-end-column="9" /> | ||
| <state relative-caret-position="135"> | ||
| <caret line="9" column="14" selection-start-line="9" selection-start-column="14" selection-end-line="9" selection-end-column="14" /> | ||
| <folding /> | ||
@@ -69,2 +68,12 @@ </state> | ||
| </file> | ||
| <file leaf-file-name=".npmignore" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/.npmignore"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="0"> | ||
| <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| <file leaf-file-name="tslint.json" pinned="false" current-in-tab="false"> | ||
@@ -715,3 +724,3 @@ <entry file="file://$PROJECT_DIR$/tslint.json"> | ||
| <workItem from="1475895814307" duration="5000" /> | ||
| <workItem from="1478136503636" duration="968000" /> | ||
| <workItem from="1478136503636" duration="1596000" /> | ||
| </task> | ||
@@ -739,7 +748,21 @@ <task id="LOCAL-00001" summary="xxx"> | ||
| </task> | ||
| <option name="localTasksCounter" value="4" /> | ||
| <task id="LOCAL-00004" summary="update version number"> | ||
| <created>1478137487144</created> | ||
| <option name="number" value="00004" /> | ||
| <option name="presentableId" value="LOCAL-00004" /> | ||
| <option name="project" value="LOCAL" /> | ||
| <updated>1478137487144</updated> | ||
| </task> | ||
| <task id="LOCAL-00005" summary="update package.json"> | ||
| <created>1478140334844</created> | ||
| <option name="number" value="00005" /> | ||
| <option name="presentableId" value="LOCAL-00005" /> | ||
| <option name="project" value="LOCAL" /> | ||
| <updated>1478140334844</updated> | ||
| </task> | ||
| <option name="localTasksCounter" value="6" /> | ||
| <servers /> | ||
| </component> | ||
| <component name="TimeTrackingManager"> | ||
| <option name="totallyTimeSpent" value="19154000" /> | ||
| <option name="totallyTimeSpent" value="19782000" /> | ||
| </component> | ||
@@ -768,3 +791,3 @@ <component name="TodoView"> | ||
| <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3280507" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.503962" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.37083992" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> | ||
@@ -803,3 +826,5 @@ <window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> | ||
| <MESSAGE value="refactoring" /> | ||
| <option name="LAST_COMMIT_MESSAGE" value="refactoring" /> | ||
| <MESSAGE value="update version number" /> | ||
| <MESSAGE value="update package.json" /> | ||
| <option name="LAST_COMMIT_MESSAGE" value="update package.json" /> | ||
| </component> | ||
@@ -1074,6 +1099,6 @@ <component name="XDebuggerManager"> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/.gitignore"> | ||
| <entry file="file://$PROJECT_DIR$/package.json"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="35"> | ||
| <caret line="3" column="9" selection-start-line="3" selection-start-column="9" selection-end-line="3" selection-end-column="9" /> | ||
| <state relative-caret-position="30"> | ||
| <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" /> | ||
| <folding /> | ||
@@ -1083,6 +1108,6 @@ </state> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/package.json"> | ||
| <entry file="file://$PROJECT_DIR$/.npmignore"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="30"> | ||
| <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" /> | ||
| <state relative-caret-position="0"> | ||
| <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> | ||
| <folding /> | ||
@@ -1092,3 +1117,11 @@ </state> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/.gitignore"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="135"> | ||
| <caret line="9" column="14" selection-start-line="9" selection-start-column="14" selection-end-line="9" selection-end-column="14" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </component> | ||
| </project> |
+3
-3
| { | ||
| "name": "ts-rules", | ||
| "version": "0.2.2", | ||
| "version": "0.2.3", | ||
| "description": "", | ||
@@ -21,3 +21,3 @@ "main": "index.js", | ||
| "devDependencies": { | ||
| "@types/jasmine": "^2.2.34", | ||
| "@types/jasmine": "^2.5.37", | ||
| "jasmine-core": "^2.5.2", | ||
@@ -30,4 +30,4 @@ "karma": "^1.3.0", | ||
| "tslint": "^3.15.1", | ||
| "typescript": "^2.0.3" | ||
| "typescript": "^2.0.6" | ||
| } | ||
| } |
| {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;IAAQ,8BAA0B"} |
| define(["require", "exports"], function (require, exports) { | ||
| "use strict"; | ||
| var validateCollection = { | ||
| 'required': function (value) { | ||
| return !(value === undefined || value === null || /^\s*$/.test(value)); | ||
| }, | ||
| 'number': function (value) { | ||
| return /^-?\d+(?:\.\d+)?$/.test(value); | ||
| }, | ||
| 'email': function (value) { | ||
| return /^(\w+|\.+)((-\w+|\.+)|(\.+\w+))*\@\w+((\.|-)\w+)*\.\w+/.test(value); | ||
| }, | ||
| 'maxLen': function (value, len) { | ||
| var str = String(value), rps_value = str.replace(/^\s+|\s+$/g, ''); | ||
| return rps_value.length <= len; | ||
| }, | ||
| }; | ||
| exports.validators = validateCollection; | ||
| }); | ||
| //# sourceMappingURL=build-in-validators.js.map |
| {"version":3,"file":"build-in-validators.js","sourceRoot":"","sources":["build-in-validators.ts"],"names":[],"mappings":";;IAAA,IAAI,kBAAkB,GAAG;QACrB,UAAU,EAAE,UAAC,KAAK;YACd,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3E,CAAC;QACD,QAAQ,EAAE,UAAC,KAAK;YACZ,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO,EAAE,UAAC,KAAK;YACX,MAAM,CAAC,wDAAwD,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChF,CAAC;QACD,QAAQ,EAAE,UAAC,KAAK,EAAE,GAAG;YACjB,IAAI,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,EACnB,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;YAC9C,MAAM,CAAC,SAAS,CAAC,MAAM,IAAI,GAAG,CAAC;QACnC,CAAC;KAOJ;IAI6B,kBAAU,sBAJtC;IAIwC"} |
| define(["require", "exports"], function (require, exports) { | ||
| "use strict"; | ||
| function originRulesAnalyse(originRules) { | ||
| } | ||
| exports.originRulesAnalyse = originRulesAnalyse; | ||
| }); | ||
| //# sourceMappingURL=origin-rules-analyse.js.map |
| {"version":3,"file":"origin-rules-analyse.js","sourceRoot":"","sources":["origin-rules-analyse.ts"],"names":[],"mappings":";;IAEA,4BAAmC,WAAgB;IAEnD,CAAC;IAFe,0BAAkB,qBAEjC,CAAA"} |
-11
| define(["require", "exports", "./origin-rules-analyse"], function (require, exports, origin_rules_analyse_1) { | ||
| "use strict"; | ||
| function rules(config, message) { | ||
| this.realRules = origin_rules_analyse_1.originRulesAnalyse(config); | ||
| return function (origin) { | ||
| return { valid: true }; | ||
| }; | ||
| } | ||
| exports.rules = rules; | ||
| }); | ||
| //# sourceMappingURL=rules.js.map |
| {"version":3,"file":"rules.js","sourceRoot":"","sources":["rules.ts"],"names":[],"mappings":";;IAIA,eAAsB,MAAc,EAAE,OAAgB;QAElD,IAAI,CAAC,SAAS,GAAG,yCAAkB,CAAC,MAAM,CAAC,CAAA;QAE3C,MAAM,CAAC,UAAC,MAAW;YACf,MAAM,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC;QACzB,CAAC,CAAC;IACN,CAAC;IAPe,aAAK,QAOpB,CAAA"} |
| define(["require", "exports", './rules'], function (require, exports, rules_1) { | ||
| "use strict"; | ||
| describe('simple validate', function () { | ||
| describe('required', function () { | ||
| it('should be valid if property is not empty', function () { | ||
| var obj = { | ||
| p: 'hello' | ||
| }, r = rules_1.rules({ | ||
| p: 'required' | ||
| }); | ||
| expect(r(obj).valid).toBe(true); | ||
| }); | ||
| // it('should be invalid if property is empty string', () => { | ||
| // let obj = { | ||
| // p: '' | ||
| // }, | ||
| // r = rules({ | ||
| // p: 'required' | ||
| // }); | ||
| // | ||
| // expect(r(obj).valid).toBe(false); | ||
| // }); | ||
| }); | ||
| }); | ||
| }); | ||
| //# sourceMappingURL=rules.spec.js.map |
| {"version":3,"file":"rules.spec.js","sourceRoot":"","sources":["rules.spec.ts"],"names":[],"mappings":";;IAEA,QAAQ,CAAC,iBAAiB,EAAE;QAExB,QAAQ,CAAC,UAAU,EAAE;YACjB,EAAE,CAAC,0CAA0C,EAAE;gBAC3C,IAAI,GAAG,GAAG;oBACF,CAAC,EAAE,OAAO;iBACb,EACD,CAAC,GAAG,aAAK,CAAC;oBACN,CAAC,EAAE,UAAU;iBAChB,CAAC,CAAC;gBAEP,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;YAEH,8DAA8D;YAC9D,kBAAkB;YAClB,oBAAoB;YACpB,aAAa;YACb,sBAAsB;YACtB,4BAA4B;YAC5B,cAAc;YACd,EAAE;YACF,wCAAwC;YACxC,MAAM;QACV,CAAC,CAAC,CAAC;IAEP,CAAC,CAAC,CAAC"} |
66618
-3.82%22
-31.25%135
-30.77%