feelin 4.3.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 (114) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +6 -0
  3. data/.rspec +2 -0
  4. data/CHANGELOG.md +10 -0
  5. data/Gemfile +3 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +43 -0
  8. data/feelin.gemspec +22 -0
  9. data/lib/feelin/js/node_modules/.package-lock.json +67 -0
  10. data/lib/feelin/js/node_modules/@lezer/common/LICENSE +21 -0
  11. data/lib/feelin/js/node_modules/@lezer/common/README.md +14 -0
  12. data/lib/feelin/js/node_modules/@lezer/common/dist/index.cjs +2181 -0
  13. data/lib/feelin/js/node_modules/@lezer/common/dist/index.d.cts +1137 -0
  14. data/lib/feelin/js/node_modules/@lezer/common/dist/index.d.ts +1137 -0
  15. data/lib/feelin/js/node_modules/@lezer/common/dist/index.js +2168 -0
  16. data/lib/feelin/js/node_modules/@lezer/common/package.json +32 -0
  17. data/lib/feelin/js/node_modules/@lezer/highlight/LICENSE +21 -0
  18. data/lib/feelin/js/node_modules/@lezer/highlight/README.md +14 -0
  19. data/lib/feelin/js/node_modules/@lezer/highlight/dist/index.cjs +915 -0
  20. data/lib/feelin/js/node_modules/@lezer/highlight/dist/index.d.cts +621 -0
  21. data/lib/feelin/js/node_modules/@lezer/highlight/dist/index.d.ts +623 -0
  22. data/lib/feelin/js/node_modules/@lezer/highlight/dist/index.js +904 -0
  23. data/lib/feelin/js/node_modules/@lezer/highlight/package.json +31 -0
  24. data/lib/feelin/js/node_modules/@lezer/lr/LICENSE +21 -0
  25. data/lib/feelin/js/node_modules/@lezer/lr/README.md +25 -0
  26. data/lib/feelin/js/node_modules/@lezer/lr/dist/constants.d.ts +45 -0
  27. data/lib/feelin/js/node_modules/@lezer/lr/dist/constants.js +5 -0
  28. data/lib/feelin/js/node_modules/@lezer/lr/dist/index.cjs +1890 -0
  29. data/lib/feelin/js/node_modules/@lezer/lr/dist/index.d.cts +303 -0
  30. data/lib/feelin/js/node_modules/@lezer/lr/dist/index.d.ts +303 -0
  31. data/lib/feelin/js/node_modules/@lezer/lr/dist/index.js +1883 -0
  32. data/lib/feelin/js/node_modules/@lezer/lr/package.json +32 -0
  33. data/lib/feelin/js/node_modules/feelin/LICENSE +21 -0
  34. data/lib/feelin/js/node_modules/feelin/README.md +65 -0
  35. data/lib/feelin/js/node_modules/feelin/dist/builtins.d.ts +355 -0
  36. data/lib/feelin/js/node_modules/feelin/dist/index.cjs +2072 -0
  37. data/lib/feelin/js/node_modules/feelin/dist/index.cjs.map +1 -0
  38. data/lib/feelin/js/node_modules/feelin/dist/index.d.ts +3 -0
  39. data/lib/feelin/js/node_modules/feelin/dist/index.esm.js +2063 -0
  40. data/lib/feelin/js/node_modules/feelin/dist/index.esm.js.map +1 -0
  41. data/lib/feelin/js/node_modules/feelin/dist/interpreter.d.ts +26 -0
  42. data/lib/feelin/js/node_modules/feelin/dist/parser.d.ts +4 -0
  43. data/lib/feelin/js/node_modules/feelin/dist/temporal.d.ts +6 -0
  44. data/lib/feelin/js/node_modules/feelin/dist/types.d.ts +35 -0
  45. data/lib/feelin/js/node_modules/feelin/dist/utils.d.ts +12 -0
  46. data/lib/feelin/js/node_modules/feelin/package.json +63 -0
  47. data/lib/feelin/js/node_modules/lezer-feel/LICENSE +21 -0
  48. data/lib/feelin/js/node_modules/lezer-feel/README.md +94 -0
  49. data/lib/feelin/js/node_modules/lezer-feel/dist/index.cjs +1328 -0
  50. data/lib/feelin/js/node_modules/lezer-feel/dist/index.cjs.map +1 -0
  51. data/lib/feelin/js/node_modules/lezer-feel/dist/index.d.ts +32 -0
  52. data/lib/feelin/js/node_modules/lezer-feel/dist/index.js +1323 -0
  53. data/lib/feelin/js/node_modules/lezer-feel/dist/index.js.map +1 -0
  54. data/lib/feelin/js/node_modules/lezer-feel/package.json +61 -0
  55. data/lib/feelin/js/node_modules/luxon/LICENSE.md +7 -0
  56. data/lib/feelin/js/node_modules/luxon/README.md +55 -0
  57. data/lib/feelin/js/node_modules/luxon/build/amd/luxon.js +8623 -0
  58. data/lib/feelin/js/node_modules/luxon/build/amd/luxon.js.map +1 -0
  59. data/lib/feelin/js/node_modules/luxon/build/cjs-browser/luxon.js +8621 -0
  60. data/lib/feelin/js/node_modules/luxon/build/cjs-browser/luxon.js.map +1 -0
  61. data/lib/feelin/js/node_modules/luxon/build/es6/luxon.js +8011 -0
  62. data/lib/feelin/js/node_modules/luxon/build/es6/luxon.js.map +1 -0
  63. data/lib/feelin/js/node_modules/luxon/build/global/luxon.js +8626 -0
  64. data/lib/feelin/js/node_modules/luxon/build/global/luxon.js.map +1 -0
  65. data/lib/feelin/js/node_modules/luxon/build/global/luxon.min.js +1 -0
  66. data/lib/feelin/js/node_modules/luxon/build/global/luxon.min.js.map +1 -0
  67. data/lib/feelin/js/node_modules/luxon/build/node/luxon.js +7679 -0
  68. data/lib/feelin/js/node_modules/luxon/build/node/luxon.js.map +1 -0
  69. data/lib/feelin/js/node_modules/luxon/package.json +87 -0
  70. data/lib/feelin/js/node_modules/luxon/src/datetime.js +2566 -0
  71. data/lib/feelin/js/node_modules/luxon/src/duration.js +990 -0
  72. data/lib/feelin/js/node_modules/luxon/src/errors.js +61 -0
  73. data/lib/feelin/js/node_modules/luxon/src/impl/conversions.js +206 -0
  74. data/lib/feelin/js/node_modules/luxon/src/impl/diff.js +95 -0
  75. data/lib/feelin/js/node_modules/luxon/src/impl/digits.js +90 -0
  76. data/lib/feelin/js/node_modules/luxon/src/impl/english.js +233 -0
  77. data/lib/feelin/js/node_modules/luxon/src/impl/formats.js +176 -0
  78. data/lib/feelin/js/node_modules/luxon/src/impl/formatter.js +409 -0
  79. data/lib/feelin/js/node_modules/luxon/src/impl/invalid.js +14 -0
  80. data/lib/feelin/js/node_modules/luxon/src/impl/locale.js +554 -0
  81. data/lib/feelin/js/node_modules/luxon/src/impl/regexParser.js +335 -0
  82. data/lib/feelin/js/node_modules/luxon/src/impl/tokenParser.js +505 -0
  83. data/lib/feelin/js/node_modules/luxon/src/impl/util.js +316 -0
  84. data/lib/feelin/js/node_modules/luxon/src/impl/zoneUtil.js +34 -0
  85. data/lib/feelin/js/node_modules/luxon/src/info.js +205 -0
  86. data/lib/feelin/js/node_modules/luxon/src/interval.js +665 -0
  87. data/lib/feelin/js/node_modules/luxon/src/luxon.js +26 -0
  88. data/lib/feelin/js/node_modules/luxon/src/package.json +4 -0
  89. data/lib/feelin/js/node_modules/luxon/src/settings.js +180 -0
  90. data/lib/feelin/js/node_modules/luxon/src/zone.js +97 -0
  91. data/lib/feelin/js/node_modules/luxon/src/zones/IANAZone.js +231 -0
  92. data/lib/feelin/js/node_modules/luxon/src/zones/fixedOffsetZone.js +150 -0
  93. data/lib/feelin/js/node_modules/luxon/src/zones/invalidZone.js +53 -0
  94. data/lib/feelin/js/node_modules/luxon/src/zones/systemZone.js +61 -0
  95. data/lib/feelin/js/node_modules/min-dash/LICENSE +21 -0
  96. data/lib/feelin/js/node_modules/min-dash/README.md +38 -0
  97. data/lib/feelin/js/node_modules/min-dash/dist/array.d.ts +12 -0
  98. data/lib/feelin/js/node_modules/min-dash/dist/collection.d.ts +174 -0
  99. data/lib/feelin/js/node_modules/min-dash/dist/fn.d.ts +37 -0
  100. data/lib/feelin/js/node_modules/min-dash/dist/index.cjs +910 -0
  101. data/lib/feelin/js/node_modules/min-dash/dist/index.d.ts +5 -0
  102. data/lib/feelin/js/node_modules/min-dash/dist/index.esm.js +872 -0
  103. data/lib/feelin/js/node_modules/min-dash/dist/lang.d.ts +29 -0
  104. data/lib/feelin/js/node_modules/min-dash/dist/min-dash.js +916 -0
  105. data/lib/feelin/js/node_modules/min-dash/dist/min-dash.min.js +1 -0
  106. data/lib/feelin/js/node_modules/min-dash/dist/object.d.ts +112 -0
  107. data/lib/feelin/js/node_modules/min-dash/package.json +72 -0
  108. data/lib/feelin/js/package-lock.json +72 -0
  109. data/lib/feelin/js/package.json +5 -0
  110. data/lib/feelin/version.rb +3 -0
  111. data/lib/feelin.rb +63 -0
  112. data/spec/feelin/feelin_spec.rb +38 -0
  113. data/spec/spec_helper.rb +2 -0
  114. metadata +198 -0
