@legalplace/lplogic 2.3.6 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/.gitlab-automator +7 -0
  2. package/.oracle/node_modules/.package-lock.json +47 -0
  3. package/.oracle/node_modules/@legalplace/json-logic-js/.editorconfig +21 -0
  4. package/.oracle/node_modules/@legalplace/json-logic-js/.eslintrc.json +33 -0
  5. package/.oracle/node_modules/@legalplace/json-logic-js/.gitlab-ci.yml +25 -0
  6. package/.oracle/node_modules/@legalplace/json-logic-js/LICENSE +22 -0
  7. package/.oracle/node_modules/@legalplace/json-logic-js/README.md +127 -0
  8. package/.oracle/node_modules/@legalplace/json-logic-js/gulpfile.js +18 -0
  9. package/.oracle/node_modules/@legalplace/json-logic-js/jsonlogic.png +0 -0
  10. package/.oracle/node_modules/@legalplace/json-logic-js/logic.d.ts +11 -0
  11. package/.oracle/node_modules/@legalplace/json-logic-js/logic.js +464 -0
  12. package/.oracle/node_modules/@legalplace/json-logic-js/package.json +37 -0
  13. package/.oracle/node_modules/@legalplace/json-logic-js/tests/testrunner.js +17 -0
  14. package/.oracle/node_modules/@legalplace/json-logic-js/tests/tests.js +319 -0
  15. package/.oracle/node_modules/@legalplace/lplogic/.eslintrc +52 -0
  16. package/.oracle/node_modules/@legalplace/lplogic/.gitlab-ci.yml +39 -0
  17. package/.oracle/node_modules/@legalplace/lplogic/.vscode/settings.json +23 -0
  18. package/.oracle/node_modules/@legalplace/lplogic/.vscode/tasks.json +24 -0
  19. package/.oracle/node_modules/@legalplace/lplogic/CHANGELOG.md +32 -0
  20. package/.oracle/node_modules/@legalplace/lplogic/README.md +149 -0
  21. package/.oracle/node_modules/@legalplace/lplogic/dist/LpLogic.d.ts +3 -0
  22. package/.oracle/node_modules/@legalplace/lplogic/dist/LpLogic.js +230 -0
  23. package/.oracle/node_modules/@legalplace/lplogic/dist/Parser.d.ts +12 -0
  24. package/.oracle/node_modules/@legalplace/lplogic/dist/Parser.js +90 -0
  25. package/.oracle/node_modules/@legalplace/lplogic/dist/definitions/model-v1-schema.d.ts +152 -0
  26. package/.oracle/node_modules/@legalplace/lplogic/dist/definitions/model-v1-schema.js +2 -0
  27. package/.oracle/node_modules/@legalplace/lplogic/dist/index.d.ts +4 -0
  28. package/.oracle/node_modules/@legalplace/lplogic/dist/index.js +10 -0
  29. package/.oracle/node_modules/@legalplace/lplogic/dist/schemas/condition-v1-schema.d.ts +45 -0
  30. package/.oracle/node_modules/@legalplace/lplogic/dist/schemas/condition-v1-schema.js +67 -0
  31. package/.oracle/node_modules/@legalplace/lplogic/dist/schemas/model-v1-schema.d.ts +510 -0
  32. package/.oracle/node_modules/@legalplace/lplogic/dist/schemas/model-v1-schema.js +543 -0
  33. package/.oracle/node_modules/@legalplace/lplogic/jest.config.js +13 -0
  34. package/.oracle/node_modules/@legalplace/lplogic/package.json +47 -0
  35. package/.oracle/node_modules/@legalplace/lplogic/tests/LpLogic.test.ts +131 -0
  36. package/.oracle/node_modules/@legalplace/lplogic/tests/misc/expected-model-v3.json +19891 -0
  37. package/.oracle/node_modules/@legalplace/lplogic/tests/misc/refs-model-v3.json +642 -0
  38. package/.oracle/node_modules/@legalplace/lplogic/tests/misc/unparsed-model-v3.json +1 -0
  39. package/.oracle/node_modules/@legalplace/lplogic/tsconfig.json +26 -0
  40. package/.oracle/node_modules/@legalplace/models-v3-types/.eslintrc +3 -0
  41. package/.oracle/node_modules/@legalplace/models-v3-types/.gitlab-ci.yml +26 -0
  42. package/.oracle/node_modules/@legalplace/models-v3-types/CHANGELOG.md +275 -0
  43. package/.oracle/node_modules/@legalplace/models-v3-types/README +6 -0
  44. package/.oracle/node_modules/@legalplace/models-v3-types/index.ts +640 -0
  45. package/.oracle/node_modules/@legalplace/models-v3-types/package.json +21 -0
  46. package/.oracle/node_modules/@legalplace/models-v3-types/schema.json +2281 -0
  47. package/.oracle/node_modules/@legalplace/models-v3-types/tsconfig.json +22 -0
  48. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/2FA.d.ts +8 -0
  49. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/2FA.js +13 -0
  50. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/accessControl.d.ts +16 -0
  51. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/accessControl.js +13 -0
  52. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/appCalendar.d.ts +4 -0
  53. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/appCalendar.js +8 -0
  54. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/capitalDepositCase.d.ts +58 -0
  55. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/capitalDepositCase.js +69 -0
  56. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/checkoutX.d.ts +6 -0
  57. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/checkoutX.js +9 -0
  58. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/contratMetaIds.d.ts +5 -0
  59. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/contratMetaIds.js +9 -0
  60. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/drive_object.d.ts +8 -0
  61. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/drive_object.js +13 -0
  62. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/files.d.ts +11 -0
  63. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/files.js +15 -0
  64. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/formStatus.d.ts +618 -0
  65. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/formStatus.js +498 -0
  66. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/index.d.ts +30 -0
  67. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/index.js +77 -0
  68. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/instanceCheckout.d.ts +8 -0
  69. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/instanceCheckout.js +12 -0
  70. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/instanceStatus.d.ts +19 -0
  71. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/instanceStatus.js +24 -0
  72. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/jwtAzure.d.ts +14 -0
  73. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/jwtAzure.js +20 -0
  74. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/kanoon.d.ts +121 -0
  75. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/kanoon.js +450 -0
  76. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/legalPublicationRequest.d.ts +20 -0
  77. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/legalPublicationRequest.js +26 -0
  78. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/orderProof.d.ts +10 -0
  79. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/orderProof.js +15 -0
  80. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/partner.d.ts +3 -0
  81. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/partner.js +7 -0
  82. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/paymentMethods.d.ts +13 -0
  83. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/paymentMethods.js +17 -0
  84. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/permalinks.d.ts +10 -0
  85. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/permalinks.js +14 -0
  86. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/proofX/adressAutocomplete.d.ts +48 -0
  87. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/proofX/adressAutocomplete.js +97 -0
  88. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/proofX/adressAutocomplete.test.d.ts +1 -0
  89. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/proofX/adressAutocomplete.test.js +198 -0
  90. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/proofX/countriesAndNationalitiesToIso.mapper.d.ts +668 -0
  91. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/proofX/countriesAndNationalitiesToIso.mapper.js +1126 -0
  92. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/proofX/countriesAndNationalitiesToIso.mapper.test.d.ts +1 -0
  93. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/proofX/countriesAndNationalitiesToIso.mapper.test.js +194 -0
  94. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/proofX/proof.d.ts +526 -0
  95. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/proofX/proof.js +584 -0
  96. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/proofX/proofSubcategories.d.ts +126 -0
  97. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/proofX/proofSubcategories.js +124 -0
  98. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/rgpdPolicy.d.ts +14 -0
  99. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/rgpdPolicy.js +18 -0
  100. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/signature.d.ts +25 -0
  101. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/signature.js +31 -0
  102. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/sivProducts.d.ts +10 -0
  103. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/sivProducts.js +97 -0
  104. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/sivStatus.d.ts +37 -0
  105. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/sivStatus.js +40 -0
  106. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/subscription.d.ts +4 -0
  107. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/subscription.js +8 -0
  108. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/tags.d.ts +47 -0
  109. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/tags.js +8 -0
  110. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/transaction.d.ts +61 -0
  111. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/transaction.js +69 -0
  112. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/user.d.ts +18 -0
  113. package/.oracle/node_modules/@legalplace/typeorm-constants/dist/user.js +24 -0
  114. package/.oracle/node_modules/@legalplace/typeorm-constants/package.json +37 -0
  115. package/.oracle/node_modules/jsonschema/.editorconfig +10 -0
  116. package/.oracle/node_modules/jsonschema/LICENSE +21 -0
  117. package/.oracle/node_modules/jsonschema/README.md +451 -0
  118. package/.oracle/node_modules/jsonschema/package.json +42 -0
  119. package/dist/LpLogic.js +98 -17
  120. package/package.json +1 -1
  121. package/tests/LpLogic.test.ts +123 -2
  122. package/tests/parity-2.3.1.test.ts +176 -0
