fortepiano 0.1.0

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.
Files changed (94) hide show
  1. package/README.md +3 -0
  2. package/lib/Aggregate.d.ts +4 -0
  3. package/lib/Aggregate.js +2 -0
  4. package/lib/Binary.d.ts +5 -0
  5. package/lib/Binary.js +15 -0
  6. package/lib/Buffer.d.ts +5 -0
  7. package/lib/Buffer.js +45 -0
  8. package/lib/Cache.d.ts +18 -0
  9. package/lib/Cache.js +50 -0
  10. package/lib/Console.d.ts +20 -0
  11. package/lib/Console.js +25 -0
  12. package/lib/Crypto.d.ts +5 -0
  13. package/lib/Crypto.js +39 -0
  14. package/lib/Date.d.ts +4 -0
  15. package/lib/Date.js +30 -0
  16. package/lib/Eq.d.ts +4 -0
  17. package/lib/Eq.js +29 -0
  18. package/lib/Error.d.ts +6 -0
  19. package/lib/Error.js +56 -0
  20. package/lib/GeneratorL.d.ts +208 -0
  21. package/lib/GeneratorL.js +501 -0
  22. package/lib/Http.d.ts +60 -0
  23. package/lib/Http.js +131 -0
  24. package/lib/IOAsyncGenerator.d.ts +102 -0
  25. package/lib/IOAsyncGenerator.js +456 -0
  26. package/lib/Log.d.ts +4 -0
  27. package/lib/Log.js +5 -0
  28. package/lib/Magma.d.ts +2 -0
  29. package/lib/Magma.js +26 -0
  30. package/lib/Matrix.d.ts +9 -0
  31. package/lib/Matrix.js +36 -0
  32. package/lib/Mock.d.ts +76 -0
  33. package/lib/Mock.js +113 -0
  34. package/lib/Option.d.ts +2 -0
  35. package/lib/Option.js +26 -0
  36. package/lib/Random.d.ts +7 -0
  37. package/lib/Random.js +7 -0
  38. package/lib/Reader.d.ts +4 -0
  39. package/lib/Reader.js +31 -0
  40. package/lib/ReaderEither.d.ts +9 -0
  41. package/lib/ReaderEither.js +34 -0
  42. package/lib/ReaderTask.d.ts +8 -0
  43. package/lib/ReaderTask.js +35 -0
  44. package/lib/ReaderTaskEither.d.ts +17 -0
  45. package/lib/ReaderTaskEither.js +42 -0
  46. package/lib/ReadonlyArray.d.ts +75 -0
  47. package/lib/ReadonlyArray.js +70 -0
  48. package/lib/ReadonlyRecord.d.ts +4 -0
  49. package/lib/ReadonlyRecord.js +28 -0
  50. package/lib/ReadonlyTuple.d.ts +14 -0
  51. package/lib/ReadonlyTuple.js +34 -0
  52. package/lib/Storage.d.ts +15 -0
  53. package/lib/Storage.js +57 -0
  54. package/lib/Stream.d.ts +5 -0
  55. package/lib/Stream.js +31 -0
  56. package/lib/TaskEither.d.ts +2 -0
  57. package/lib/TaskEither.js +32 -0
  58. package/lib/Type.d.ts +11 -0
  59. package/lib/Type.js +53 -0
  60. package/lib/Validation.d.ts +4 -0
  61. package/lib/Validation.js +30 -0
  62. package/lib/cache/Memcached.d.ts +4 -0
  63. package/lib/cache/Memcached.js +50 -0
  64. package/lib/cache/Memory.d.ts +2 -0
  65. package/lib/cache/Memory.js +66 -0
  66. package/lib/cache/Redis.d.ts +4 -0
  67. package/lib/cache/Redis.js +58 -0
  68. package/lib/cache/Storage.d.ts +4 -0
  69. package/lib/cache/Storage.js +62 -0
  70. package/lib/function.d.ts +52 -0
  71. package/lib/function.js +101 -0
  72. package/lib/http/Axios.d.ts +3 -0
  73. package/lib/http/Axios.js +59 -0
  74. package/lib/http/Fetch.d.ts +2 -0
  75. package/lib/http/Fetch.js +71 -0
  76. package/lib/http/Got.d.ts +3 -0
  77. package/lib/http/Got.js +60 -0
  78. package/lib/http/Mock.d.ts +2 -0
  79. package/lib/http/Mock.js +52 -0
  80. package/lib/index.d.ts +48 -0
  81. package/lib/index.js +86 -0
  82. package/lib/log/Void.d.ts +3 -0
  83. package/lib/log/Void.js +6 -0
  84. package/lib/number.d.ts +3 -0
  85. package/lib/number.js +8 -0
  86. package/lib/storage/Flydrive.d.ts +4 -0
  87. package/lib/storage/Flydrive.js +67 -0
  88. package/lib/storage/Fs.d.ts +3 -0
  89. package/lib/storage/Fs.js +53 -0
  90. package/lib/string.d.ts +5 -0
  91. package/lib/string.js +33 -0
  92. package/lib/struct.d.ts +9 -0
  93. package/lib/struct.js +47 -0
  94. package/package.json +87 -0
