@wtasnorg/node-lib 0.0.7 → 0.0.9

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 (64) hide show
  1. package/changelog.txt +26 -0
  2. package/dev_checklist.txt +56 -0
  3. package/docs/README.md +15 -32
  4. package/docs/docs.json +916 -240
  5. package/docs/functions/createFindDirectories.md +2 -2
  6. package/docs/functions/decode.md +49 -0
  7. package/docs/functions/encode.md +45 -0
  8. package/docs/functions/hello.md +2 -2
  9. package/docs/functions/parseUserAgent.md +42 -0
  10. package/docs/functions/pojo.md +2 -2
  11. package/docs/interfaces/FileSystemDependencies.md +9 -9
  12. package/docs/interfaces/FindDirectoriesOptions.md +8 -8
  13. package/docs/interfaces/UserAgentInfo.md +61 -0
  14. package/docs/type-aliases/Base64CharsetType.md +13 -0
  15. package/docs/variables/Base64Charset.md +17 -0
  16. package/eslint.config.js +7 -2
  17. package/gen-docs/001_base64_refine.txt +50 -0
  18. package/gen-docs/001_commands.txt +44 -0
  19. package/gen-docs/001_coverage.txt +43 -0
  20. package/gen-docs/001_env.txt +33 -0
  21. package/gen-docs/001_lint.txt +40 -0
  22. package/gen-docs/001_state.txt +58 -0
  23. package/gen-docs/002_api.txt +34 -0
  24. package/gen-docs/002_deps.txt +46 -0
  25. package/gen-docs/002_errors.txt +34 -0
  26. package/gen-docs/002_naming.txt +36 -0
  27. package/gen-docs/002_notes.txt +20 -0
  28. package/gen-docs/002_purity.txt +36 -0
  29. package/gen-docs/002_scope.txt +28 -0
  30. package/gen-docs/002_srp.txt +34 -0
  31. package/gen-sec/001_base64_security.txt +75 -0
  32. package/gen-sec/001_commands.txt +65 -0
  33. package/gen-sec/001_env.txt +28 -0
  34. package/gen-sec/001_findings.txt +63 -0
  35. package/gen-sec/001_inventory.txt +41 -0
  36. package/gen-sec/001_owasp.txt +78 -0
  37. package/gen-sec/001_scope.txt +44 -0
  38. package/package.json +3 -2
  39. package/{README.md → readme.txt} +3 -1
  40. package/src/base64.d.ts +58 -0
  41. package/src/base64.js +138 -0
  42. package/src/base64.test.d.ts +2 -0
  43. package/src/base64.test.js +106 -0
  44. package/src/base64.test.ts +125 -0
  45. package/src/base64.ts +163 -0
  46. package/src/find.d.ts +4 -4
  47. package/src/find.js +12 -6
  48. package/src/find.ts +10 -10
  49. package/src/index.d.ts +6 -2
  50. package/src/index.js +3 -1
  51. package/src/index.ts +11 -1
  52. package/src/pojo.js +1 -1
  53. package/src/pojo.test.js +1 -3
  54. package/src/pojo.test.ts +2 -1
  55. package/src/pojo.ts +1 -1
  56. package/src/user-agent.d.ts +48 -0
  57. package/src/user-agent.js +189 -0
  58. package/src/user-agent.test.d.ts +2 -0
  59. package/src/user-agent.test.js +54 -0
  60. package/src/user-agent.test.ts +60 -0
  61. package/src/user-agent.ts +199 -0
  62. package/DEV_CHECKLIST.md +0 -15
  63. package/docs/_media/LICENSE +0 -21
  64. package/docs/globals.md +0 -16