@@ -0,0 +1,7 @@
1
+ GITLAB_PRIVATE_TOKEN=glpat-BOv5W1i6MoAAvHjzkmc5nW86MQp1OjkH.01.0w119catf
2
+ GITLAB_BASE_URL=https://git.legalplace.eu
3
+ GITLAB_API_PROJECT_ID=28
4
+ GITLAB_USER_ID=9
5
+ CURRENT_PROJECT_ID=39
6
+ SLACK_USER_ID=U0B3SNBV3
7
+ CLICKUP_PRIVATE_TOKEN=pk_32519579_K5W4L4KEVXY03A3D2WFA46D07HVGTL5L
@@ -0,0 +1,47 @@
1
+ {
2
+ "lockfileVersion": 3,
3
+ "requires": true,
4
+ "packages": {
5
+ "node_modules/@legalplace/json-logic-js": {
6
+ "version": "1.2.3",
7
+ "resolved": "https://registry.npmjs.org/@legalplace/json-logic-js/-/json-logic-js-1.2.3.tgz",
8
+ "integrity": "sha512-hyqkk3QqpDYZyEEupd6fyQEMUa3NuzlpaLiIu81z2/Wrb4z/5lw11wGTkIlTewuKq8UCxpJ7KpJXzwqq5smqXA==",
9
+ "license": "MIT"
10
+ },
11
+ "node_modules/@legalplace/lplogic": {
12
+ "version": "2.3.1",
13
+ "resolved": "https://registry.npmjs.org/@legalplace/lplogic/-/lplogic-2.3.1.tgz",
14
+ "integrity": "sha512-lzPwUOli09bt/EQEKxbnoUN84EvvXs4qJgLmPOTaY7MzxyvwSFccCDelbOhNqEUlKRfPZJbqF8BDvkLKKkSdpQ==",
15
+ "license": "ISC",
16
+ "dependencies": {
17
+ "@legalplace/json-logic-js": "^1.2.3",
18
+ "@legalplace/models-v3-types": "5.1.24",
19
+ "jsonschema": "^1.2.4"
20
+ }
21
+ },
22
+ "node_modules/@legalplace/models-v3-types": {
23
+ "version": "5.1.24",
24
+ "resolved": "https://registry.npmjs.org/@legalplace/models-v3-types/-/models-v3-types-5.1.24.tgz",
25
+ "integrity": "sha512-L25oB0Oyd4BiwPSuUpQ6+JSdGOaQkCWpWEilb0hbkgKUpPFUpDBK5AGtXUMnkRziGO/xGb4Pilc/JTKZxPFHtg==",
26
+ "license": "MIT",
27
+ "dependencies": {
28
+ "@legalplace/typeorm-constants": "^3.21.0"
29
+ }
30
+ },
31
+ "node_modules/@legalplace/typeorm-constants": {
32
+ "version": "3.93.0",
33
+ "resolved": "https://registry.npmjs.org/@legalplace/typeorm-constants/-/typeorm-constants-3.93.0.tgz",
34
+ "integrity": "sha512-Vr+ate0/pXgudkrlofdEgQ3ibceQSaFblcEQ3VGcxAzL7zLfjiV+cXrWlmEKY8/Msv01piIopDQ48qOyU5BtkQ==",
35
+ "license": "MIT"
36
+ },
37
+ "node_modules/jsonschema": {
38
+ "version": "1.5.0",
39
+ "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.5.0.tgz",
40
+ "integrity": "sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==",
41
+ "license": "MIT",
42
+ "engines": {
43
+ "node": "*"
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,21 @@
1
+ # EditorConfig helps developers define and maintain consistent
2
+ # coding styles between different editors and IDEs
3
+ # editorconfig.org
4
+
5
+ root = true
6
+
7
+
8
+ [*]
9
+
10
+ # Change these settings to your own preference
11
+ indent_style = space
12
+ indent_size = 2
13
+
14
+ # We recommend you to keep these unchanged
15
+ end_of_line = lf
16
+ charset = utf-8
17
+ trim_trailing_whitespace = true
18
+ insert_final_newline = true
19
+
20
+ [*.md]
21
+ trim_trailing_whitespace = false
@@ -0,0 +1,33 @@
1
+ {
2
+ "extends": "google",
3
+
4
+ "rules": {
5
+ "no-var": "off",
6
+ "indent": [
7
+ "error",
8
+ 2
9
+ ],
10
+ "linebreak-style": [
11
+ "error",
12
+ "unix"
13
+ ],
14
+ "quotes": [
15
+ "error",
16
+ "double", {
17
+ "avoidEscape": true
18
+ }
19
+ ],
20
+ "semi": [
21
+ "error",
22
+ "always"
23
+ ],
24
+ "max-len": [
25
+ "warn", {
26
+ "ignoreComments": true
27
+ }
28
+ ],
29
+ "prefer-spread": ["off"],
30
+ "prefer-rest-params": ["off"],
31
+ "camelcase" : ["off"]
32
+ }
33
+ }
@@ -0,0 +1,25 @@
1
+ image: node:11-alpine
2
+
3
+ stages:
4
+ - deploy
5
+
6
+ before_script:
7
+ - export PATH=$PATH:./node_modules/.bin/
8
+
9
+ variables:
10
+ DOCKER_DRIVER: overlay2
11
+
12
+ publish:
13
+ image: node:11-alpine
14
+ stage: deploy
15
+ except:
16
+ variables:
17
+ - $CI_COMMIT_MESSAGE =~ /skip-publish/
18
+ script:
19
+ - echo -e "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
20
+ - npm publish
21
+ - echo "PUBLISHED SUCCESSFULLY"
22
+ environment:
23
+ name: development
24
+ only:
25
+ - master
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Jeremy Wadhams
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,127 @@
1
+ # json-logic-js
2
+
3
+ This parser accepts [JsonLogic](http://jsonlogic.com) rules and executes them in JavaScript.
4
+
5
+ The JsonLogic format is designed to allow you to share rules (logic) between front-end and back-end code (regardless of language difference), even to store logic along with a record in a database. JsonLogic is documented extensively at [JsonLogic.com](http://jsonlogic.com), including examples of every [supported operation](http://jsonlogic.com/operations.html) and a place to [try out rules in your browser](http://jsonlogic.com/play.html).
6
+
7
+ The same format can also be executed in PHP by the library [json-logic-php](https://github.com/jwadhams/json-logic-php/)
8
+
9
+ ## Installation
10
+
11
+ To parse JsonLogic rules in a JavaScript backend (like Node.js), install this library via [NPM](https://www.npmjs.com/):
12
+
13
+ ```bash
14
+ npm install --save git+ssh://git@git.legalplace.eu:legalplace/json-logic-js.git
15
+ ```
16
+
17
+ Note that this project uses a [module loader](http://ricostacruz.com/cheatsheets/umdjs.html) that also makes it suitable for RequireJS projects.
18
+
19
+ If that doesn't suit you, and you want to manage updates yourself, the entire library is self-contained in `logic.js` and you can download it straight into your project as you see fit.
20
+
21
+ ```bash
22
+ curl -O https://raw.githubusercontent.com/jwadhams/json-logic-js/master/logic.js
23
+ ```
24
+
25
+ ## Examples
26
+
27
+ ### Simple
28
+ ```js
29
+ jsonLogic.apply( { "==" : [1, 1] } );
30
+ // true
31
+ ```
32
+
33
+ This is a simple test, equivalent to `1 == 1`. A few things about the format:
34
+
35
+ 1. The operator is always in the "key" position. There is only one key per JsonLogic rule.
36
+ 1. The values are typically an array.
37
+ 1. Each value can be a string, number, boolean, array (non-associative), or null
38
+
39
+ ### Compound
40
+ Here we're beginning to nest rules.
41
+
42
+ ```js
43
+ jsonLogic.apply(
44
+ {"and" : [
45
+ { ">" : [3,1] },
46
+ { "<" : [1,3] }
47
+ ] }
48
+ );
49
+ // true
50
+ ```
51
+
52
+ In an infix language (like JavaScript) this could be written as:
53
+
54
+ ```js
55
+ ( (3 > 1) && (1 < 3) )
56
+ ```
57
+
58
+ ### Data-Driven
59
+
60
+ Obviously these rules aren't very interesting if they can only take static literal data. Typically `jsonLogic` will be called with a rule object and a data object. You can use the `var` operator to get attributes of the data object:
61
+
62
+ ```js
63
+ jsonLogic.apply(
64
+ { "var" : ["a"] }, // Rule
65
+ { a : 1, b : 2 } // Data
66
+ );
67
+ // 1
68
+ ```
69
+
70
+ If you like, we support [syntactic sugar](https://en.wikipedia.org/wiki/Syntactic_sugar) on unary operators to skip the array around values:
71
+
72
+ ```js
73
+ jsonLogic.apply(
74
+ { "var" : "a" },
75
+ { a : 1, b : 2 }
76
+ );
77
+ // 1
78
+ ```
79
+
80
+ You can also use the `var` operator to access an array by numeric index:
81
+
82
+ ```js
83
+ jsonLogic.apply(
84
+ {"var" : 1 },
85
+ [ "apple", "banana", "carrot" ]
86
+ );
87
+ // "banana"
88
+ ```
89
+
90
+ Here's a complex rule that mixes literals and data. The pie isn't ready to eat unless it's cooler than 110 degrees, *and* filled with apples.
91
+
92
+ ```js
93
+ var rules = { "and" : [
94
+ {"<" : [ { "var" : "temp" }, 110 ]},
95
+ {"==" : [ { "var" : "pie.filling" }, "apple" ] }
96
+ ] };
97
+
98
+ var data = { "temp" : 100, "pie" : { "filling" : "apple" } };
99
+
100
+ jsonLogic.apply(rules, data);
101
+ // true
102
+ ```
103
+
104
+ ### Always and Never
105
+ Sometimes the rule you want to process is "Always" or "Never." If the first parameter passed to `jsonLogic` is a non-object, non-associative-array, it is returned immediately.
106
+
107
+ ```js
108
+ //Always
109
+ jsonLogic.apply(true, data_will_be_ignored);
110
+ // true
111
+
112
+ //Never
113
+ jsonLogic.apply(false, i_wasnt_even_supposed_to_be_here);
114
+ // false
115
+ ```
116
+
117
+ ## Compatibility
118
+
119
+ This library makes use of `Array.map` and `Array.reduce`, so it's not *exactly* Internet Explorer 8 friendly.
120
+
121
+ If you want to use JsonLogic *and* support deprecated browsers, you could easily use [BabelJS's polyfill](https://babeljs.io/docs/usage/polyfill/) or directly incorporate the polyfills documented on MDN for [map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) and [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).
122
+
123
+ ## Customization
124
+
125
+ It's not possible to include everyone's excellent ideas without the core library bloating, bringing in a ton of outside dependencies, or occasionally causing use case conflicts (some people need to safely execute untrusted rules, some people need to change outside state).
126
+
127
+ Check out the [documentation for adding custom operations](http://jsonlogic.com/add_operation.html) and be sure to stop by the [Wiki page of custom operations](https://github.com/jwadhams/json-logic-js/wiki/Custom-Operations) to see if someone has already solved your problem or to share your solution.
@@ -0,0 +1,18 @@
1
+ var gulp = require("gulp");
2
+ var exec = require("child_process").exec;
3
+
4
+ gulp.task("test", function(cb) {
5
+ exec(
6
+ "node testrunner.js",
7
+ {cwd: "tests"},
8
+ function(err, stdout, stderr) {
9
+ console.log(stdout);
10
+ console.log(stderr);
11
+ cb(err);
12
+ }
13
+ );
14
+ });
15
+
16
+ gulp.task("default", function() {
17
+ gulp.watch(["**/*.js", "tests/tests.json"], ["test"]);
18
+ });
@@ -0,0 +1,11 @@
1
+ declare module '@legalplace/json-logic-js' {
2
+ export function is_logic(logic: any): any;
3
+ export function truthy(value: any): any;
4
+ export function get_operator(logic: any): any;
5
+ export function get_values(logic: any): any;
6
+ export function apply(logic:any, data?: any): any;
7
+ export function uses_data(logic: any): any;
8
+ export function add_operation(name:any, code: any): any;
9
+ export function rm_operation(name:any): any;
10
+ export function rule_like(rule:any, pattern:any): any;
11
+ }