package/lib/struct.js ADDED
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.patch = exports.filterDeep = exports.updateAt = exports.modifyAt = exports.lookup = exports.toReadonlyArray = void 0;
23
+ const function_1 = require("fp-ts/function");
24
+ const RA = __importStar(require("fp-ts/ReadonlyArray"));
25
+ const RR = __importStar(require("fp-ts/ReadonlyRecord"));
26
+ const S = __importStar(require("fp-ts/struct"));
27
+ const function_2 = require("./function");
28
+ const $t = __importStar(require("./Type"));
29
+ const toReadonlyArray = (a) => RR.toReadonlyArray(a);
30
+ exports.toReadonlyArray = toReadonlyArray;
31
+ const lookup = (k) => (s) => s[k];
32
+ exports.lookup = lookup;
33
+ const modifyAt = (k, f) => (s) => (Object.assign(Object.assign({}, s), { [k]: f(s[k]) }));
34
+ exports.modifyAt = modifyAt;
35
+ const updateAt = (k, a) => exports.modifyAt(k, () => a);
36
+ exports.updateAt = updateAt;
37
+ const filterDeep = (f) => (a) => function_1.pipe(a, exports.toReadonlyArray, RA.filter(([_, value]) => f(value)), RA.map(([key, value]) => $t.struct.is(value)
38
+ ? [
39
+ key,
40
+ function_1.pipe(value, exports.filterDeep(f)),
41
+ ]
42
+ : [key, value]), RA.reduce({}, (b, [key, value]) => (Object.assign(Object.assign({}, b), { [key]: value }))));
43
+ exports.filterDeep = filterDeep;
44
+ const patch = (b) => (a) => function_1.pipe(b, exports.toReadonlyArray, RA.map(([key, b]) => $t.struct.is(b)
45
+ ? [key, exports.patch(b)(a[key])]
46
+ : [key, b]), RA.reduce({}, (ab, [key, b]) => (Object.assign(Object.assign({}, ab), { [key]: b }))), function_2.curry(S.getAssignSemigroup().concat)(a));
47
+ exports.patch = patch;
package/package.json ADDED
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "fortepiano",
3
+ "version": "0.1.0",
4
+ "description": "",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "files": [
8
+ "lib/"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "prepare": "npm run build",
13
+ "test": "jest --coverage --collectCoverageFrom=src/**/*.ts"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/facile-it/fortepiano.git"
18
+ },
19
+ "author": "Alberto Villa <villa.alberto@gmail.com>",
20
+ "license": "ISC",
21
+ "bugs": {
22
+ "url": "https://github.com/facile-it/fortepiano/issues"
23
+ },
24
+ "homepage": "https://github.com/facile-it/fortepiano#readme",
25
+ "devDependencies": {
26
+ "@slynova/flydrive": "^1.0.0",
27
+ "@types/jest": "^26.0.24",
28
+ "@types/memcached": "^2.0.0",
29
+ "@types/node-fetch": "^2.5.12",
30
+ "@types/redis": "^2.0.0",
31
+ "@types/redis-mock": "^0.17.0",
32
+ "axios": "^0.21.2",
33
+ "eslint": "^7.31.0",
34
+ "eslint-config-facile": "^0.4.1",
35
+ "fp-ts": "^2.0.0",
36
+ "got": "^11.0.0",
37
+ "io-ts": "^2.0.0",
38
+ "io-ts-types": "^0.5.0",
39
+ "jest": "^26.6.3",
40
+ "memcached": "^2.0.0",
41
+ "memcached-mock": "^0.1.0",
42
+ "monocle-ts": "^2.3.10",
43
+ "newtype-ts": "^0.3.4",
44
+ "node-fetch": "^2.6.7",
45
+ "prettier": "^2.3.2",
46
+ "redis": "^3.0.0",
47
+ "redis-mock": "^0.56.3",
48
+ "ts-jest": "^26.5.6",
49
+ "ts-node": "^9.1.1",
50
+ "typescript": "^4.3.5"
51
+ },
52
+ "peerDependencies": {
53
+ "@slynova/flydrive": "^1.0.0",
54
+ "@types/memcached": "^2.0.0",
55
+ "@types/redis": "^2.0.0",
56
+ "axios": "^0.21.2",
57
+ "fp-ts": "^2.0.0",
58
+ "got": "^11.0.0",
59
+ "io-ts": "^2.0.0",
60
+ "io-ts-types": "^0.5.0",
61
+ "memcached": "^2.0.0",
62
+ "redis": "^3.0.0"
63
+ },
64
+ "peerDependenciesMeta": {
65
+ "@slynova/flydrive": {
66
+ "optional": true
67
+ },
68
+ "@types/memcached": {
69
+ "optional": true
70
+ },
71
+ "@types/redis": {
72
+ "optional": true
73
+ },
74
+ "axios": {
75
+ "optional": true
76
+ },
77
+ "got": {
78
+ "optional": true
79
+ },
80
+ "memcached": {
81
+ "optional": true
82
+ },
83
+ "redis": {
84
+ "optional": true
85
+ }
86
+ }
87
+ }