@spinajs/util 2.0.39

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.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # `jobs`
2
+
3
+ > TODO: description
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ const jobs = require('jobs');
9
+
10
+ // TODO: DEMONSTRATE API
11
+ ```
package/lib/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './json';
package/lib/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./json"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB"}
package/lib/jobs.js ADDED
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = jobs;
4
+
5
+ function jobs() {
6
+ // TODO
7
+ }
package/lib/json.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export interface ICustomDataType {
2
+ dataType: string;
3
+ value: any;
4
+ }
5
+ export declare function replacer(_: string, value: unknown): unknown;
6
+ export declare function reviver(_: string, value: ICustomDataType): ICustomDataType | Map<unknown, unknown>;
package/lib/json.js ADDED
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reviver = exports.replacer = void 0;
4
+ function replacer(_, value) {
5
+ if (value instanceof Map) {
6
+ return {
7
+ dataType: 'Map',
8
+ value: Array.from(value.entries()), // or with spread: value: [...value]
9
+ };
10
+ }
11
+ else {
12
+ return value;
13
+ }
14
+ }
15
+ exports.replacer = replacer;
16
+ function reviver(_, value) {
17
+ if (typeof value === 'object' && value !== null) {
18
+ if (value.dataType === 'Map') {
19
+ return new Map(value.value);
20
+ }
21
+ }
22
+ return value;
23
+ }
24
+ exports.reviver = reviver;
25
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":";;;AAKA,SAAgB,QAAQ,CAAC,CAAS,EAAE,KAAc;IAChD,IAAI,KAAK,YAAY,GAAG,EAAE;QACxB,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,oCAAoC;SACzE,CAAC;KACH;SAAM;QACL,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AATD,4BASC;AAED,SAAgB,OAAO,CAAC,CAAS,EAAE,KAAsB;IACvD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;QAC/C,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK,EAAE;YAC5B,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC7B;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAPD,0BAOC"}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@spinajs/util",
3
+ "version": "2.0.39",
4
+ "description": "utility functions shared across @spinajs framework",
5
+ "main": "lib/index.js",
6
+ "private": false,
7
+ "scripts": {
8
+ "build": "npm run clean && npm run compile && cpx src/views/**/* lib/views && cpx src/static/**/* lib/static",
9
+ "compile": "tsc -p tsconfig.build.json",
10
+ "clean": "",
11
+ "test": "ts-mocha -p tsconfig.json test/**/*.test.ts",
12
+ "coverage": "nyc npm run test",
13
+ "build-docs": "rimraf docs && typedoc --options typedoc.json src/",
14
+ "prepare": "npm run build",
15
+ "format": "prettier --write \"src/**/*.ts\"",
16
+ "lint": "eslint -c .eslintrc.js --ext .ts src --fix",
17
+ "prepublishOnly": "npm test && npm run lint",
18
+ "preversion": "npm run lint",
19
+ "version": "npm run format && git add -A src",
20
+ "postversion": "git push && git push --tags"
21
+ },
22
+ "files": [
23
+ "lib/**/*"
24
+ ],
25
+ "types": "lib",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/spinajs/main.git"
29
+ },
30
+ "keywords": [
31
+ "spinajs",
32
+ "http"
33
+ ],
34
+ "author": "SpinaJS <spinajs@coderush.pl> (https://github.com/spinajs/main)",
35
+ "license": "MIT",
36
+ "bugs": {
37
+ "url": "https://github.com/spinajs/main/issues"
38
+ },
39
+ "homepage": "https://github.com/spinajs/main#readme",
40
+ "gitHead": "1857a6e3626e0fed22ffb0b44b48d587c79898db"
41
+ }