Compare commits
1
Commits
0.17.3
..
d0fe6a2e85
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0fe6a2e85 |
No files matched your search
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"es.js","sources":["../index.js"],"sourcesContent":["const defaultOptions = [\r\n {\r\n id: 0,\r\n value: \"Too weak\",\r\n minDiversity: 0,\r\n minLength: 0\r\n },\r\n {\r\n id: 1,\r\n value: \"Weak\",\r\n minDiversity: 2,\r\n minLength: 6\r\n },\r\n {\r\n id: 2,\r\n value: \"Medium\",\r\n minDiversity: 4,\r\n minLength: 8\r\n },\r\n {\r\n id: 3,\r\n value: \"Strong\",\r\n minDiversity: 4,\r\n minLength: 10\r\n }\r\n]\r\n\r\nconst passwordStrength = (password, options = defaultOptions, allowedSymbols=\"!\\\"#\\$%&'\\(\\)\\*\\+,-\\./:;<=>\\?@\\[\\\\\\\\\\\\]\\^_`\\{|\\}~\") => {\r\n \r\n let passwordCopy = password || ''\r\n\r\n options[0].minDiversity = 0,\r\n options[0].minLength = 0\r\n\r\n const rules = [\r\n {\r\n regex: \"[a-z]\",\r\n message: 'lowercase'\r\n },\r\n {\r\n regex: '[A-Z]',\r\n message: 'uppercase'\r\n },\r\n {\r\n regex: '[0-9]',\r\n message: 'number'\r\n },\r\n ]\r\n\r\n if (allowedSymbols) {\r\n rules.push({\r\n regex: `[${allowedSymbols}]`,\r\n message: 'symbol'\r\n })\r\n }\r\n\r\n let strength = {}\r\n\r\n strength.contains = rules\r\n .filter(rule => new RegExp(`${rule.regex}`).test(passwordCopy))\r\n .map(rule => rule.message)\r\n\r\n strength.length = passwordCopy.length;\r\n\r\n let fulfilledOptions = options\r\n .filter(option => strength.contains.length >= option.minDiversity)\r\n .filter(option => strength.length >= option.minLength)\r\n .sort((o1, o2) => o2.id - o1.id)\r\n .map(option => ({id: option.id, value: option.value}))\r\n\r\n Object.assign(strength, fulfilledOptions[0])\r\n\r\n return strength;\r\n};\r\n\r\nmodule.exports = { passwordStrength, defaultOptions }"],"names":[],"mappings":"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"}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
# This workflow checks out code, performs a Codacy security scan
|
||||
# and integrates the results with the
|
||||
# GitHub Advanced Security code scanning feature. For more information on
|
||||
# the Codacy security scan action usage and parameters, see
|
||||
# https://github.com/codacy/codacy-analysis-cli-action.
|
||||
# For more information on Codacy Analysis CLI in general, see
|
||||
# https://github.com/codacy/codacy-analysis-cli.
|
||||
|
||||
name: Codacy Security Scan
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, releases/* ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ master ]
|
||||
schedule:
|
||||
- cron: '21 11 * * 2'
|
||||
|
||||
jobs:
|
||||
codacy-security-scan:
|
||||
name: Codacy Security Scan
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Checkout the repository to the GitHub Actions runner
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
|
||||
- name: Run Codacy Analysis CLI
|
||||
uses: codacy/codacy-analysis-cli-action@1.1.0
|
||||
with:
|
||||
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
|
||||
# You can also omit the token and run the tools that support default configurations
|
||||
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
||||
verbose: true
|
||||
output: results.sarif
|
||||
format: sarif
|
||||
# Adjust severity of non-security issues
|
||||
gh-code-scanning-compat: true
|
||||
# Force 0 exit code to allow SARIF file generation
|
||||
# This will handover control about PR rejection to the GitHub side
|
||||
max-allowed-issues: 2147483647
|
||||
|
||||
# Upload the SARIF file generated in the previous step
|
||||
- name: Upload SARIF results file
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import pkg from './package.json';
|
||||
|
||||
export default [
|
||||
{
|
||||
input: 'index.js',
|
||||
output: [
|
||||
{
|
||||
file: pkg.browser,
|
||||
format: 'umd',
|
||||
name: 'chyme',
|
||||
sourcemap: true
|
||||
},
|
||||
{
|
||||
file: pkg.module,
|
||||
format: 'es',
|
||||
sourcemap: true
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
import { expectType } from "tsd";
|
||||
import { DiversityType, passwordStrength } from "./index";
|
||||
|
||||
// Test result types
|
||||
expectType<string>(passwordStrength("asdfasdf").value);
|
||||
expectType<number>(passwordStrength("asdfasdf").id);
|
||||
expectType<number>(passwordStrength("asdfasdf").length);
|
||||
expectType<DiversityType[]>(passwordStrength("asdfasdf").contains);
|
||||
|
||||
// Test options with custom value (string)
|
||||
expectType<string>(
|
||||
passwordStrength("asdfasdf", [
|
||||
{
|
||||
id: 0,
|
||||
value: "Too weak",
|
||||
minDiversity: 0,
|
||||
minLength: 0,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
value: "Weak",
|
||||
minDiversity: 2,
|
||||
minLength: 6,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: "Medium",
|
||||
minDiversity: 4,
|
||||
minLength: 8,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: "Strong",
|
||||
minDiversity: 4,
|
||||
minLength: 10,
|
||||
},
|
||||
]).value
|
||||
);
|
||||
|
||||
// Test options with custom value (object)
|
||||
expectType<{ message: string, color: string }>(
|
||||
passwordStrength("asdfasdf", [
|
||||
{
|
||||
id: 0,
|
||||
value: {message: "Too weak", color: "red"},
|
||||
minDiversity: 0,
|
||||
minLength: 0,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
value: {message: "Weak", color: "orange"},
|
||||
minDiversity: 2,
|
||||
minLength: 6,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: {message: "Medium", color: "yellow"},
|
||||
minDiversity: 4,
|
||||
minLength: 8,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: {message: "Strong", color: "green"},
|
||||
minDiversity: 4,
|
||||
minLength: 10,
|
||||
},
|
||||
]).value
|
||||
);
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "check-password-strength",
|
||||
"version": "2.0.7",
|
||||
"description": "A NPM Password strength checker based from Javascript RegExp. Check passphrase if it's \"Too weak\", \"Weak\", \"Medium\" or \"Strong\"",
|
||||
"main": "index.js",
|
||||
"browser": "dist/umd.js",
|
||||
"module": "dist/es.js",
|
||||
"types": "index.d.ts",
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"test": "jest",
|
||||
"test:types": "tsd"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/deanilvincent/check-password-strength.git"
|
||||
},
|
||||
"keywords": [
|
||||
"npm",
|
||||
"password",
|
||||
"strength",
|
||||
"checker",
|
||||
"check password strength",
|
||||
"password strength checker",
|
||||
"strength checker",
|
||||
"password checker",
|
||||
"password checker strength",
|
||||
"strength password checker",
|
||||
"check-password-strength",
|
||||
"password-strength-checker",
|
||||
"strength-checker",
|
||||
"password-checker",
|
||||
"password-checker-strength",
|
||||
"strength-password-checker",
|
||||
"pass-strength"
|
||||
],
|
||||
"author": "deanilvincent",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/deanilvincent/check-password-strength/issues"
|
||||
},
|
||||
"homepage": "https://github.com/deanilvincent/check-password-strength#readme",
|
||||
"devDependencies": {
|
||||
"jest": "^26.4.2",
|
||||
"rollup": "^2.77.0",
|
||||
"tsd": "^0.14.0"
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
# Node.js
|
||||
# Build a general Node.js project with npm.
|
||||
# Add steps that analyze code, save build artifacts, deploy, and more:
|
||||
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
|
||||
|
||||
trigger:
|
||||
- master
|
||||
- releases/*
|
||||
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '10.x'
|
||||
displayName: 'Install Node.js'
|
||||
|
||||
- script: |
|
||||
npm install
|
||||
npm test
|
||||
displayName: 'npm install and test'
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.OpenAPI = void 0;
|
||||
exports.OpenAPI = {
|
||||
BASE: '',
|
||||
VERSION: '0.14.0',
|
||||
WITH_CREDENTIALS: false,
|
||||
TOKEN: undefined,
|
||||
USERNAME: undefined,
|
||||
PASSWORD: undefined,
|
||||
HEADERS: undefined,
|
||||
};
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"name":"check-password-strength","version":"2.0.7","files":{"LICENSE.md":{"checkedAt":1678889113301,"integrity":"sha512-VqUVGe5gNe6lHbf6vQlrglCD3yHXeW/WGgJBcdrZ4YtPEZ3Sq/w1k6/rMPyQ37/Wq4/hfA8ljsFLRi6INnGN/g==","mode":420,"size":1097},".travis.yml":{"checkedAt":1678889113301,"integrity":"sha512-A/mMgoUpZ2zMgWjlq52EVnyxATfwM3PEbIdM3dujKBHRCalNEKu0rI0YV+F/2BX+XtS1fOsbGAQUmdY4NoTA+A==","mode":420,"size":41},"dist/es.js":{"checkedAt":1678889113300,"integrity":"sha512-6DE0rqS2y++vzS32+uvBzfqsuRuVIaiXqCUDWwWHFB+EigZIgFLKoBkXhBpeD4PfasskBO8ivUFlDXTkmsICvA==","mode":420,"size":1589},"index.js":{"checkedAt":1678889113301,"integrity":"sha512-l0UWsxSks3GIfoKpoKsVfdFBuE1Jv/QI86d23YRkWeqpN6X7LelkvCMOs3gdYJWlWuWTWTWzwRSYfvkuaWJQQQ==","mode":420,"size":1547},"index.test.js":{"checkedAt":1678889113301,"integrity":"sha512-+DNktajWOi93jla9dYdXRYz+Xji2o74RPFhhyml9UvfO8OnuJT9imKR+2qZityErntgBLP1BlEdMsIgfonqi1w==","mode":420,"size":13270},"rollup.config.js":{"checkedAt":1678889113301,"integrity":"sha512-MLFTq2547grcMy1L1IrAcN9iegfh8Y2S6NdeEjXUnfMp/Xs6yi4pBSK5fobmOarHTuvkMY96BdjDXDeaMwjdzw==","mode":420,"size":280},"dist/es.js.map":{"checkedAt":1678889113301,"integrity":"sha512-Cu1Ezu7irLBsUxaA05V0mixehmNYNgmfb8BGntBpyZi1ilG42TcTRYHC14h1P4U0+uxUXCZhokB2Sr2hMj3ltw==","mode":420,"size":3867},"package.json":{"checkedAt":1678889113301,"integrity":"sha512-NpAJqDlTDXOT8z419pt2zV9FGj/BTk8jU+KNaCkN+CrYvep9BqKeGMaRD0m/A6QO4sOjJg6uUtmt6zlu5EPqSg==","mode":420,"size":1353},"dist/umd.js":{"checkedAt":1678889113301,"integrity":"sha512-htBHZPnKsY10UAOzckkIo6ENf5SvYdI1hmby8ofKGYOx1biExxV5H2CNGIw66/mjWORZdRkxZTemPklU9JTlDQ==","mode":420,"size":1859},"dist/umd.js.map":{"checkedAt":1678889113303,"integrity":"sha512-cWU3RJM2WWqsUqk57fHfiAXmVE7XJktVTqGmC5yNImURVdl0yJoXzXihtI13d0XSPhUsC9lp9i9S745pO0TbSw==","mode":420,"size":3879},"README.md":{"checkedAt":1678889113303,"integrity":"sha512-ikko+p8xFvjT1I4E/dV9/hnib603h5+eetyKyoQnIevadSFXWIGedzr0m0HckqRazzqbjHEdyxP+JZy3t+JLeA==","mode":420,"size":7928},"index.d.ts":{"checkedAt":1678889113303,"integrity":"sha512-1GHeFi+GOpCUykLA7h4+hvmKgQGPlQOUSjOodANJ4gH+/uw3YPCGixKGcxKzLxTtonUlB5jV5AwNDIC5L36G4A==","mode":420,"size":644},"index.test-d.ts":{"checkedAt":1678889113303,"integrity":"sha512-MxqEDRwckvBDX6gP6luNlRrQk4wZdHYrm/mGyyBseF1zP1FrFezCb3DLMou9CNKZvQXY4NwMhw4z48nvtXneVA==","mode":420,"size":1513},"azure-pipelines.yml":{"checkedAt":1678889113304,"integrity":"sha512-RU6GklNtAAoveFPKcrvQCKkJNvmjaTfomdXw99mlHCJ2nIuSc1rm7U36KnO7l7nCTKaOqayhWMVIyLbul0JZvQ==","mode":420,"size":458},".github/workflows/codacy-analysis.yml":{"checkedAt":1678889113304,"integrity":"sha512-JbnO1GiKsXrRilYqOK0Ox5vWtugpn7RBq/bI3Nj3t4wH1jd1ZH8UmaZhOUQgU7rXD/4Ei+5Nz4cYhQ9bFe8t6Q==","mode":420,"size":1965}}}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"umd.js","sources":["../index.js"],"sourcesContent":["const defaultOptions = [\r\n {\r\n id: 0,\r\n value: \"Too weak\",\r\n minDiversity: 0,\r\n minLength: 0\r\n },\r\n {\r\n id: 1,\r\n value: \"Weak\",\r\n minDiversity: 2,\r\n minLength: 6\r\n },\r\n {\r\n id: 2,\r\n value: \"Medium\",\r\n minDiversity: 4,\r\n minLength: 8\r\n },\r\n {\r\n id: 3,\r\n value: \"Strong\",\r\n minDiversity: 4,\r\n minLength: 10\r\n }\r\n]\r\n\r\nconst passwordStrength = (password, options = defaultOptions, allowedSymbols=\"!\\\"#\\$%&'\\(\\)\\*\\+,-\\./:;<=>\\?@\\[\\\\\\\\\\\\]\\^_`\\{|\\}~\") => {\r\n \r\n let passwordCopy = password || ''\r\n\r\n options[0].minDiversity = 0,\r\n options[0].minLength = 0\r\n\r\n const rules = [\r\n {\r\n regex: \"[a-z]\",\r\n message: 'lowercase'\r\n },\r\n {\r\n regex: '[A-Z]',\r\n message: 'uppercase'\r\n },\r\n {\r\n regex: '[0-9]',\r\n message: 'number'\r\n },\r\n ]\r\n\r\n if (allowedSymbols) {\r\n rules.push({\r\n regex: `[${allowedSymbols}]`,\r\n message: 'symbol'\r\n })\r\n }\r\n\r\n let strength = {}\r\n\r\n strength.contains = rules\r\n .filter(rule => new RegExp(`${rule.regex}`).test(passwordCopy))\r\n .map(rule => rule.message)\r\n\r\n strength.length = passwordCopy.length;\r\n\r\n let fulfilledOptions = options\r\n .filter(option => strength.contains.length >= option.minDiversity)\r\n .filter(option => strength.length >= option.minLength)\r\n .sort((o1, o2) => o2.id - o1.id)\r\n .map(option => ({id: option.id, value: option.value}))\r\n\r\n Object.assign(strength, fulfilledOptions[0])\r\n\r\n return strength;\r\n};\r\n\r\nmodule.exports = { passwordStrength, defaultOptions }"],"names":[],"mappings":";;;;;EAAA,MAAM,cAAc,GAAG;EACvB,EAAE;EACF,IAAI,EAAE,EAAE,CAAC;EACT,IAAI,KAAK,EAAE,UAAU;EACrB,IAAI,YAAY,EAAE,CAAC;EACnB,IAAI,SAAS,EAAE,CAAC;EAChB,GAAG;EACH,EAAE;EACF,IAAI,EAAE,EAAE,CAAC;EACT,IAAI,KAAK,EAAE,MAAM;EACjB,IAAI,YAAY,EAAE,CAAC;EACnB,IAAI,SAAS,EAAE,CAAC;EAChB,GAAG;EACH,EAAE;EACF,IAAI,EAAE,EAAE,CAAC;EACT,IAAI,KAAK,EAAE,QAAQ;EACnB,IAAI,YAAY,EAAE,CAAC;EACnB,IAAI,SAAS,EAAE,CAAC;EAChB,GAAG;EACH,EAAE;EACF,IAAI,EAAE,EAAE,CAAC;EACT,IAAI,KAAK,EAAE,QAAQ;EACnB,IAAI,YAAY,EAAE,CAAC;EACnB,IAAI,SAAS,EAAE,EAAE;EACjB,GAAG;EACH,EAAC;AACD;EACA,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,OAAO,GAAG,cAAc,EAAE,cAAc,CAAC,mDAAmD,KAAK;EACrI;EACA,EAAE,IAAI,YAAY,GAAG,QAAQ,IAAI,GAAE;AACnC;EACA,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC;EAC7B,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAC;AAC1B;EACA,EAAE,MAAM,KAAK,GAAG;EAChB,IAAI;EACJ,MAAM,KAAK,EAAE,OAAO;EACpB,MAAM,OAAO,EAAE,WAAW;EAC1B,KAAK;EACL,IAAI;EACJ,MAAM,KAAK,EAAE,OAAO;EACpB,MAAM,OAAO,EAAE,WAAW;EAC1B,KAAK;EACL,IAAI;EACJ,MAAM,KAAK,EAAE,OAAO;EACpB,MAAM,OAAO,EAAE,QAAQ;EACvB,KAAK;EACL,IAAG;AACH;EACA,EAAE,IAAI,cAAc,EAAE;EACtB,IAAI,KAAK,CAAC,IAAI,CAAC;EACf,MAAM,KAAK,EAAE,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC;EAClC,MAAM,OAAO,EAAE,QAAQ;EACvB,KAAK,EAAC;EACN,GAAG;AACH;EACA,EAAE,IAAI,QAAQ,GAAG,GAAE;AACnB;EACA,EAAE,QAAQ,CAAC,QAAQ,GAAG,KAAK;EAC3B,KAAK,MAAM,CAAC,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;EACnE,KAAK,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAC;AAC9B;EACA,EAAE,QAAQ,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;AACxC;EACA,EAAE,IAAI,gBAAgB,GAAG,OAAO;EAChC,KAAK,MAAM,CAAC,MAAM,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC;EACtE,KAAK,MAAM,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC;EAC1D,KAAK,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;EACpC,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAC;AAC1D;EACA,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAC;AAC9C;EACA,EAAE,OAAO,QAAQ,CAAC;EAClB,CAAC,CAAC;AACF;EACA,MAAM,CAAC,OAAO,GAAG,EAAE,gBAAgB,EAAE,cAAc;;;;;;"}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
(function (factory) {
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
factory();
|
||||
})((function () { 'use strict';
|
||||
|
||||
const defaultOptions = [
|
||||
{
|
||||
id: 0,
|
||||
value: "Too weak",
|
||||
minDiversity: 0,
|
||||
minLength: 0
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
value: "Weak",
|
||||
minDiversity: 2,
|
||||
minLength: 6
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: "Medium",
|
||||
minDiversity: 4,
|
||||
minLength: 8
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: "Strong",
|
||||
minDiversity: 4,
|
||||
minLength: 10
|
||||
}
|
||||
];
|
||||
|
||||
const passwordStrength = (password, options = defaultOptions, allowedSymbols="!\"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\\\\]\^_`\{|\}~") => {
|
||||
|
||||
let passwordCopy = password || '';
|
||||
|
||||
options[0].minDiversity = 0,
|
||||
options[0].minLength = 0;
|
||||
|
||||
const rules = [
|
||||
{
|
||||
regex: "[a-z]",
|
||||
message: 'lowercase'
|
||||
},
|
||||
{
|
||||
regex: '[A-Z]',
|
||||
message: 'uppercase'
|
||||
},
|
||||
{
|
||||
regex: '[0-9]',
|
||||
message: 'number'
|
||||
},
|
||||
];
|
||||
|
||||
if (allowedSymbols) {
|
||||
rules.push({
|
||||
regex: `[${allowedSymbols}]`,
|
||||
message: 'symbol'
|
||||
});
|
||||
}
|
||||
|
||||
let strength = {};
|
||||
|
||||
strength.contains = rules
|
||||
.filter(rule => new RegExp(`${rule.regex}`).test(passwordCopy))
|
||||
.map(rule => rule.message);
|
||||
|
||||
strength.length = passwordCopy.length;
|
||||
|
||||
let fulfilledOptions = options
|
||||
.filter(option => strength.contains.length >= option.minDiversity)
|
||||
.filter(option => strength.length >= option.minLength)
|
||||
.sort((o1, o2) => o2.id - o1.id)
|
||||
.map(option => ({id: option.id, value: option.value}));
|
||||
|
||||
Object.assign(strength, fulfilledOptions[0]);
|
||||
|
||||
return strength;
|
||||
};
|
||||
|
||||
module.exports = { passwordStrength, defaultOptions };
|
||||
|
||||
}));
|
||||
//# sourceMappingURL=umd.js.map
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"name":"svelte-preprocess","version":"4.7.0","files":{"LICENSE":{"checkedAt":1678883672787,"integrity":"sha512-y9ZznyO7gLKWA8yFV93oHbK58RdKWLoMw6XnWnp6CEiGw9ROHBpG1vlIQKiWHv1//XgnAROGfaEiDXgbDFuFCg==","mode":420,"size":1128},"dist/autoProcess.js":{"checkedAt":1678883672787,"integrity":"sha512-JP6qxcJZokBeWNjpZ6NcoZYJLLHvEXVxB1dvijW/i1mUOXfPBcoOoKBI2hSQlFta/+7t2gku7OuWWqgi1sTt9w==","mode":420,"size":8448},"dist/processors/babel.js":{"checkedAt":1678883672787,"integrity":"sha512-9TOyQyYZLuklvQ2SnQZxNhJ+sIaL26SSrM5ybaNwBIHo5VsV9X3aPhus9Y2mUcLl+EKdRTHejvsp4UoFvlFdbw==","mode":420,"size":1746},"dist/transformers/babel.js":{"checkedAt":1678883672787,"integrity":"sha512-YXMTuijuBsUKO8o0UjjJgyXiWc8g4yJBWNMirEn3mhi1pleLcPAPGmXUIl5uPzCkbk0dH7ijrny/63tCmdPcHQ==","mode":420,"size":772},"dist/processors/coffeescript.js":{"checkedAt":1678883672789,"integrity":"sha512-rFZCaf8P50XKWdQoTeGkfhG9t5ITTRj1MK/3dYCPF+pNA3Yte5Pc35YOeCBm3X+i6om4MlIzeGWXSAW06J8blA==","mode":420,"size":1960},"dist/transformers/coffeescript.js":{"checkedAt":1678883672789,"integrity":"sha512-UtiXG8zS+G7jFLbHo5s4aUpcrCFvF0JTxSw1588YINlwJli0oZ9pChg0hibsG/XkJcgiTUo3HAQywV3Wdd5+ZA==","mode":420,"size":1220},"dist/modules/errors.js":{"checkedAt":1678883672790,"integrity":"sha512-j/k5GyiWAevUeJYxOjBwwNFZdtEtGcv1gk3MFPfwXfV3MX/5EXOcmvK23IpivyzDj276w6lJ44RJFo9Qfh6fJw==","mode":420,"size":397},"dist/modules/globalifySelector.js":{"checkedAt":1678883672789,"integrity":"sha512-l7vzUlQjPsol9SDKRJEKd9r0kXma7rLlE8RdIgSGI4b3X3I/L5wGefOW+LbG81XknI4n93UyV/IqwdlcdGQYow==","mode":420,"size":1742},"dist/processors/globalStyle.js":{"checkedAt":1678883672789,"integrity":"sha512-yCyZ6xCdKqo/8DFSdpIlwALJHtE2VbPHpVndKgrsxLaFn+uMy1nHqPa3QlhpNJW4g0h+jbugxl1Bk89R6zbFNA==","mode":420,"size":1340},"dist/transformers/globalStyle.js":{"checkedAt":1678883672789,"integrity":"sha512-BKGgZlegG7Pr4oMUn0i7CvfgOFbsV7pxyFnarPB4krEKRsEnM6ZlZvHJQ5T+fH7mkmyKQfDUIGwguF/IOud5Zg==","mode":420,"size":2515},"dist/index.js":{"checkedAt":1678883672789,"integrity":"sha512-Xlno22x5ZF5CzBwqQ+siR6yeEi6qjXFnxP7OR0NZXbIIODFsLWbD5xQFKO20FnlA4yNErR/JWOQk7ESw7Mc48A==","mode":420,"size":2631},"dist/types/index.js":{"checkedAt":1678883672791,"integrity":"sha512-nOw0Rz+YbxMfnrbE8gD7uXGrUrpmNxqdJYa0PVmk3YJ+LqqMm29YHP3m+65+Sw3jomBryBRCSCXM3/AGhU26hg==","mode":420,"size":1041},"dist/modules/language.js":{"checkedAt":1678883672791,"integrity":"sha512-z80k7SLwTUZB4BhkfHwwv36lfnAYm1uAPMwdH2IUEo9Xf6FKktU7oc9x2mOaHNWK1Z4yRUbMnfdanMy+qXrYbg==","mode":420,"size":3042},"dist/processors/less.js":{"checkedAt":1678883672791,"integrity":"sha512-XPI3f8Jx4ci4aqDcwpJVf3wClCQeaL7QO/KzaOXg1DE+dEsCK4x0AgbLaD19iqaoEeXaOY2wymR+Pz1lRYv3Uw==","mode":420,"size":1830},"dist/transformers/less.js":{"checkedAt":1678883672791,"integrity":"sha512-U0fqw45PZCJveOR/B1suKkVua4xchPUPDFa8g3GmlNcszJfb1MQL7PI+krZks/9ahvDOIcpwVPR5LKq7FQ7iFA==","mode":420,"size":781},"dist/modules/markup.js":{"checkedAt":1678883672791,"integrity":"sha512-nIalsFVk6yncJN6E+JTSELajKj11Ulm96xWmA6RpLP/alA5iqQmPSMutfeZ7T5P2nQHVzRyPFXOJqKSfNBvnyQ==","mode":420,"size":1521},"dist/types/options.js":{"checkedAt":1678883670006,"integrity":"sha512-f2XGQDoj2T+xSOglmwEtZVKrO/8Xj0p9ap2c7A9gQp/BiZ45tLyozAivx12afHv9sT/DcspjyF6yKwNV601gAA==","mode":420,"size":77},"dist/processors/postcss.js":{"checkedAt":1678883672791,"integrity":"sha512-C1sfrV36hd0uh3cxXQORWNVAnFL0NqOtDmxudpxYcm5ZsaLI2n5qEJGMyWYVcD9M4O3qnIaZOb4TzmrlVAgIfg==","mode":420,"size":1902},"dist/transformers/postcss.js":{"checkedAt":1678883672792,"integrity":"sha512-dYwPmK6RV2XGYWmYka9iWVJM118eEwguu7WcXcA+/YRY9ZqWrPEzelqjAhZUKUMSf4xaJi2P2Tu4HzonNzrrow==","mode":420,"size":3273},"dist/modules/prepareContent.js":{"checkedAt":1678883672792,"integrity":"sha512-O4ehoRf1NLruwk98VEvyk1y35cv9VQ5nXOhsUl9iO7GG37LGBg8+uTUFkxOlRSFJ2ejekTAvRFCncY47jolKcw==","mode":420,"size":742},"dist/processors/pug.js":{"checkedAt":1678883672792,"integrity":"sha512-HvZzN5u11rYF24rZLlbEE2ACyo645fOtqI1ArnGwmzsdgcCK7MoWYAL46+QQ2H4eXf+FQk4UsbYl7fAb/59p5g==","mode":420,"size":1519},"dist/transformers/pug.js":{"checkedAt":1678883672792,"integrity":"sha512-zunZOReWU4/4WS58X18JQrwqpY9n+2LGIWdnTG3cbmBT/uHQ+BahWp7Y3ny13KmwJ/Qx/PBixPoPgA6U3HbSyQ==","mode":420,"size":1615},"dist/processors/replace.js":{"checkedAt":1678883672792,"integrity":"sha512-syu45me1VU7GpApbUnJXIkInGabLGbO3De+uNRE5Q4k5D9fLtOvmWh9euery80m0xoUOp5JIGqFvwDa46ghaXQ==","mode":420,"size":1201},"dist/transformers/replace.js":{"checkedAt":1678883672792,"integrity":"sha512-Cg9jrc1H6fHybplqWTnVNojI7mK2LmWdwrWYHm7mru+U9u2G1Uuoy1tRvTf8XYznZhVmva/ncUOH6DSyDWq6KA==","mode":420,"size":387},"dist/processors/scss.js":{"checkedAt":1678883672792,"integrity":"sha512-BPuUbXEmDcvRnKrAH4mlEz/tOD3kwCPrWIfztgWs9NB8kHNKtZ6RfpIReoGxzpVl827hcS2DyJNCQt8lJEz4Hg==","mode":420,"size":2019},"dist/transformers/scss.js":{"checkedAt":1678883672794,"integrity":"sha512-hwHOHEEgtZf/NiHxGlKNloilHo/lNynVwp6y7ZUcO/6affsnWT9HAlpWxaAixx8IaY9DpHOLpdksGF7qWJoSOw==","mode":420,"size":2739},"dist/processors/stylus.js":{"checkedAt":1678883672Line truncated
|
||||
{"name":"svelte-preprocess","version":"4.7.0","files":{"LICENSE":{"checkedAt":1678883672787,"integrity":"sha512-y9ZznyO7gLKWA8yFV93oHbK58RdKWLoMw6XnWnp6CEiGw9ROHBpG1vlIQKiWHv1//XgnAROGfaEiDXgbDFuFCg==","mode":420,"size":1128},"dist/autoProcess.js":{"checkedAt":1678883672787,"integrity":"sha512-JP6qxcJZokBeWNjpZ6NcoZYJLLHvEXVxB1dvijW/i1mUOXfPBcoOoKBI2hSQlFta/+7t2gku7OuWWqgi1sTt9w==","mode":420,"size":8448},"dist/processors/babel.js":{"checkedAt":1678883672787,"integrity":"sha512-9TOyQyYZLuklvQ2SnQZxNhJ+sIaL26SSrM5ybaNwBIHo5VsV9X3aPhus9Y2mUcLl+EKdRTHejvsp4UoFvlFdbw==","mode":420,"size":1746},"dist/transformers/babel.js":{"checkedAt":1678883672787,"integrity":"sha512-YXMTuijuBsUKO8o0UjjJgyXiWc8g4yJBWNMirEn3mhi1pleLcPAPGmXUIl5uPzCkbk0dH7ijrny/63tCmdPcHQ==","mode":420,"size":772},"dist/processors/coffeescript.js":{"checkedAt":1678883672789,"integrity":"sha512-rFZCaf8P50XKWdQoTeGkfhG9t5ITTRj1MK/3dYCPF+pNA3Yte5Pc35YOeCBm3X+i6om4MlIzeGWXSAW06J8blA==","mode":420,"size":1960},"dist/transformers/coffeescript.js":{"checkedAt":1678883672789,"integrity":"sha512-UtiXG8zS+G7jFLbHo5s4aUpcrCFvF0JTxSw1588YINlwJli0oZ9pChg0hibsG/XkJcgiTUo3HAQywV3Wdd5+ZA==","mode":420,"size":1220},"dist/modules/errors.js":{"checkedAt":1678883672790,"integrity":"sha512-j/k5GyiWAevUeJYxOjBwwNFZdtEtGcv1gk3MFPfwXfV3MX/5EXOcmvK23IpivyzDj276w6lJ44RJFo9Qfh6fJw==","mode":420,"size":397},"dist/modules/globalifySelector.js":{"checkedAt":1678883672789,"integrity":"sha512-l7vzUlQjPsol9SDKRJEKd9r0kXma7rLlE8RdIgSGI4b3X3I/L5wGefOW+LbG81XknI4n93UyV/IqwdlcdGQYow==","mode":420,"size":1742},"dist/processors/globalStyle.js":{"checkedAt":1678883672789,"integrity":"sha512-yCyZ6xCdKqo/8DFSdpIlwALJHtE2VbPHpVndKgrsxLaFn+uMy1nHqPa3QlhpNJW4g0h+jbugxl1Bk89R6zbFNA==","mode":420,"size":1340},"dist/transformers/globalStyle.js":{"checkedAt":1678883672789,"integrity":"sha512-BKGgZlegG7Pr4oMUn0i7CvfgOFbsV7pxyFnarPB4krEKRsEnM6ZlZvHJQ5T+fH7mkmyKQfDUIGwguF/IOud5Zg==","mode":420,"size":2515},"dist/index.js":{"checkedAt":1678883672789,"integrity":"sha512-Xlno22x5ZF5CzBwqQ+siR6yeEi6qjXFnxP7OR0NZXbIIODFsLWbD5xQFKO20FnlA4yNErR/JWOQk7ESw7Mc48A==","mode":420,"size":2631},"dist/types/index.js":{"checkedAt":1678883672791,"integrity":"sha512-nOw0Rz+YbxMfnrbE8gD7uXGrUrpmNxqdJYa0PVmk3YJ+LqqMm29YHP3m+65+Sw3jomBryBRCSCXM3/AGhU26hg==","mode":420,"size":1041},"dist/modules/language.js":{"checkedAt":1678883672791,"integrity":"sha512-z80k7SLwTUZB4BhkfHwwv36lfnAYm1uAPMwdH2IUEo9Xf6FKktU7oc9x2mOaHNWK1Z4yRUbMnfdanMy+qXrYbg==","mode":420,"size":3042},"dist/processors/less.js":{"checkedAt":1678883672791,"integrity":"sha512-XPI3f8Jx4ci4aqDcwpJVf3wClCQeaL7QO/KzaOXg1DE+dEsCK4x0AgbLaD19iqaoEeXaOY2wymR+Pz1lRYv3Uw==","mode":420,"size":1830},"dist/transformers/less.js":{"checkedAt":1678883672791,"integrity":"sha512-U0fqw45PZCJveOR/B1suKkVua4xchPUPDFa8g3GmlNcszJfb1MQL7PI+krZks/9ahvDOIcpwVPR5LKq7FQ7iFA==","mode":420,"size":781},"dist/modules/markup.js":{"checkedAt":1678883672791,"integrity":"sha512-nIalsFVk6yncJN6E+JTSELajKj11Ulm96xWmA6RpLP/alA5iqQmPSMutfeZ7T5P2nQHVzRyPFXOJqKSfNBvnyQ==","mode":420,"size":1521},"dist/types/options.js":{"checkedAt":1678883670006,"integrity":"sha512-f2XGQDoj2T+xSOglmwEtZVKrO/8Xj0p9ap2c7A9gQp/BiZ45tLyozAivx12afHv9sT/DcspjyF6yKwNV601gAA==","mode":420,"size":77},"dist/processors/postcss.js":{"checkedAt":1678883672791,"integrity":"sha512-C1sfrV36hd0uh3cxXQORWNVAnFL0NqOtDmxudpxYcm5ZsaLI2n5qEJGMyWYVcD9M4O3qnIaZOb4TzmrlVAgIfg==","mode":420,"size":1902},"dist/transformers/postcss.js":{"checkedAt":1678883672792,"integrity":"sha512-dYwPmK6RV2XGYWmYka9iWVJM118eEwguu7WcXcA+/YRY9ZqWrPEzelqjAhZUKUMSf4xaJi2P2Tu4HzonNzrrow==","mode":420,"size":3273},"dist/modules/prepareContent.js":{"checkedAt":1678883672792,"integrity":"sha512-O4ehoRf1NLruwk98VEvyk1y35cv9VQ5nXOhsUl9iO7GG37LGBg8+uTUFkxOlRSFJ2ejekTAvRFCncY47jolKcw==","mode":420,"size":742},"dist/processors/pug.js":{"checkedAt":1678883672792,"integrity":"sha512-HvZzN5u11rYF24rZLlbEE2ACyo645fOtqI1ArnGwmzsdgcCK7MoWYAL46+QQ2H4eXf+FQk4UsbYl7fAb/59p5g==","mode":420,"size":1519},"dist/transformers/pug.js":{"checkedAt":1678883672792,"integrity":"sha512-zunZOReWU4/4WS58X18JQrwqpY9n+2LGIWdnTG3cbmBT/uHQ+BahWp7Y3ny13KmwJ/Qx/PBixPoPgA6U3HbSyQ==","mode":420,"size":1615},"dist/processors/replace.js":{"checkedAt":1678883672792,"integrity":"sha512-syu45me1VU7GpApbUnJXIkInGabLGbO3De+uNRE5Q4k5D9fLtOvmWh9euery80m0xoUOp5JIGqFvwDa46ghaXQ==","mode":420,"size":1201},"dist/transformers/replace.js":{"checkedAt":1678883672792,"integrity":"sha512-Cg9jrc1H6fHybplqWTnVNojI7mK2LmWdwrWYHm7mru+U9u2G1Uuoy1tRvTf8XYznZhVmva/ncUOH6DSyDWq6KA==","mode":420,"size":387},"dist/processors/scss.js":{"checkedAt":1678883672792,"integrity":"sha512-BPuUbXEmDcvRnKrAH4mlEz/tOD3kwCPrWIfztgWs9NB8kHNKtZ6RfpIReoGxzpVl827hcS2DyJNCQt8lJEz4Hg==","mode":420,"size":2019},"dist/transformers/scss.js":{"checkedAt":1678883672794,"integrity":"sha512-hwHOHEEgtZf/NiHxGlKNloilHo/lNynVwp6y7ZUcO/6affsnWT9HAlpWxaAixx8IaY9DpHOLpdksGF7qWJoSOw==","mode":420,"size":2739},"dist/processors/stylus.js":{"checkedAt":1678883672Line truncated
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
|
||||
# Overview
|
||||
|
||||
A simple way to check that password strength of a certain passphrase. A password strength checker based from [Javascript RegEx](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions).
|
||||
|
||||
[](https://travis-ci.org/deanilvincent/check-password-strength)
|
||||
[](https://img.shields.io/npm/dm/check-password-strength.svg)
|
||||
|
||||
[](https://img.shields.io/npm/dt/check-password-strength.svg)
|
||||
|
||||
[DEMO 1](https://svelte.dev/repl/b5bf5871c99742e584da244b4bfeac92?version=3.44.3) by [@Ennoriel](https://github.com/Ennoriel)
|
||||
|
||||
[DEMO 2](https://check-password-strength.netlify.app/)
|
||||
|
||||
## Installation
|
||||
|
||||
### Install via Package Manager
|
||||
|
||||
`npm i check-password-strength --save`
|
||||
|
||||
### Install via Browser Script Tag using [UNPKG](https://unpkg.com/)
|
||||
|
||||
`<script src="https://unpkg.com/check-password-strength/dist/umd.js"></script>`
|
||||
|
||||
## Setup & Basic Usage
|
||||
```javascript
|
||||
const { passwordStrength } = require('check-password-strength')
|
||||
// OR
|
||||
import { passwordStrength } from 'check-password-strength'
|
||||
|
||||
console.log(passwordStrength('asdfasdf').value)
|
||||
// Too weak (It will return Too weak if the value doesn't match the RegEx conditions)
|
||||
|
||||
console.log(passwordStrength('asdf1234').value)
|
||||
// Weak
|
||||
|
||||
console.log(passwordStrength('Asd1234!').value)
|
||||
// Medium
|
||||
|
||||
console.log(passwordStrength('A@2asdF2020!!*').value)
|
||||
// Strong
|
||||
```
|
||||
## Migration from 1.x.x to 2.0.0
|
||||
|
||||
```javascript
|
||||
// 1.x.x
|
||||
const whateEverYourFunctionNameWasBefore = require("./index");
|
||||
|
||||
// 'contains' attribute of the response object format was
|
||||
response.contains = [{'message': 'lowercase'}, ...]
|
||||
```
|
||||
|
||||
```javascript
|
||||
// 2.0.0
|
||||
const { passwordStrength : whateEverYourFunctionNameWasBefore } = require("./index");
|
||||
|
||||
// 'contains' attribute of the response object format is now
|
||||
response.contains = ['lowercase', ...]
|
||||
```
|
||||
## Additional Info
|
||||
|
||||
### Object Result
|
||||
| Property | Desc. |
|
||||
| -------- | --------------------------------------------------------------- |
|
||||
| id | **0** = Too weak, **1** = Weak & **2** = Medium, **3** = Strong |
|
||||
| value | Too weak, Weak, Medium & Strong |
|
||||
| contains | lowercase, uppercase, symbol and/or number |
|
||||
| length | length of the password |
|
||||
|
||||
### Password Length Default Options
|
||||
| Name | Mininum Diversity | Mininum Length |
|
||||
| -------- | ----------------- | -------------- |
|
||||
| Too weak | 0 | 0 |
|
||||
| Weak | 2 | 6 |
|
||||
| Medium | 4 | 8 |
|
||||
| Strong | 4 | 10 |
|
||||
|
||||
```javascript
|
||||
console.log(passwordStrength('@Sdfasd2020!@#$'))
|
||||
// output
|
||||
{
|
||||
"id": 1,
|
||||
"value": "Strong",
|
||||
"contains": ['lowercase', 'uppercase', 'symbol', 'number'],
|
||||
"length": 15
|
||||
}
|
||||
```
|
||||
|
||||
### Default Options
|
||||
|
||||
The default symbols are based from **Password Special Characters [OWASP](https://owasp.org/www-community/password-special-characters)** list (except for the space)
|
||||
```
|
||||
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
|
||||
```
|
||||
Thanks for [jlherren](https://github.com/jlherren) & [Ennoriel](https://github.com/Ennoriel) for this suggestion! 👨🏻💻👨🏻💻
|
||||
|
||||
The default options can be required:
|
||||
```javascript
|
||||
const { defaultOptions } = require("./index");
|
||||
```
|
||||
|
||||
default options:
|
||||
```javascript
|
||||
[
|
||||
{
|
||||
id: 0,
|
||||
value: "Too weak",
|
||||
minDiversity: 0,
|
||||
minLength: 0
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
value: "Weak",
|
||||
minDiversity: 2,
|
||||
minLength: 6
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: "Medium",
|
||||
minDiversity: 4,
|
||||
minLength: 8
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: "Strong",
|
||||
minDiversity: 4,
|
||||
minLength: 10
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
To override the default options, simply pass your custom array as the second argument:
|
||||
|
||||
- id: correspond to the return id attribute.
|
||||
- value: correspond to the return value attribute.
|
||||
- minDiversity: between 0 and 4, correspond to the minimum of different criterias ('lowercase', 'uppercase', 'symbol', 'number') that should be met to pass the password strength
|
||||
- minLength: minimum length of the password that should be met to pass the password strength
|
||||
|
||||
The `minDiversity` and `minLength` parameters of the first element cannot be overriden (set to 0 at the beginning of the method). Therefore, the first element should always correspond to a "too weak" option.
|
||||
|
||||
```javascript
|
||||
passwordStrength('myPassword', yourCustomOptions)
|
||||
```
|
||||
### RegEx
|
||||
**Strong**
|
||||
```
|
||||
^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*"'()+,-./:;<=>?[\]^_`{|}~])(?=.{10,})
|
||||
```
|
||||
|
||||
**Medium Password RegEx used:**
|
||||
```
|
||||
^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*"'()+,-./:;<=>?[\]^_`{|}~])(?=.{8,})
|
||||
```
|
||||
|
||||
| RegEx | Desc. |
|
||||
| ----------------------------------------- | ------------------------------------------------------------------- |
|
||||
| ^ | The password string will start this way |
|
||||
| (?=.*[a-z]) | The string must contain at least 1 lowercase alphabetical character |
|
||||
| (?=.*[A-Z]) | The string must contain at least 1 uppercase alphabetical character |
|
||||
| (?=.*[0-9]) | The string must contain at least 1 numeric character |
|
||||
| (?=.[!"#$%&'()*+,-./:;<=>?@[\\]^_`{\|}~])) | The string must contain at least one special character |
|
||||
| (?=.{10,}) | The string must be eight characters or longer for Strong strength |
|
||||
| (?=.{8,}) | The string must be eight characters or longer for Medium strength |
|
||||
| (?=.{6,}) | Mininum of 6 characters for Weak strength |
|
||||
|
||||
## TypeScript type declarations ☑
|
||||
Available starting version `v2.0.3` and above. (Thanks to [@Mesoptier!](https://github.com/Mesoptier))
|
||||
|
||||
## Other resources
|
||||
|
||||
##### For .NET Project
|
||||
If you're working with .net core project, I've created a simple nuget package with same RegEx strings to validate a password strength.
|
||||
|
||||
You can easily install via Nuget Package Manager or .NET CLI ([Check.Password.Strength](https://github.com/deanilvincent/Check.Password.Strength)). This package uses Regular Expression `new Regex()` derives from `System.Text.RegularExpressions`. You can use this especially if you want to validate the passcode strength on backend services or web apis of your project.
|
||||
|
||||
##### Other NPM RegEx validator
|
||||
I also made another NPM package ([hey-regex](https://www.npmjs.com/package/hey-regex)) that checks common inputs like numbers (whole number and decimal), alpha numeric, email and url. This package only returns `true` or `false` based from the selected function (with RegEx `.test()` inside).
|
||||
|
||||
Reference [blog](https://www.thepolyglotdeveloper.com/2015/05/use-regex-to-test-password-strength-in-javascript/).
|
||||
|
||||
### Contribute
|
||||
|
||||
Feel free to clone or fork this project: `https://github.com/deanilvincent/check-password-strength.git`
|
||||
|
||||
Contributions & pull requests are welcome!
|
||||
|
||||
I'll be glad if you give this project a ★ on [Github](https://github.com/deanilvincent/check-password-strength) :)
|
||||
|
||||
***
|
||||
Kudos to [@Ennoriel](https://github.com/Ennoriel) and his efforts for making v2.x.x possible!
|
||||
### License
|
||||
This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/deanilvincent/check-password-strength/blob/master/LICENSE.md/) file for details.
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
const defaultOptions = [
|
||||
{
|
||||
id: 0,
|
||||
value: "Too weak",
|
||||
minDiversity: 0,
|
||||
minLength: 0
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
value: "Weak",
|
||||
minDiversity: 2,
|
||||
minLength: 6
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: "Medium",
|
||||
minDiversity: 4,
|
||||
minLength: 8
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: "Strong",
|
||||
minDiversity: 4,
|
||||
minLength: 10
|
||||
}
|
||||
]
|
||||
|
||||
const passwordStrength = (password, options = defaultOptions, allowedSymbols="!\"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\\\\]\^_`\{|\}~") => {
|
||||
|
||||
let passwordCopy = password || ''
|
||||
|
||||
options[0].minDiversity = 0,
|
||||
options[0].minLength = 0
|
||||
|
||||
const rules = [
|
||||
{
|
||||
regex: "[a-z]",
|
||||
message: 'lowercase'
|
||||
},
|
||||
{
|
||||
regex: '[A-Z]',
|
||||
message: 'uppercase'
|
||||
},
|
||||
{
|
||||
regex: '[0-9]',
|
||||
message: 'number'
|
||||
},
|
||||
]
|
||||
|
||||
if (allowedSymbols) {
|
||||
rules.push({
|
||||
regex: `[${allowedSymbols}]`,
|
||||
message: 'symbol'
|
||||
})
|
||||
}
|
||||
|
||||
let strength = {}
|
||||
|
||||
strength.contains = rules
|
||||
.filter(rule => new RegExp(`${rule.regex}`).test(passwordCopy))
|
||||
.map(rule => rule.message)
|
||||
|
||||
strength.length = passwordCopy.length;
|
||||
|
||||
let fulfilledOptions = options
|
||||
.filter(option => strength.contains.length >= option.minDiversity)
|
||||
.filter(option => strength.length >= option.minLength)
|
||||
.sort((o1, o2) => o2.id - o1.id)
|
||||
.map(option => ({id: option.id, value: option.value}))
|
||||
|
||||
Object.assign(strength, fulfilledOptions[0])
|
||||
|
||||
return strength;
|
||||
};
|
||||
|
||||
module.exports = { passwordStrength, defaultOptions }
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
export interface Option<V> {
|
||||
id: number;
|
||||
value: V;
|
||||
minDiversity: number;
|
||||
minLength: number;
|
||||
}
|
||||
|
||||
export interface FirstOption<V> extends Option<V> {
|
||||
minDiversity: 0;
|
||||
minLength: 0;
|
||||
}
|
||||
|
||||
export type Options<V> = [FirstOption<V>, ...Option<V>[]];
|
||||
|
||||
export const defaultOptions: Options<string>;
|
||||
|
||||
export type DiversityType = "lowercase" | "uppercase" | "symbol" | "number";
|
||||
|
||||
export interface Result<V> {
|
||||
id: number;
|
||||
value: V;
|
||||
contains: DiversityType[];
|
||||
length: number;
|
||||
}
|
||||
|
||||
export function passwordStrength<V = string>(
|
||||
password: string,
|
||||
options?: Options<V>,
|
||||
allowedSymbols?: string,
|
||||
): Result<V>;
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
const defaultOptions = [
|
||||
{
|
||||
id: 0,
|
||||
value: "Too weak",
|
||||
minDiversity: 0,
|
||||
minLength: 0
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
value: "Weak",
|
||||
minDiversity: 2,
|
||||
minLength: 6
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: "Medium",
|
||||
minDiversity: 4,
|
||||
minLength: 8
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: "Strong",
|
||||
minDiversity: 4,
|
||||
minLength: 10
|
||||
}
|
||||
];
|
||||
|
||||
const passwordStrength = (password, options = defaultOptions, allowedSymbols="!\"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\\\\]\^_`\{|\}~") => {
|
||||
|
||||
let passwordCopy = password || '';
|
||||
|
||||
options[0].minDiversity = 0,
|
||||
options[0].minLength = 0;
|
||||
|
||||
const rules = [
|
||||
{
|
||||
regex: "[a-z]",
|
||||
message: 'lowercase'
|
||||
},
|
||||
{
|
||||
regex: '[A-Z]',
|
||||
message: 'uppercase'
|
||||
},
|
||||
{
|
||||
regex: '[0-9]',
|
||||
message: 'number'
|
||||
},
|
||||
];
|
||||
|
||||
if (allowedSymbols) {
|
||||
rules.push({
|
||||
regex: `[${allowedSymbols}]`,
|
||||
message: 'symbol'
|
||||
});
|
||||
}
|
||||
|
||||
let strength = {};
|
||||
|
||||
strength.contains = rules
|
||||
.filter(rule => new RegExp(`${rule.regex}`).test(passwordCopy))
|
||||
.map(rule => rule.message);
|
||||
|
||||
strength.length = passwordCopy.length;
|
||||
|
||||
let fulfilledOptions = options
|
||||
.filter(option => strength.contains.length >= option.minDiversity)
|
||||
.filter(option => strength.length >= option.minLength)
|
||||
.sort((o1, o2) => o2.id - o1.id)
|
||||
.map(option => ({id: option.id, value: option.value}));
|
||||
|
||||
Object.assign(strength, fulfilledOptions[0]);
|
||||
|
||||
return strength;
|
||||
};
|
||||
|
||||
module.exports = { passwordStrength, defaultOptions };
|
||||
//# sourceMappingURL=es.js.map
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "@odit/lfk-client-js",
|
||||
"description": "A lib to interact with https://git.odit.services/lfk/backend. Use this version for native JS applications.",
|
||||
"version": "0.14.0",
|
||||
"license": "CC-BY-NC-SA-4.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://git.odit.services/lfk/lfk-client-js"
|
||||
},
|
||||
"keywords": [
|
||||
"odit",
|
||||
"odit.services",
|
||||
"lfk"
|
||||
],
|
||||
"author": "ODIT.Services",
|
||||
"files": [
|
||||
"dist",
|
||||
"package.json",
|
||||
"README.md"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "npm run build:prepare && npm run build:lib && npm run build:compile && npm run build:cleanup",
|
||||
"build:prepare": "rimraf ./lib ./dist",
|
||||
"build:lib": "openapi --input ./openapi.json --output ./lib --client fetch",
|
||||
"build:compile": "tsc",
|
||||
"build:cleanup": "rimraf ./lib"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://git.odit.services/lfk/lfk-client-js/issues"
|
||||
},
|
||||
"homepage": "https://git.odit.services/lfk/lfk-client-js/",
|
||||
"devDependencies": {
|
||||
"openapi-typescript-codegen": "0.7.0",
|
||||
"rimraf": "4.1.2",
|
||||
"typescript": "4.9.5"
|
||||
}
|
||||
}
|
||||
+387
@@ -0,0 +1,387 @@
|
||||
const {passwordStrength: app, defaultOptions} = require("./index");
|
||||
|
||||
it("Should not modify the password parameter", () => {
|
||||
let pwd = "Hello!"
|
||||
app(pwd)
|
||||
expect(pwd).toBe("Hello!")
|
||||
})
|
||||
|
||||
it("Should return strength id 3 if password is Strong", () => {
|
||||
expect(app("A@2asdF2020!!*!").id).toBe(3);
|
||||
});
|
||||
|
||||
//#region INTRODUCE UPDATED DEFAULT SYMBOLS AND TEST EACH SYMBOL
|
||||
it("Should return strength id 3 if password is Strong with these symbols: !\"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\]\^_`\{|\}~", () => {
|
||||
expect(app("A20abcdefg!\"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\]\^_`\{|\}~").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: !", () => {
|
||||
expect(app("A20abcdefg!").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: @", () => {
|
||||
expect(app("A20abcdefg@").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: #", () => {
|
||||
expect(app("A20abcdefg#").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: ^", () => {
|
||||
expect(app("A20abcdefg^").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: &", () => {
|
||||
expect(app("A20abcdefg&").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: *", () => {
|
||||
expect(app("A20abcdefg*").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: !", () => {
|
||||
expect(app("A20abcdefg!").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: \"", () => {
|
||||
expect(app("A20abcdefg\"").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: '", () => {
|
||||
expect(app("A20abcdefg'").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: (", () => {
|
||||
expect(app("A20abcdefg(").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: )", () => {
|
||||
expect(app("A20abcdefg)").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: +", () => {
|
||||
expect(app("A20abcdefg+").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: ,", () => {
|
||||
expect(app("A20abcdefg,").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: -", () => {
|
||||
expect(app("A20abcdefg-").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: .", () => {
|
||||
expect(app("A20abcdefg.").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: /", () => {
|
||||
expect(app("A20abcdefg/").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: :", () => {
|
||||
expect(app("A20abcdefg:").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: ;", () => {
|
||||
expect(app("A20abcdefg;").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: <", () => {
|
||||
expect(app("A20abcdefg>").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: =", () => {
|
||||
expect(app("A20abcdefg=").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: >", () => {
|
||||
expect(app("A20abcdefg>").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: ?", () => {
|
||||
expect(app("A20abcdefg?").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: [", () => {
|
||||
expect(app("A20abcdefg[").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: ]", () => {
|
||||
expect(app("A20abcdefg]").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: \\", () => {
|
||||
expect(app("A20abcdefg\\").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: \\", () => {
|
||||
expect(app("A20abcdefg\\").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: ^", () => {
|
||||
expect(app("A20abcdefg^").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: _", () => {
|
||||
expect(app("A20abcdefg_").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: `", () => {
|
||||
expect(app("A20abcdefg`").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: {", () => {
|
||||
expect(app("A20abcdefg{").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: }", () => {
|
||||
expect(app("A20abcdefg}").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: |", () => {
|
||||
expect(app("A20abcdefg|").id).toBe(3);
|
||||
});
|
||||
|
||||
it("Should return strength id 3 if password is Strong with symbol: ~", () => {
|
||||
expect(app("A20abcdefg~").id).toBe(3);
|
||||
});
|
||||
|
||||
//#endregion
|
||||
|
||||
it("Should return strength id 2 if password is Medium", () => {
|
||||
expect(app("Asd1234!").id).toBe(2);
|
||||
});
|
||||
|
||||
it("Should return strength id 1 if password is Weak", () => {
|
||||
expect(app("asdf1234").id).toBe(1);
|
||||
});
|
||||
|
||||
it("Should return strength id 1 if password has two combination of symbol + lowercase", () => {
|
||||
expect(app("asdf!@#$").id).toBe(1);
|
||||
});
|
||||
|
||||
it("Should return strength id 1 if password has two combination of symbol + uppercase", () => {
|
||||
expect(app("ASDF!@#$").id).toBe(1);
|
||||
});
|
||||
|
||||
it("Should return strength id 1 if password has two combination of symbol + numeric", () => {
|
||||
expect(app("1234!@#$").id).toBe(1);
|
||||
});
|
||||
|
||||
it("Should return strength id 0 if password is weak", () => {
|
||||
expect(app("a").id).toBe(0);
|
||||
});
|
||||
|
||||
it("Should return strength value 'Strong' if password is Medium", () => {
|
||||
expect(app("A@2asdF2020!!*").value).toBe("Strong");
|
||||
});
|
||||
|
||||
it("Should return strength value 'Medium' if password is Medium", () => {
|
||||
expect(app("Asd1234!").value).toBe("Medium");
|
||||
});
|
||||
|
||||
it("Should return strength value 'Weak' if password is Weak", () => {
|
||||
expect(app("Asdf1234").value).toBe("Weak");
|
||||
});
|
||||
|
||||
// pass combination
|
||||
it("Should return strength value 'Weak' if password has two combination of symbol + lowercase", () => {
|
||||
expect(app("asdf!@#$").value).toBe("Weak");
|
||||
});
|
||||
|
||||
it("Should return strength value 'Weak' if password has two combination of symbol + uppercase", () => {
|
||||
expect(app("ASDF!@#$").value).toBe("Weak");
|
||||
});
|
||||
|
||||
it("Should return strength value 'Weak' if password has two combination of symbol + numeric", () => {
|
||||
expect(app("1234!@#$").value).toBe("Weak");
|
||||
});
|
||||
|
||||
it("Should return strength value 'Too weak' if password is weak", () => {
|
||||
expect(app("a").value).toBe("Too weak");
|
||||
});
|
||||
|
||||
it("Should return type of number if request for id", () => {
|
||||
expect(typeof app("a").id).toBe("number");
|
||||
});
|
||||
|
||||
it("Should return type of string if request for value", () => {
|
||||
expect(typeof app("a").value).toBe("string");
|
||||
});
|
||||
|
||||
it("Should return type of object if requesting directly from the function", () => {
|
||||
expect(typeof app("a")).toBe("object");
|
||||
});
|
||||
|
||||
// contains
|
||||
it("Should return true if request for contains is an array", () => {
|
||||
const arrayData = Array.isArray(app("a").contains);
|
||||
expect(arrayData).toEqual(true);
|
||||
});
|
||||
|
||||
it("Should return contains of 'lowercase' if the password has lowercase", () => {
|
||||
const contains = app("lower").contains;
|
||||
const contain = contains.find((x) => x === "lowercase");
|
||||
const condition = contain === "lowercase";
|
||||
expect(condition).toEqual(true);
|
||||
});
|
||||
|
||||
it("Should return contains of 'uppercase' if the password has uppercase", () => {
|
||||
const contains = app("Uppercase").contains;
|
||||
const contain = contains.find((x) => x === "uppercase");
|
||||
const condition = contain === "uppercase";
|
||||
expect(condition).toEqual(true);
|
||||
});
|
||||
|
||||
it("Should return contains of 'symbol' if the password has symbol", () => {
|
||||
const contains = app("!test").contains;
|
||||
const contain = contains.find((x) => x === "symbol");
|
||||
const condition = contain === "symbol";
|
||||
expect(condition).toEqual(true);
|
||||
});
|
||||
|
||||
it("Should return contains of 'number' if the password has number", () => {
|
||||
const contains = app("1234").contains;
|
||||
const contain = contains.find((x) => x === "number");
|
||||
const condition = contain === "number";
|
||||
expect(condition).toEqual(true);
|
||||
});
|
||||
|
||||
it("Should return contains of all criteria (lowercase, uppercase, symbol & number)", () => {
|
||||
expect(app("asdfASDF!@#$1234").contains).toStrictEqual([
|
||||
"lowercase",
|
||||
"uppercase",
|
||||
"number",
|
||||
"symbol",
|
||||
]);
|
||||
});
|
||||
|
||||
it("Should return contains of two or more message if the password has 2 or more message password criteria", () => {
|
||||
expect(app("asdfASDF").contains).toStrictEqual([
|
||||
"lowercase",
|
||||
"uppercase",
|
||||
]);
|
||||
});
|
||||
|
||||
it("Should return contains length if contains has value", () => {
|
||||
expect(app("asdfASDF").contains.length).toBe(2);
|
||||
});
|
||||
|
||||
// length
|
||||
it("Should return numeric length value if request for length", () => {
|
||||
expect(app("1234").length).toBe(4);
|
||||
});
|
||||
|
||||
it("Should return type of number if request is for length value", () => {
|
||||
expect(typeof app("1234").length).toBe("number");
|
||||
});
|
||||
|
||||
it("Should return an empty password result if password parameter is null", () => {
|
||||
expect(app(null).id).toBe(0);
|
||||
expect(app(null).length).toBe(0);
|
||||
expect(app(null).contains).toStrictEqual([]);
|
||||
});
|
||||
|
||||
overridenOptions = [
|
||||
{
|
||||
id: 0,
|
||||
value: "Too weak",
|
||||
minDiversity: 0,
|
||||
minLength: 0
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
value: "Weak",
|
||||
minDiversity: 2,
|
||||
minLength: 6
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: "Medium",
|
||||
minDiversity: 3,
|
||||
minLength: 8
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: "Strong",
|
||||
minDiversity: 4,
|
||||
minLength: 10
|
||||
}
|
||||
]
|
||||
|
||||
it("[overridden options] Should return strength id 0 if password is weak", () => {
|
||||
expect(app("aB1$", overridenOptions).id).toBe(0);
|
||||
expect(app("aB1$", overridenOptions).value).toBe("Too weak");
|
||||
});
|
||||
|
||||
it("[overridden options] Should return strength id 1 if password is Weak", () => {
|
||||
expect(app("abcde123456", overridenOptions).id).toBe(1);
|
||||
expect(app("abcde123456", overridenOptions).value).toBe("Weak");
|
||||
});
|
||||
|
||||
it("[overridden options] Should return strength id 2 if password is Medium", () => {
|
||||
expect(app("abcde123456$", overridenOptions).id).toBe(2);
|
||||
expect(app("abcde123456$", overridenOptions).value).toBe("Medium");
|
||||
});
|
||||
|
||||
it("[overridden options] Should return strength id 3 if password is Strong", () => {
|
||||
expect(app("abcde123456$B", overridenOptions).id).toBe(3);
|
||||
expect(app("abcde123456$B", overridenOptions).value).toBe("Strong");
|
||||
});
|
||||
|
||||
it("[overridden options] Should return true if request for contains is an array", () => {
|
||||
const arrayData = Array.isArray(app("a", overridenOptions).contains);
|
||||
expect(arrayData).toEqual(true);
|
||||
});
|
||||
|
||||
it("[overridden options] Should return contains of 'lowercase' if the password has lowercase", () => {
|
||||
const contains = app("lower", overridenOptions).contains;
|
||||
const contain = contains.find((x) => x === "lowercase");
|
||||
const condition = contain === "lowercase";
|
||||
expect(condition).toEqual(true);
|
||||
});
|
||||
|
||||
it("[overridden options] Should return contains of 'uppercase' if the password has uppercase", () => {
|
||||
const contains = app("Uppercase", overridenOptions).contains;
|
||||
const contain = contains.find((x) => x === "uppercase");
|
||||
const condition = contain === "uppercase";
|
||||
expect(condition).toEqual(true);
|
||||
});
|
||||
|
||||
it("[overridden options] Should return contains of 'symbol' if the password has symbol", () => {
|
||||
const contains = app("!test", overridenOptions).contains;
|
||||
const contain = contains.find((x) => x === "symbol");
|
||||
const condition = contain === "symbol";
|
||||
expect(condition).toEqual(true);
|
||||
});
|
||||
|
||||
it("[overridden options] Should return contains of 'number' if the password has number", () => {
|
||||
const contains = app("1234", overridenOptions).contains;
|
||||
const contain = contains.find((x) => x === "number");
|
||||
const condition = contain === "number";
|
||||
expect(condition).toEqual(true);
|
||||
});
|
||||
|
||||
it("[overridden options] Should return the same object with the default option", () => {
|
||||
expect(app("abcd@")).toStrictEqual(app('abdc@', defaultOptions))
|
||||
expect(app("abcd@E")).toStrictEqual(app('abdc@E', defaultOptions))
|
||||
expect(app("abcd@3")).toStrictEqual(app('abdc@3', defaultOptions))
|
||||
expect(app(null)).toStrictEqual(app(null, defaultOptions))
|
||||
});
|
||||
|
||||
it("[overridden allowedSymbols] Should not contains symbols if the password does not have one", () => {
|
||||
const contains = app("abcd@", undefined, '$').contains;
|
||||
expect(contains).toEqual(expect.arrayContaining(['lowercase']));
|
||||
expect(contains).toEqual(expect.not.arrayContaining(['uppercase']));
|
||||
expect(contains).toEqual(expect.not.arrayContaining(['number']));
|
||||
expect(contains).toEqual(expect.not.arrayContaining(['symbol']));
|
||||
});
|
||||
|
||||
it("[overridden allowedSymbols] Should contains symbols if the password have one", () => {
|
||||
const contains = app("abcd@Ê", undefined, 'Ê').contains;
|
||||
expect(contains).toEqual(expect.arrayContaining(['lowercase']));
|
||||
expect(contains).toEqual(expect.not.arrayContaining(['uppercase']));
|
||||
expect(contains).toEqual(expect.not.arrayContaining(['number']));
|
||||
expect(contains).toEqual(expect.arrayContaining(['symbol']));
|
||||
});
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"name":"@odit/lfk-client-js","version":"0.14.0","files":{"LICENSE":{"checkedAt":1678889113395,"integrity":"sha512-yi6U14MXDHXqsIyk0kU2SesVo4vdn0tQBRquoLkh02FV5WdiEVpoSHDFFHtILlUTaAndrk8DL+4OimPfDJD4XA==","mode":420,"size":19105},"dist/models/Address.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/AddressCityEmptyError.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/AddressCountryEmptyError.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/AddressFirstLineEmptyError.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/AddressPostalCodeEmptyError.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/AddressPostalCodeInvalidError.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/core/ApiError.js":{"checkedAt":1678889113395,"integrity":"sha512-gDKTC8ZpuexyYfeitLa9vvBJSaCY5eb3hcU7uQPgFIQ5RVEeaUvtZWGFJ/jlHZvWzVbrc+FrmobF4zfp+NJaYg==","mode":420,"size":387},"dist/core/ApiRequestOptions.js":{"checkedAt":1678889113395,"integrity":"sha512-f2XGQDoj2T+xSOglmwEtZVKrO/8Xj0p9ap2c7A9gQp/BiZ45tLyozAivx12afHv9sT/DcspjyF6yKwNV601gAA==","mode":420,"size":77},"dist/core/ApiResult.js":{"checkedAt":1678889113395,"integrity":"sha512-f2XGQDoj2T+xSOglmwEtZVKrO/8Xj0p9ap2c7A9gQp/BiZ45tLyozAivx12afHv9sT/DcspjyF6yKwNV601gAA==","mode":420,"size":77},"dist/services/AuthService.js":{"checkedAt":1678889113395,"integrity":"sha512-qffjTdEc5yF44tHz6Dfa/nCNx9tNBxecN51yg7gDWbLZ4Chub7sm9snIL3AyOE6WLs1lqfw3JTDaHva9m55+9g==","mode":420,"size":3034},"dist/models/CreateAuth.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreateDistanceDonation.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreateDonation.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreateDonor.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreateFixedDonation.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreateGroupContact.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreateParticipant.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreatePermission.js":{"checkedAt":1678889113398,"integrity":"sha512-1WbxRjww0z+ZgzRfjHjwTBhGLxbVgp+jviHYS4tmTzCJ65lXP8WKaeyeQU5ObqurGlACTqRDeQ5zTeHWK0BHwQ==","mode":420,"size":1306},"dist/models/CreateResetToken.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreateRunner.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreateRunnerCard.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreateRunnerGroup.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreateRunnerOrganization.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreateRunnerTeam.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeXErXdxtyp4Hr/d/XlmOeZC9alphxmF1LVpSD4yBwEvPlo5ubap+5QMhcKfvKkkWPE/g==","mode":420,"size":146},"dist/models/CreateScan.js":{"checkedAt":1678889113395,"integrity":"sha512-qJhpjgaEdCVDELdlDKeLine truncated
|
||||
+1
-9
@@ -2,17 +2,9 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
||||
|
||||
#### [0.17.3](https://git.odit.services/lfk/frontend/compare/0.17.2...0.17.3)
|
||||
|
||||
- dependency fixes [`3ea7a01`](https://git.odit.services/lfk/frontend/commit/3ea7a015a9beba3c2e4d3eb966f24ff6d4ac786e)
|
||||
- set pnpm to @7 [`4432941`](https://git.odit.services/lfk/frontend/commit/44329413ed2ca23f74e86db041b2c25b2b1c2a2b)
|
||||
|
||||
#### [0.17.2](https://git.odit.services/lfk/frontend/compare/0.17.1...0.17.2)
|
||||
|
||||
> 15 March 2023
|
||||
|
||||
- new license file version [CI SKIP] [`00359d2`](https://git.odit.services/lfk/frontend/commit/00359d25c1bd3efdd6365bf284b3c07634049399)
|
||||
- 🚀RELEASE v0.17.2 [`46db68a`](https://git.odit.services/lfk/frontend/commit/46db68ab229dc740dfff8835ef916f2c2e629b27)
|
||||
- improved ThFilterGroup style [`f917018`](https://git.odit.services/lfk/frontend/commit/f917018fd92a8a5b034f735ac8b6e41995044317)
|
||||
|
||||
#### [0.17.1](https://git.odit.services/lfk/frontend/compare/0.17.0...0.17.1)
|
||||
@@ -1329,7 +1321,7 @@ All notable changes to this project will be documented in this file. Dates are d
|
||||
- init [`32357ec`](https://git.odit.services/lfk/frontend/commit/32357ece0a7195ea1135c9c3e4c6c84323f95b4d)
|
||||
- tmp [`1b7173c`](https://git.odit.services/lfk/frontend/commit/1b7173cda9134ee8058a00bdc030defa80d46bfc)
|
||||
- Login - move to env.js import [`8ef0b21`](https://git.odit.services/lfk/frontend/commit/8ef0b21819309752c573d0485f6514152fb684e6)
|
||||
- initial commit [`4bb3bae`](https://git.odit.services/lfk/frontend/commit/4bb3bae4e6fc89c35a8a2b36b7cd6e6d47958eae)
|
||||
- initial commit [`4bb3bae`](https://git.odit.services/lfk/frontend/commit/4bb3bae4e6fc89c35a8a2b36b7cd6e6d47958eae)
|
||||
- Initial license export [`4c96b9a`](https://git.odit.services/lfk/frontend/commit/4c96b9a3e04dbb7c021c71aa8828a29248509fbe)
|
||||
- 🚚 move to tinro svelte router [`a50ea15`](https://git.odit.services/lfk/frontend/commit/a50ea15b38023b867a9f7757e973184cbcdd2457)
|
||||
- new Dashboard [`7270ce9`](https://git.odit.services/lfk/frontend/commit/7270ce9d32869abd4f6ac65ab7c2c87363633cbe)
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-0.17.3-RELEASE_INFO</span>
|
||||
<span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-0.17.2-RELEASE_INFO</span>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<script src="/env.js"></script>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@odit/lfk-frontend",
|
||||
"version": "0.17.3",
|
||||
"version": "0.17.2",
|
||||
"scripts": {
|
||||
"i18n-order": "node order.js",
|
||||
"dev": "vite",
|
||||
@@ -60,4 +60,4 @@
|
||||
"volta": {
|
||||
"node": "19.7.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
[{"author":"Eric Elliott","repo":{"type":"git","url":"https://github.com/ericelliott/cuid2"},"description":"","name":"@paralleldrive/cuid2","license":"MIT","version":"2.2.0","licensetext":"MIT License\n\nCopyright (c) 2022 Eric Elliott\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"author":"ODIT.Services","repo":{"type":"git","url":"git+https://git.odit.services/lfk/lfk-client-js"},"description":"A lib to interact with https://git.odit.services/lfk/backend. Use this version for native JS applications.","name":"@odit/lfk-client-js","license":"CC-BY-NC-SA-4.0","version":"0.13.1","licensetext":"Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Creative\r\nCommons Corporation (\"Creative Commons\") is not a law firm and does not provide\r\nlegal services or legal advice. Distribution of Creative Commons public licenses\r\ndoes not create a lawyer-client or other relationship. Creative Commons makes\r\nits licenses and related information available on an \"as-is\" basis. Creative\r\nCommons gives no warranties regarding its licenses, any material licensed\r\nunder their terms and conditions, or any related information. Creative Commons\r\ndisclaims all liability for damages resulting from their use to the fullest\r\nextent possible.\r\n\r\nUsing Creative Commons Public Licenses\r\n\r\nCreative Commons public licenses provide a standard set of terms and conditions\r\nthat creators and other rights holders may use to share original works of\r\nauthorship and other material subject to copyright and certain other rights\r\nspecified in the public license below. The following considerations are for\r\ninformational purposes only, are not exhaustive, and do not form part of our\r\nlicenses.\r\n\r\nConsiderations for licensors: Our public licenses are intended for use by\r\nthose authorized to give the public permission to use material in ways otherwise\r\nrestricted by copyright and certain other rights. Our licenses are irrevocable.\r\nLicensors should read and understand the terms and conditions of the license\r\nthey choose before applying it. Licensors should also secure all rights necessary\r\nbefore applying our licenses so that the public can reuse the material as\r\nexpected. Licensors should clearly mark any material not subject to the license.\r\nThis includes other CC-licensed material, or material used under an exception\r\nor limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors\r\n\r\nConsiderations for the public: By using one of our public licenses, a licensor\r\ngrants the public permission to use the licensed material under specified\r\nterms and conditions. If the licensor's permission is not necessary for any\r\nreason–for example, because of any applicable exception or limitation to copyright–then\r\nthat use is not regulated by the license. Our licenses grant only permissions\r\nunder copyright and certain other rights that a licensor has authority to\r\ngrant. Use of the licensed material may still be restricted for other reasons,\r\nincluding because others have copyright or other rights in the material. A\r\nlicensor may make special requests, such as asking that all changes be marked\r\nor described. Although not required by our licenses, you are encouraged to\r\nrespect those requests where reasonable. More considerations for the public\r\n: wiki.creativecommons.org/Considerations_for_licensees\r\n\r\nCreative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public\r\nLicense\r\n\r\nBy exercising the Licensed Rights (defined below), You accept and agree to\r\nbe bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike\r\n4.0 International Public License (\"Public License\"). To the extent this Public\r\nLicense may be interpreted as a contract, You are granted the Licensed Rights\r\nin consideration of Your acceptance of these terms and conditions, and the\r\nLicensorLine truncated
|
||||
[{"author":"Alexey Schebelev","repo":{"type":"git","url":"https://github.com/AlexxNB/tinro"},"description":"tinro is a tiny declarative router for Svelte","name":"tinro","license":"MIT","version":"0.6.12","licensetext":"MIT License\n\nCopyright (c) 2020 Alexey Schebelev\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"author":"Varun A P","repo":{"type":"git","url":"https://github.com/apvarun/toastify-js"},"description":"Toastify is a lightweight, vanilla JS toast notification library.","name":"toastify-js","license":"MIT","version":"1.12.0","licensetext":"MIT License\n\nCopyright (c) 2018 apvarun\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"author":"Chris O'Hara <cohara87@gmail.com>","repo":{"type":"git","url":"https://github.com/validatorjs/validator.js"},"description":"String validation and sanitization","name":"validator","license":"MIT","version":"13.9.0","licensetext":"Copyright (c) 2018 Chris O'Hara <cohara87@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"author":"sheetjs","repo":{"type":"git","url":"https://github.comSheetJS/sheetjs"},"description":"SheetJS Spreadsheet data parser and writer","name":"xlsx","license":"Apache-2.0","version":"0.16.9","licensetext":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" meansLine truncated
|
||||
Reference in new issue
Block a user