tscommons-esm-session 0.0.2

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.
@@ -0,0 +1,3 @@
1
+ import { ICommonsSession, isICommonsSession } from './interfaces/icommons-session.mjs';
2
+ import { ICommonsUser, isICommonsUser } from './interfaces/icommons-user.mjs';
3
+ export { ICommonsSession, isICommonsSession, ICommonsUser, isICommonsUser };
package/dist/index.mjs ADDED
@@ -0,0 +1,4 @@
1
+ import { isICommonsSession } from './interfaces/icommons-session.mjs';
2
+ import { isICommonsUser } from './interfaces/icommons-user.mjs';
3
+ export { isICommonsSession, isICommonsUser };
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAgB,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAEN,iBAAiB,EAEjB,cAAc,EACd,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface ICommonsSession<T> {
2
+ sid: string;
3
+ start: Date;
4
+ last: Date;
5
+ data: T;
6
+ }
7
+ export declare function isICommonsSession<T>(test: unknown, isT: (t: unknown) => t is T): test is ICommonsSession<T>;
@@ -0,0 +1,13 @@
1
+ import { commonsTypeHasPropertyString, commonsTypeHasPropertyDate, commonsTypeHasPropertyT } from 'tscommons-esm-core';
2
+ export function isICommonsSession(test, isT) {
3
+ if (!commonsTypeHasPropertyString(test, 'sid'))
4
+ return false;
5
+ if (!commonsTypeHasPropertyDate(test, 'start'))
6
+ return false;
7
+ if (!commonsTypeHasPropertyDate(test, 'last'))
8
+ return false;
9
+ if (!commonsTypeHasPropertyT(test, 'data', isT))
10
+ return false;
11
+ return true;
12
+ }
13
+ //# sourceMappingURL=icommons-session.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icommons-session.mjs","sourceRoot":"","sources":["../../src/interfaces/icommons-session.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAW5B,MAAM,UAAU,iBAAiB,CAC/B,IAAa,EACb,GAA2B;IAE5B,IAAI,CAAC,4BAA4B,CAAC,IAAI,EAAE,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAE7D,IAAI,CAAC,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7D,IAAI,CAAC,0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IAE5D,IAAI,CAAC,uBAAuB,CAAI,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAEjE,OAAO,IAAI,CAAC;AACb,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface ICommonsUser {
2
+ username: string;
3
+ enabled: boolean;
4
+ }
5
+ export declare function isICommonsUser(test: unknown): test is ICommonsUser;
@@ -0,0 +1,9 @@
1
+ import { commonsTypeHasPropertyString, commonsTypeHasPropertyBoolean } from 'tscommons-esm-core';
2
+ export function isICommonsUser(test) {
3
+ if (!commonsTypeHasPropertyString(test, 'username'))
4
+ return false;
5
+ if (!commonsTypeHasPropertyBoolean(test, 'enabled'))
6
+ return false;
7
+ return true;
8
+ }
9
+ //# sourceMappingURL=icommons-user.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icommons-user.mjs","sourceRoot":"","sources":["../../src/interfaces/icommons-user.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAOjG,MAAM,UAAU,cAAc,CAC5B,IAAa;IAEd,IAAI,CAAC,4BAA4B,CAAC,IAAI,EAAE,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC;IAClE,IAAI,CAAC,6BAA6B,CAAC,IAAI,EAAE,SAAS,CAAC;QAAE,OAAO,KAAK,CAAC;IAElE,OAAO,IAAI,CAAC;AACb,CAAC"}
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "tscommons-esm-session",
3
+ "version": "0.0.2",
4
+ "description": "",
5
+ "scripts": {
6
+ "tsc": "./node_modules/typescript/bin/tsc",
7
+ "preprepare": "rm -rf ./dist; php ~/Dev/etim.php src/ && npm run tsc",
8
+ "publish-major": "rm -rf dist; npm run tsc && npx eslint . && npm run preprepare && npm version major && npm install && npm publish && git add . && git commit -m 'publish'",
9
+ "publish-minor": "rm -rf dist; npm run tsc && npx eslint . && npm run preprepare && npm version minor && npm install && npm publish && git add . && git commit -m 'publish'",
10
+ "publish-patch": "rm -rf dist; npm run tsc && npx eslint . && npm run preprepare && npm version patch && npm install && npm publish && git add . && git commit -m 'publish'"
11
+ },
12
+ "main": "dist/index.mjs",
13
+ "types": "dist/index.d.mjs",
14
+ "type": "module",
15
+ "author": "Pete Morris",
16
+ "license": "ISC",
17
+ "devDependencies": {
18
+ "@stylistic/eslint-plugin-ts": "^2.10.1",
19
+ "eslint-plugin-import": "^2.31.0",
20
+ "eslint-plugin-prefer-arrow-functions": "^3.4.1",
21
+ "typescript": "^5.6.3",
22
+ "typescript-eslint": "^8.14.0"
23
+ },
24
+ "files": [
25
+ "dist/**/*"
26
+ ],
27
+ "dependencies": {
28
+ "tscommons-esm-core": "^0.0.2"
29
+ }
30
+ }