Skip to content

Commit 6546cc8

Browse files
committed
make current
1 parent d1a39b8 commit 6546cc8

13 files changed

Lines changed: 2527 additions & 4650 deletions

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
* text=auto eol=lf
2+
3+
# Shell scripts:LF
4+
*.sh text eol=lf
5+
6+
# Windows scripts: CRLF
7+
*.ps1 text eol=crlf
8+
*.cmd text eol=crlf
9+
*.bat text eol=crlf

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ node_modules
3232
.vscode
3333

3434
.DS_Store
35+
.tsbuildinfo

.markdownlint.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"MD033": {
3+
"allowed_elements": ["br", "kbd"]
4+
},
5+
"MD041": {
6+
"allow_preamble": true
7+
}
8+
}

CODE_OF_CONDUCT.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
- Demonstrating empathy and kindness toward other people
21+
22+
- Being respectful of differing opinions, viewpoints, and experiences
23+
24+
- Giving and gracefully accepting constructive feedback
25+
26+
- Accepting responsibility and apologizing to those affected by our mistakes,
27+
and learning from the experience
28+
29+
- Focusing on what is best not just for us as individuals, but for the overall
30+
community
31+
32+
Examples of unacceptable behavior include:
33+
34+
- The use of sexualized language or imagery, and sexual attention or advances of
35+
any kind
36+
37+
- Trolling, insulting or derogatory comments, and personal or political attacks
38+
39+
- Public or private harassment
40+
41+
- Publishing others' private information, such as a physical or email address,
42+
without their explicit permission
43+
44+
- Other conduct which could reasonably be considered inappropriate in a
45+
professional setting
46+
47+
## Enforcement Responsibilities
48+
49+
Community leaders are responsible for clarifying and enforcing our standards of
50+
acceptable behavior and will take appropriate and fair corrective action in
51+
response to any behavior that they deem inappropriate, threatening, offensive,
52+
or harmful.
53+
54+
Community leaders have the right and responsibility to remove, edit, or reject
55+
comments, commits, code, wiki edits, issues, and other contributions that are
56+
not aligned to this Code of Conduct, and will communicate reasons for moderation
57+
decisions when appropriate.
58+
59+
## Scope
60+
61+
This Code of Conduct applies within all community spaces, and also applies when
62+
an individual is officially representing the community in public spaces.
63+
Examples of representing our community include using an official e-mail address,
64+
posting via an official social media account, or acting as an appointed
65+
representative at an online or offline event.
66+
67+
## Enforcement
68+
69+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
70+
reported to the community leaders responsible for enforcement at
71+
**<corporateapps@cityssm.on.ca>**.
72+
All complaints will be reviewed and investigated promptly and fairly.
73+
74+
All community leaders are obligated to respect the privacy and security of the
75+
reporter of any incident.
76+
77+
## Enforcement Guidelines
78+
79+
Community leaders will follow these Community Impact Guidelines in determining
80+
the consequences for any action they deem in violation of this Code of Conduct:
81+
82+
### 1. Correction
83+
84+
**Community Impact**: Use of inappropriate language or other behavior deemed
85+
unprofessional or unwelcome in the community.
86+
87+
**Consequence**: A private, written warning from community leaders, providing
88+
clarity around the nature of the violation and an explanation of why the
89+
behavior was inappropriate. A public apology may be requested.
90+
91+
### 2. Warning
92+
93+
**Community Impact**: A violation through a single incident or series of
94+
actions.
95+
96+
**Consequence**: A warning with consequences for continued behavior. No
97+
interaction with the people involved, including unsolicited interaction with
98+
those enforcing the Code of Conduct, for a specified period of time. This
99+
includes avoiding interactions in community spaces as well as external channels
100+
like social media. Violating these terms may lead to a temporary or permanent
101+
ban.
102+
103+
### 3. Temporary Ban
104+
105+
**Community Impact**: A serious violation of community standards, including
106+
sustained inappropriate behavior.
107+
108+
**Consequence**: A temporary ban from any sort of interaction or public
109+
communication with the community for a specified period of time. No public or
110+
private interaction with the people involved, including unsolicited interaction
111+
with those enforcing the Code of Conduct, is allowed during this period.
112+
Violating these terms may lead to a permanent ban.
113+
114+
### 4. Permanent Ban
115+
116+
**Community Impact**: Demonstrating a pattern of violation of community
117+
standards, including sustained inappropriate behavior, harassment of an
118+
individual, or aggression toward or disparagement of classes of individuals.
119+
120+
**Consequence**: A permanent ban from any sort of public interaction within the
121+
community.
122+
123+
## Attribution
124+
125+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
126+
version 2.1, available at
127+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
128+
129+
Community Impact Guidelines were inspired by
130+
[Mozilla's code of conduct enforcement ladder][mozilla coc].
131+
132+
For answers to common questions about this code of conduct, see the FAQ at
133+
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
134+
[https://www.contributor-covenant.org/translations][translations].
135+
136+
[homepage]: https://www.contributor-covenant.org
137+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
138+
[mozilla coc]: https://github.com/mozilla/diversity
139+
[faq]: https://www.contributor-covenant.org/faq
140+
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Thank you for your interest in making express-abuse-points better
2+
3+
Together, we can build high quality software that meets the needs of municipalities,
4+
while remaining open and budget conscious.
5+
6+
**Thank you for taking the time to read the contributing guidelines.**
7+
8+
## All contributions are welcome
9+
10+
Being a very small team, contributions are greatly appreciated. How can you contribute?
11+
12+
- **Promote this project!**
13+
- Documentation and tutorials
14+
- Submit bug reports (or fix them!)
15+
- Request new features (or build them!)
16+
17+
## Please Read the Code of Conduct
18+
19+
The [Code of Conduct](CODE_OF_CONDUCT.md) document describes how we should act
20+
when working together. Be nice! :smile:
21+
22+
## How to report a bug or suggest an enhancement
23+
24+
**If you find a security vulnerability, do NOT open an issue. Email
25+
<corporateapps@cityssm.on.ca> instead.**
26+
27+
For all other bug reports, feature requests, or enhancements,
28+
open an issue and use the closest template.
29+
30+
## Thanks Again
31+
32+
We are a very small team with big aspirations and limited resources.
33+
Thank you for helping with this project in any way you can!

SECURITY.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Security Policy
2+
3+
**Thank you for your interest in keeping this project safe for everyone.**
4+
5+
## Supported Versions
6+
7+
Due to limited resources, only the latest version is supported only for security updates.
8+
9+
## Reporting a Vulnerability
10+
11+
To report a security vulnerability,
12+
please email <corporateapps@cityssm.on.ca>.
13+
14+
Every attempt will be made to resolve confirmed vulnerabilities
15+
in a timely manner.

cspell.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2",
3+
"ignorePaths": [],
4+
"dictionaryDefinitions": [],
5+
"dictionaries": [],
6+
"words": [
7+
"cityssm"
8+
],
9+
"ignoreWords": [],
10+
"import": []
11+
}

index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { type Difference } from './types.js';
22
/**
33
* Get deep difference between two objects. An empty array will be returned for two same objects comparing.
4-
* @param valueFrom value comparing on the left
5-
* @param valueTo value comparing on the right
4+
* @param valueFrom - value comparing on the left
5+
* @param valueTo - value comparing on the right
66
* @returns List of differences. An empty array will be returned for two same objects comparing.
77
*/
88
export default function getObjectDifference(valueFrom: unknown, valueTo: unknown): Difference[];

index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ function _getArrayDifferenceByKey(parentName, propertyName, a1, a2, keyProperty)
2626
const diff = [];
2727
function comparer(otherArray) {
2828
return function (current) {
29-
return (otherArray.filter((other) => other[keyProperty] === current[keyProperty]).length === 0);
29+
if (!isObject(current)) {
30+
return true;
31+
}
32+
return (otherArray.filter((other) => isObject(other) && other[keyProperty] === current[keyProperty]).length === 0);
3033
};
3134
}
3235
const onlyInA1 = a1.filter(comparer(a2));
@@ -153,8 +156,8 @@ function _getObjectDifference(parentName, propertyName, valueFrom, valueTo, conf
153156
}
154157
/**
155158
* Get deep difference between two objects. An empty array will be returned for two same objects comparing.
156-
* @param valueFrom value comparing on the left
157-
* @param valueTo value comparing on the right
159+
* @param valueFrom - value comparing on the left
160+
* @param valueTo - value comparing on the right
158161
* @returns List of differences. An empty array will be returned for two same objects comparing.
159162
*/
160163
export default function getObjectDifference(valueFrom, valueTo) {

index.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,14 @@ function _getArrayDifferenceByKey(
7777

7878
function comparer(otherArray: unknown[]) {
7979
return function (current: unknown) {
80+
if (!isObject(current)) {
81+
return true
82+
}
83+
8084
return (
8185
otherArray.filter(
82-
(other) => other[keyProperty] === current[keyProperty]
86+
(other) =>
87+
isObject(other) && other[keyProperty] === current[keyProperty]
8388
).length === 0
8489
)
8590
}
@@ -156,6 +161,7 @@ function _getObjectDifference(
156161
diff.push({
157162
property: _getFullPropertyName(parentName, propertyName),
158163
type: differenceType,
164+
159165
from: valueFrom,
160166
to: valueTo
161167
})
@@ -177,6 +183,7 @@ function _getObjectDifference(
177183
diff.push({
178184
property: _getFullPropertyName(parentName, propertyName),
179185
type: differenceType,
186+
180187
from: valueFrom,
181188
to: valueTo
182189
})
@@ -192,6 +199,7 @@ function _getObjectDifference(
192199
diff.push({
193200
property: _getFullPropertyName(parentName, propertyName),
194201
type: VALUE_UPDATED,
202+
195203
from: valueFrom,
196204
to: valueTo
197205
})
@@ -203,6 +211,7 @@ function _getObjectDifference(
203211
diff.push({
204212
property: _getFullPropertyName(parentName, propertyName),
205213
type: NOT_COMPARABLE,
214+
206215
from: valueFrom,
207216
to: valueTo
208217
})
@@ -214,6 +223,7 @@ function _getObjectDifference(
214223
diff.push({
215224
property: _getFullPropertyName(parentName, propertyName),
216225
type: VALUE_UPDATED,
226+
217227
from: valueFrom,
218228
to: valueTo
219229
})
@@ -294,8 +304,8 @@ function _getObjectDifference(
294304

295305
/**
296306
* Get deep difference between two objects. An empty array will be returned for two same objects comparing.
297-
* @param valueFrom value comparing on the left
298-
* @param valueTo value comparing on the right
307+
* @param valueFrom - value comparing on the left
308+
* @param valueTo - value comparing on the right
299309
* @returns List of differences. An empty array will be returned for two same objects comparing.
300310
*/
301311
export default function getObjectDifference(

0 commit comments

Comments
 (0)