Skip to content

Commit

Permalink
Rewrite done.
Browse files Browse the repository at this point in the history
  • Loading branch information
angeldollface committed May 13, 2024
1 parent 2458f13 commit a4a0d4b
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 35 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
name: Vulcheck CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
name: "VULCHECK CI"
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: actions/checkout@master
- name: Setup Deno
uses: denolib/setup-deno@master
with:
node-version: ${{ matrix.node-version }}
- name: "Installing the example's dependencies."
run: cd example && npm install git+https://github.com/angeldollface/vulcheck --save-dev
- name: "Running the example."
run: node .
deno-version: 1.43.3
- name: "Run tests."
run: deno test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.DS_Store
node_modules
package-lock.json
package-lock.json
dist/
*.js
deno.lock
31 changes: 14 additions & 17 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
MIT License
DOLL SOFTWARE LICENSE
Version 1, April 10 2024

Copyright (c) 2022 ✭ ANGEL DOLLFACE ✭
Copyright (C) 2024 Angel Dollface <https://angeldollface.boo>
Anyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
A single author or authors of this project permit the following use of this project:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- 1.) Any entity is allowed to redistribute, modify, and privately use this project.
- 2.) If the project is modified in any way, the original author or original authors have to be credited.
- 3.) Corporate entities ARE NOT permitted to use this project commercially or for patent use.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The following restrictions apply to this project:

- 1.) The original author or original authors are not liable for any warranty claims. Use of the project is at one's own risk.
- 2.) The original author or original authors are not responsible for any consequences resulting from use of this project.
- 3.) Any modified versions of this project or projects making use of this project HAVE to use this version of this license.
5 changes: 5 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"imports": {
"@std/assert": "jsr:@std/assert@^0.225.1"
}
}
92 changes: 92 additions & 0 deletions mod_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
VULCHECK by Alexander Abraham,
a.k.a. "Angel Dollface".
Licensed under the DSL v1.
*/

import * as vulcheck from './mod.ts';
import { assertEquals } from "@std/assert";

Deno.test(
"Testing the \"getCharPosition\" function.",
() => {
assertEquals(vulcheck.getCharPositon("c"),3);
}
);

Deno.test(
"Testing the \"getCharSpace\" function.",
() => {
assertEquals(vulcheck.getCharSpace("c", "u"),18);
}
);

Deno.test(
"Testing the \"getNumberSpace\" function.",
() => {
assertEquals(vulcheck.getNumberSpace(4,5),1);
}
);

Deno.test(
"Testing the \"stringType\" function. (special character)",
() => {
assertEquals(vulcheck.stringType("@"),"specialChar");
}
);

Deno.test(
"Testing the \"stringType\" function. (integer)",
() => {
assertEquals(vulcheck.stringType("2"),"int");
}
);

Deno.test(
"Testing the \"stringType\" function. (normal character)",
() => {
assertEquals(vulcheck.stringType("e"),"normChar");
}
);

Deno.test(
"Testing the \"isInt\" function. (false case)",
() => {
assertEquals(vulcheck.isInt("e"),false);
}
);

Deno.test(
"Testing the \"isInt\" function. (true case)",
() => {
assertEquals(vulcheck.isInt("1"),true);
}
);

Deno.test(
"Testing the \"passwordStrength\" function. (weak)",
() => {
assertEquals(vulcheck.passwordStrength("12345", 2, 3, 4),0);
}
);

Deno.test(
"Testing the \"passwordStrength\" function. (strong)",
() => {
assertEquals(vulcheck.passwordStrength("5670USAirForce!_*", 2, 3, 4),20);
}
);

Deno.test(
"Testing the \"isSecure\" function. (true case)",
() => {
assertEquals(vulcheck.isSecure("5670USAirForce!_*", 2, 3, 4, 8),true);
}
);

Deno.test(
"Testing the \"isSecure\" function. (false case)",
() => {
assertEquals(vulcheck.isSecure("12345", 2, 3, 4, 8),false);
}
);

0 comments on commit a4a0d4b

Please sign in to comment.