node_basetest v2.7.7
node_basetest
Instructions:
npm install node_basetest
const node_basetest = require('node_basetest')
If utilizing in html...:
<script src="./node_modules/node_basetest/index.js"></script>
<script>
$(()=> {
const output = node_basetest.method(parameter)
})
</script>
Functions
HASHELPER(one, two) ⇒ any
Kind: global function
Date: 2022-02-09
Author: zen-out
Param | Type |
---|---|
one | any |
two | any |
Example
it('we need to test well', () => {
T(HASHELPER("div div", "div")) // true
F(HASHELPER("DIV", "div")) // false
F(HASHELPER("dispaiv", "div")) // false
T(HASHELPER("div div div", "div")) //
});
HAS(one, two) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
one | any |
two | any |
Example
it('the problem is that the syntax is annoying', () => {\
HAS("div div", "div") // true
HAS("DIV", "div") // false
HAS("dispaiv", "div") // false
HAS("div div div", "div") //
});
STARTSWITHHELPER(string, substring) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
string | any |
substring | any |
Example
it("starts with", () => {
T(STARTSWITHHELPER("hello", "h"))
F(STARTSWITHHELPER("hello", "b"))
})
STARTSWITH(string, substring) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
string | any |
substring | any |
Example
it("starts with", () => {
STARTSWITH("hello", "h")
STARTSWITH("hello", "b")
})
ENDSWITHHELPER(string, substring) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
string | any |
substring | any |
Example
it("ends with", () => {
F(ENDSWITHHELPER("HELLO", "o"))
T(ENDSWITHHELPER("<div></div>", "</div>"))
})
ENDSWITH(string, substring) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
string | any |
substring | any |
Example
it("ends with", () => {
ENDSWITH("HELLO", "o")
ENDSWITH("<div></div>", "</div>")
})
COUNTHELPER(type, item, amount) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
type | any |
item | any |
amount | any |
Example
it('', () => {
F(COUNTHELPER("hello hellodi", "div", 2)) // false
T(COUNTHELPER("hello hellodi", "hello", 2)) // true
});
COUNT(type, item, amount) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
type | any |
item | any |
amount | any |
Example
it('', () => {
t.COUNT("div div div", "div", 9)
COUNT("div div div", "div", 9) // false
COUNT("hello hellodi", "div", 2) // false
COUNT("hello hellodi", "hello", 2) // true
COUNT("divdiv<div>{{<div>", "div", 4) // true
});
ATLEASTHELPER(type, item, amount) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
type | any |
item | any |
amount | any |
Example
it("", () => {
T(ATLEASTHELPER("div div", "div", 1)) //true
T(ATLEASTHELPER("div div", "div", 2)) //true
F(ATLEASTHELPER("div div", "div", 3)) //false
})
ATLEAST(type, item, amount) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
type | any |
item | any |
amount | any |
Example
it("", () => {
ATLEAST("div div", "div", 1) //true
ATLEAST("div div", "div", 2) //true
ATLEAST("div div", "div", 3) //false
})
ISLESSHELPER(first, second, type) ⇒ any
Kind: global function
Date: 2022-02-17
Param | Type |
---|---|
first | any |
second | any |
type | any |
Example
T(ISLESSHELPER("a", "b", "string"))
T(ISLESSHELPER(1, 2, "number"))
T(ISLESSHELPER("Dec 11, 1993", "Dec 11, 1994", "date"))
F(ISLESSHELPER("b", "a", "string"))
F(ISLESSHELPER(2, 1, "number"))
F(ISLESSHELPER("Dec 11, 1996", "Dec 11, 1995", "date"))
ISLESS(one, two, type) ⇒ any
Kind: global function
Date: 2022-02-17
Param | Type |
---|---|
one | any |
two | any |
type | any |
Example
ISLESS("a", "b", "string")
ISLESS(1, 2, "number")
ISLESS("Dec 11, 1993", "Dec 11, 1994", "date")
ISLESS("b", "a", "string")
ISLESS(2, 1, "number")
ISLESS("Dec 11, 1996", "Dec 11, 1995", "date")
DOESNOTHAVEHELPER(string, item) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
string | any |
item | any |
Example
it('', () => {
F(DOESNOTHAVEHELPER("{{>", ">")) // false (matches the full instance)
T(DOESNOTHAVEHELPER("{{>", "asdf")) // true (matches the full instance)
});
DOESNOTHAVE(string, item) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
string | any |
item | any |
Example
it(' ', () => {
DOESNOTHAVE("{{>", ">") // passes (matches the full instance)
DOESNOTHAVE("{{>", "asdf") // passes
});
TRUNCATE(string, length, ending) ⇒ any
Kind: global function
Date: 2022-02-09
Author: zen-out
Param | Type |
---|---|
string | any |
length | any |
ending | any |
Example
TRUNCATE("long test", 8, "...") // long tes...
WRAPHTML(string, div, options) ⇒ any
Kind: global function
Date: 2022-02-09
Author: zen-out
Param | Type |
---|---|
string | any |
div | any |
options | any |
Example
WRAPHTML("lezzles11","div",{
"id": "content",
"class": "left bullet"
})
<div id="content" class="left bullet">lezzles11</div>
T(value) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
value | any |
Example
it("my fav part of coding is making things", () => {
T(STARTSWITHHELPER("hello", "h"))
})
F(value) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
value | any |
Example
it("but in order to code well", () => {
F(ATLEASTHELPER("div div", "div", 3)) //false
})
ISTYPEOFHELPER(data, type) ⇒ any
ISTYPEOFHELPER
Kind: global function
Date: 2022-03-01
Param | Type |
---|---|
data | any |
type | any |
ISTYPEOF(data, type) ⇒ any
Kind: global function
Date: 2022-02-10
Author: zen-out
Param | Type |
---|---|
data | any |
type | any |
Example
it('y ', () => {
ISTYPEOF({ "hello": "whatsup" }, "object")
ISTYPEOF("imaball", "string")
ISTYPEOF(["asdf"], "array")
ISTYPEOF(false, "boolean")
});
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago