@meith/drivers 0.33.4 → 0.34.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 (2) hide show
  1. package/package.json +6 -6
  2. package/src/files/keys.ts +2 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meith/drivers",
3
- "version": "0.33.4",
3
+ "version": "0.34.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,11 +37,11 @@
37
37
  "nodemailer": "^9.0.5",
38
38
  "redis": "^6.2.1",
39
39
  "shiki": "^4.4.3",
40
- "@meith/attachments": "0.33.4",
41
- "@meith/core": "0.33.4",
42
- "@meith/db": "0.33.4",
43
- "@meith/i18n": "0.33.4",
44
- "@meith/settings": "0.33.4"
40
+ "@meith/attachments": "0.34.0",
41
+ "@meith/core": "0.34.0",
42
+ "@meith/db": "0.34.0",
43
+ "@meith/i18n": "0.34.0",
44
+ "@meith/settings": "0.34.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "next": "16.3.1"
package/src/files/keys.ts CHANGED
@@ -1,21 +1,6 @@
1
- import { ConfigurationError } from '@meith/core'
1
+ import { ConfigurationError, unusableKeyReason } from '@meith/core'
2
2
 
3
- export function unusableKeyReason(key: string): string | undefined {
4
- if (key === '' || key.trim() !== key) {
5
- return 'is empty, or has leading or trailing whitespace'
6
- }
7
- if (key.startsWith('/') || key.includes('//')) {
8
- return 'has an empty path segment'
9
- }
10
- if (key.split('/').some((segment) => segment === '..' || segment === '.')) {
11
- return 'has a relative path segment'
12
- }
13
- // biome-ignore lint/suspicious/noControlCharactersInRegex: rejecting control characters is the point
14
- if (/[\u0000-\u001f\u007f]/.test(key)) {
15
- return 'contains a control character'
16
- }
17
- return undefined
18
- }
3
+ export { unusableKeyReason }
19
4
 
20
5
  export function assertUsableKey(key: string): void {
21
6
  const reason = unusableKeyReason(key)