@wizhut_tech/wizjs 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,3 @@
1
1
  # Lang / Checks
2
2
 
3
- Import as `require('wizjs/lang/checks.js')`.
4
-
5
3
  * **isNil(arg)**: Check if the `arg` is `undefined` or `null` and returns `true` (or `false` otherwise).
@@ -0,0 +1,3 @@
1
+ ## lang / functools
2
+
3
+ * **reflexive(arg)**: Just a dumb method that returns `arg` as provided.
@@ -1,8 +1,6 @@
1
1
  # Lang / Singleton
2
2
 
3
- Import with `require('wizjs/lang/singleton.js')`. In-memory caching of an async function's result, ensuring that it will be called only once.
4
-
5
- Mimics similar python decorators. It can easily, be used to store class instance variables.
3
+ In-memory caching of an async function's result, ensuring that it will be called only once. Mimics similar python decorators. It can easily, be used to store class instance variables.
6
4
 
7
5
  ### Module API
8
6
 
@@ -1,5 +1,3 @@
1
1
  # Math / Numbers
2
2
 
3
- Import as `require('wizjs/math/numbers.js')`.
4
-
5
3
  * **toInteger(arg)**: Attempts to convert `arg` to `Integer`. Return `0` if the arg is `zero` or invalid value.
package/index.js CHANGED
@@ -1,12 +1,14 @@
1
1
  const singleton = require('./src/lang/singleton.js');
2
2
  const checks = require('./src/lang/checks.js');
3
3
  const numbers = require('./src/math/numbers.js');
4
+ const functools = require('./src/lang/functools.js');
4
5
 
5
6
 
6
7
  module.exports = {
7
8
  lang: {
8
9
  singleton: singleton,
9
- checks: checks
10
+ checks: checks,
11
+ functools: functools
10
12
  },
11
13
  math: {
12
14
  numbers: numbers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wizhut_tech/wizjs",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "main": "index.js",
5
5
  "devDependencies": {
6
6
  "tap": "21.0.1"
package/readme.md CHANGED
@@ -2,12 +2,30 @@
2
2
 
3
3
  A Javascript library (a few selected dependencies only) that contains utilities for enjoy-full every day programming. No, this library will not become another `lodash` :).
4
4
 
5
+ Use by importing:
6
+
7
+ `const wizjs = require('@wizhut_tech/wizjs')`. Returns an object structured like:
8
+
9
+ ```
10
+ {
11
+ lang: {
12
+ checks: [functions],
13
+ singleton: [functions],
14
+ functools: [functions]
15
+ },
16
+ math: {
17
+ numbers: [functions]
18
+ }
19
+ }
20
+ ```
21
+
5
22
  ### Language
6
23
 
7
- * Checks ... [documentation](docs/lang_checks.md)
8
- * Flow ... [documentation](docs/lang_flow.md)
9
- * Singleton ... [documentation](docs/lang_singleton.md)
24
+ * **Check** utility functions ... [[docs](docs/lang_checks.md)]
25
+ * Control-**Flow** utilities ... [[docs](docs/lang_flow.md)] -- *still in development* --
26
+ * **functools** ... [[docs](docs/lang_functools.md)]
27
+ * **Singleton** hack ... [[docs](docs/lang_singleton.md)]
10
28
 
11
29
  ### Math
12
30
 
13
- * Numbers ... [documentation](docs/math_numbers.md)
31
+ * Utilities around **numbers** ... [[docs](docs/math_numbers.md)]
@@ -0,0 +1,10 @@
1
+
2
+
3
+ function reflexive(arg) {
4
+ return arg;
5
+ }
6
+
7
+
8
+ module.exports = {
9
+ reflexive
10
+ }