package/changelog.txt ADDED
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+
3
+ ## [0.0.9] - 2026-01-19
4
+
5
+ ### Added
6
+ - Base64 encoding/decoding in `src/base64.ts` with four charset variants:
7
+ - `standard`: RFC 4648 standard alphabet (A-Z, a-z, 0-9, +, /)
8
+ - `urlsafe`: URL and filename safe (A-Z, a-z, 0-9, -, _)
9
+ - `imap`: Modified Base64 for IMAP mailbox names (A-Z, a-z, 0-9, +, ,)
10
+ - `radix64`: Base64 variant used in OpenPGP (A-Z, a-z, 0-9, +, /)
11
+ - Exported `encode`, `decode`, `Base64Charset`, and `Base64CharsetType` from `index.ts`.
12
+ - Comprehensive unit tests in `src/base64.test.ts` with round-trip tests for all charsets.
13
+
14
+ ## [0.0.8] - 2026-01-19
15
+
16
+ ### Added
17
+ - User-agent parsing functionality in `src/user-agent.ts`.
18
+ - Comprehensive unit tests for user-agent parsing in `src/user-agent.test.ts`.
19
+ - `parseUserAgent` function to extract browser, OS, device, and engine info.
20
+ - `npm run lint` script to `package.json`.
21
+ - ESLint and EditorConfig compliance for new files.
22
+
23
+ ### Fixed
24
+ - Exported `parseUserAgent` function and `UserAgentInfo` type from `index.ts`.
25
+ - Fixed `detectEngine` logic: "Blink" was never returned because "AppleWebKit" check ran first. Reordered checks so Chrome-based browsers correctly return "Blink".
26
+
@@ -0,0 +1,56 @@
1
+ # Development Checklist
2
+
3
+ ## Constraints
4
+
5
+ - [ ] Do not delete failing tests. Explain first. Ask second. No delete.
6
+ - [ ] Do not turn off eslint warnings to avoid linting errors.
7
+
8
+ ## Code Quality Guidelines
9
+
10
+ ### Structure & Style
11
+
12
+ - [ ] Imports/Exports: Imports at the top, exports at the bottom.
13
+ - [ ] Visibility: All primary functions should be exported.
14
+ - [ ] Mutability: Prefer `const` over `let` (`prefer-const`).
15
+ - [ ] Control Blocks: Always use braces `{}` for `if`, `for`, etc. (`curly`).
16
+ - [ ] AI Agent Protocol: AI agents MUST honor the project's ESLint and EditorConfig settings for all modifications. Run `npm run lint` to verify compliance.
17
+
18
+ ### Documentation & Examples
19
+
20
+ - [ ] JSDoc: Comprehensive JSDoc for all exported functions and types.
21
+ - [ ] Examples:
22
+ - At least 3 success examples showing different use cases.
23
+ - At least 1 error/fallback example showing edge cases.
24
+
25
+ ### Consistency
26
+
27
+ - [ ] Default States: For complex types, provide a factory/function that returns default values.
28
+ - [ ] Cross-Lang Parity: Match default values with Golang zero-value conventions where applicable.
29
+
30
+ ---
31
+
32
+ ## Pre-flight Checklist
33
+
34
+ - [ ] Linting: Code passes npm run lint without warnings.
35
+ - [ ] Testing:
36
+ - [ ] Unit tests written for all new functionality.
37
+ - [ ] All tests pass: npm run test.
38
+ - [ ] Build: Project builds successfully: npm run build.
39
+ - [ ] Documentation:
40
+ - [ ] readme.txt updated with new features/changes.
41
+ - [ ] Generated docs refreshed: npm run docs && npm run docs:json.
42
+ - [ ] Version Control:
43
+ - [ ] changelog.txt updated for the current version.
44
+ - [ ] Identity verified (git log -n1) to protect PII.
45
+
46
+ ---
47
+
48
+ ## Useful Commands
49
+
50
+ ```bash
51
+ # Full verification suite
52
+ npm run lint \
53
+ && npm run build \
54
+ && npm run test \
55
+ && npm run docs
56
+ ```
package/docs/README.md CHANGED
@@ -4,42 +4,25 @@
4
4
 
5
5
  # @wtasnorg/node-lib
6
6
 
7
- A library project for nodejs. #nodejs #typescript #library
7
+ ## Interfaces
8
8
 
9
- - [npm org](https://www.npmjs.com/org/wtasnorg)
10
- - [github repo](https://github.com/wtasg/node-lib)
9
+ - [FileSystemDependencies](interfaces/FileSystemDependencies.md)
10
+ - [FindDirectoriesOptions](interfaces/FindDirectoriesOptions.md)
11
+ - [UserAgentInfo](interfaces/UserAgentInfo.md)
11
12
 
12
- ## Functions
13
-
14
- 1. hello (for debugging)
15
- 2. `pojo` for converting class objects to Plain Old Javascript Objects.
16
- 3. `createFindDirectories` as a factory for finding directories; think `find path -type d`.
17
-
18
- ## Develop
19
-
20
- ```bash
21
- git clone git@github.com:wtasg/node-lib.git
22
- npm run build
23
- npm run test
24
- # make changes...
25
- ```
13
+ ## Type Aliases
26
14
 
27
- We are using `node --test` for testing.
15
+ - [Base64CharsetType](type-aliases/Base64CharsetType.md)
28
16
 
29
- ## Install and Usage
17
+ ## Variables
30
18
 
31
- ```bash
32
- npm install @wtasnorg/node-lib
33
- ```
19
+ - [Base64Charset](variables/Base64Charset.md)
34
20
 
35
- ```typescript
36
- # check if you can run code
37
- import {hello} from "@wtasnorg/node-lib";
38
-
39
- await hello();
40
- // "hello from @wtasnorg/node-lib"
41
- ```
42
-
43
- ## License: MIT
21
+ ## Functions
44
22
 
45
- [MIT License file](_media/LICENSE)
23
+ - [createFindDirectories](functions/createFindDirectories.md)
24
+ - [decode](functions/decode.md)
25
+ - [encode](functions/encode.md)
26
+ - [hello](functions/hello.md)
27
+ - [parseUserAgent](functions/parseUserAgent.md)
28
+ - [pojo](functions/pojo.md)