@@ -0,0 +1,61 @@
1
+ import { formatOffset, parseZoneInfo } from "../impl/util.js";
2
+ import Zone from "../zone.js";
3
+
4
+ let singleton = null;
5
+
6
+ /**
7
+ * Represents the local zone for this JavaScript environment.
8
+ * @implements {Zone}
9
+ */
10
+ export default class SystemZone extends Zone {
11
+ /**
12
+ * Get a singleton instance of the local zone
13
+ * @return {SystemZone}
14
+ */
15
+ static get instance() {
16
+ if (singleton === null) {
17
+ singleton = new SystemZone();
18
+ }
19
+ return singleton;
20
+ }
21
+
22
+ /** @override **/
23
+ get type() {
24
+ return "system";
25
+ }
26
+
27
+ /** @override **/
28
+ get name() {
29
+ return new Intl.DateTimeFormat().resolvedOptions().timeZone;
30
+ }
31
+
32
+ /** @override **/
33
+ get isUniversal() {
34
+ return false;
35
+ }
36
+
37
+ /** @override **/
38
+ offsetName(ts, { format, locale }) {
39
+ return parseZoneInfo(ts, format, locale);
40
+ }
41
+
42
+ /** @override **/
43
+ formatOffset(ts, format) {
44
+ return formatOffset(this.offset(ts), format);
45
+ }
46
+
47
+ /** @override **/
48
+ offset(ts) {
49
+ return -new Date(ts).getTimezoneOffset();
50
+ }
51
+
52
+ /** @override **/
53
+ equals(otherZone) {
54
+ return otherZone.type === "system";
55
+ }
56
+
57
+ /** @override **/
58
+ get isValid() {
59
+ return true;
60
+ }
61
+ }
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017-present camunda Services GmbH
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,38 @@
1
+ # min-dash
2
+
3
+ [![CI](https://github.com/bpmn-io/min-dash/workflows/CI/badge.svg)](https://github.com/bpmn-io/min-dash/actions?query=workflow%3ACI)
4
+
5
+ Minimal utility tool belt to be used with [bpmn.io](https://bpmn.io/) related libraries.
6
+
7
+
8
+ ## Features
9
+
10
+ * fine selection of [powerful utilities](./lib) on board
11
+ * ES2015 compatible
12
+ * complete bundle `< 2 kB` minified and gzipped
13
+ * utilities optimized for speed (i.e. sorting and union only by key)
14
+
15
+
16
+ ## How to use
17
+
18
+ ```javascript
19
+ import {
20
+ find,
21
+ sortBy,
22
+ assign
23
+ } from 'min-dash';
24
+ ```
25
+
26
+ Your favourite module bundler should apply tree-shaking to only include the components your application requires. If you're using CommonJS modules give [common-shake](https://github.com/indutny/common-shake) a try.
27
+
28
+
29
+ ## Related
30
+
31
+ * [1-liners](https://github.com/1-liners/1-liners) - a slightly more opinionated collection of useful utilities
32
+ * [min-dom](https://github.com/bpmn-io/min-dom) - minimal DOM utility toolbelt
33
+ * [tiny-svg](https://github.com/bpmn-io/tiny-svg) - tiny SVG utility toolbelt
34
+
35
+
36
+ ## License
37
+
38
+ MIT
@@ -0,0 +1,12 @@
1
+ import { ArrayCollection } from './collection.js';
2
+
3
+ type Flatten<Type> = Type extends Array<infer Item> ? Item : Type;
4
+
5
+ /**
6
+ * Flatten array, one level deep.
7
+ *
8
+ * @param arr
9
+ *
10
+ * @return
11
+ */
12
+ export function flatten<T>(arr: ArrayCollection<T> | null | undefined): Flatten<T>[];
@@ -0,0 +1,174 @@
1
+
2
+ export type Matcher<T> =
3
+ ((e: T) => boolean) |
4
+ ((e: T, idx: number) => boolean) |
5
+ ((e: T, key: string) => boolean) |
6
+ any;
7
+
8
+ export type Extractor<T, U=T[keyof T]> = ((e: T) => U) | string | number;
9
+
10
+ export type ArrayCollection<T> = Array<T>;
11
+ export type StringKeyValueCollection<T> = { [key: string]: T };
12
+ export type NumberKeyValueCollection<T> = { [key: number]: T };
13
+ export type KeyValueCollection<T> = StringKeyValueCollection<T> | NumberKeyValueCollection<T>;
14
+ export type Collection<T> = KeyValueCollection<T> | ArrayCollection<T> | null | undefined;
15
+
16
+ /**
17
+ * Find element in collection.
18
+ *
19
+ * @param collection
20
+ * @param matcher
21
+ *
22
+ * @return
23
+ */
24
+ export function find<T>(collection: Collection<T>, matcher: Matcher<T>): T | undefined;
25
+
26
+ /**
27
+ * Find element index in collection.
28
+ *
29
+ * @param collection
30
+ * @param matcher
31
+ *
32
+ * @return
33
+ */
34
+ export function findIndex<T>(collection: Collection<T>, matcher: Matcher<T>): number | string | undefined;
35
+
36
+ /**
37
+ * Find element in collection.
38
+ *
39
+ * @param collection
40
+ * @param matcher
41
+ *
42
+ * @return result
43
+ */
44
+ export function filter<T>(collection: Collection<T>, matcher: Matcher<T>): T[];
45
+
46
+ /**
47
+ * Iterate over collection; returning something
48
+ * (non-undefined) will stop iteration.
49
+ *
50
+ * @param collection
51
+ * @param iterator
52
+ *
53
+ * @return return result that stopped the iteration
54
+ */
55
+ export function forEach<T>(collection: Collection<T>, iterator: (item: T, convertKey: any /* TODO */) => boolean | void): T;
56
+
57
+ /**
58
+ * Return collection without element.
59
+ *
60
+ * @param arr
61
+ * @param matcher
62
+ *
63
+ * @return
64
+ */
65
+ export function without<T>(arr: T[], matcher: Matcher<T>): T[];
66
+
67
+ /**
68
+ * Reduce collection, returning a single result.
69
+ *
70
+ * @param collection
71
+ * @param iterator
72
+ * @param result
73
+ *
74
+ * @return result returned from last iterator
75
+ */
76
+ export function reduce<T, V>(collection: Collection<T>, iterator: (result: V, entry: T, index: any) => V, result: V): V;
77
+
78
+ /**
79
+ * Return true if every element in the collection
80
+ * matches the criteria.
81
+ *
82
+ * @param collection
83
+ * @param matcher
84
+ *
85
+ * @return
86
+ */
87
+ export function every<T>(collection: Collection<T>, matcher: Matcher<T>): boolean;
88
+
89
+ /**
90
+ * Return true if some elements in the collection
91
+ * match the criteria.
92
+ *
93
+ * @param collection
94
+ * @param matcher
95
+ *
96
+ * @return
97
+ */
98
+ export function some<T>(collection: Collection<T>, matcher: Matcher<T>): boolean;
99
+
100
+ /**
101
+ * Transform a collection into another collection
102
+ * by piping each member through the given fn.
103
+ *
104
+ * @param collection
105
+ * @param fn
106
+ *
107
+ * @return transformed collection
108
+ */
109
+ export function map<T, U>(collection: Collection<T>, fn: (value: T, key: number) => U): U[];
110
+
111
+ /**
112
+ * Get the collections keys.
113
+ *
114
+ * @param collection
115
+ *
116
+ * @return
117
+ */
118
+ export function keys<T>(collection: Collection<T>): T extends Array<any> ? number[] : (keyof T)[];
119
+
120
+ /**
121
+ * Shorthand for `keys(o).length`.
122
+ *
123
+ * @param collection
124
+ *
125
+ * @return
126
+ */
127
+ export function size<T>(collection: Collection<T>): number;
128
+
129
+ /**
130
+ * Get the values in the collection.
131
+ *
132
+ * @param collection
133
+ *
134
+ * @return
135
+ */
136
+ export function values<T>(collection: Collection<T>): T[];
137
+
138
+ /**
139
+ * Group collection members by attribute.
140
+ *
141
+ * @param collection
142
+ * @param extractor
143
+ *
144
+ * @return map with { attrValue => [ a, b, c ] }
145
+ */
146
+ export function groupBy<T>(collection: Collection<T>, extractor: Extractor<T>, grouped?: any): { [attrValue: string]: any[] };
147
+
148
+ export function uniqueBy<T>(extractor: Extractor<T>, ...collections: Collection<T>[]): T[];
149
+ export function unionBy<T>(extractor: Extractor<T>, ...collections: Collection<T>[]): T[];
150
+
151
+ /**
152
+ * Sort collection by criteria.
153
+ *
154
+ * @param collection
155
+ * @param extractor
156
+ *
157
+ * @return
158
+ */
159
+ export function sortBy<T>(collection: Collection<T>, extractor: Extractor<T, number | string>): T[];
160
+
161
+ /**
162
+ * Create an object pattern matcher.
163
+ *
164
+ * @example
165
+ *
166
+ * const matcher = matchPattern({ id: 1 });
167
+ *
168
+ * let element = find(elements, matcher);
169
+ *
170
+ * @param pattern
171
+ *
172
+ * @return matcherFn
173
+ */
174
+ export function matchPattern<T>(pattern: T): (e: any) => boolean;
@@ -0,0 +1,37 @@
1
+ export type DebouncedFunction = {
2
+ (...args: any[]): any;
3
+ flush: () => void;
4
+ cancel: () => void;
5
+ };
6
+
7
+ /**
8
+ * Debounce fn, calling it only once if
9
+ * the given time elapsed between calls.
10
+ *
11
+ * @param fn
12
+ * @param timeout
13
+ *
14
+ * @return debounced function
15
+ */
16
+ export function debounce(fn: Function, timeout: number): DebouncedFunction;
17
+
18
+ /**
19
+ * Throttle fn, calling at most once
20
+ * in the given interval.
21
+ *
22
+ * @param fn
23
+ * @param interval
24
+ *
25
+ * @return throttled function
26
+ */
27
+ export function throttle(fn: Function, interval: number): (...args: any[]) => void;
28
+
29
+ /**
30
+ * Bind function against target <this>.
31
+ *
32
+ * @param fn
33
+ * @param target
34
+ *
35
+ * @return bound function
36
+ */
37
+ export function bind<T extends Function>(fn: T, target: object): T;