@payloadcms/drizzle 4.0.0-internal.697830c → 4.0.0-internal.77191e5
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/dist/createTableName.d.ts.map +1 -1
- package/dist/createTableName.js +2 -7
- package/dist/createTableName.js.map +1 -1
- package/dist/exports/postgres.d.ts +2 -0
- package/dist/exports/postgres.d.ts.map +1 -1
- package/dist/exports/postgres.js +2 -0
- package/dist/exports/postgres.js.map +1 -1
- package/dist/find/buildFindManyArgs.d.ts.map +1 -1
- package/dist/find/buildPolymorphicJoinQuery.d.ts +38 -0
- package/dist/find/buildPolymorphicJoinQuery.d.ts.map +1 -0
- package/dist/find/buildPolymorphicJoinQuery.js +135 -0
- package/dist/find/buildPolymorphicJoinQuery.js.map +1 -0
- package/dist/find/buildPolymorphicJoinWhere.d.ts +20 -0
- package/dist/find/buildPolymorphicJoinWhere.d.ts.map +1 -0
- package/dist/find/buildPolymorphicJoinWhere.js +301 -0
- package/dist/find/buildPolymorphicJoinWhere.js.map +1 -0
- package/dist/find/createPolymorphicJoinWherePlan.d.ts +37 -0
- package/dist/find/createPolymorphicJoinWherePlan.d.ts.map +1 -0
- package/dist/find/createPolymorphicJoinWherePlan.js +191 -0
- package/dist/find/createPolymorphicJoinWherePlan.js.map +1 -0
- package/dist/find/findMany.d.ts.map +1 -1
- package/dist/find/traverseFields.d.ts.map +1 -1
- package/dist/find/traverseFields.js +19 -191
- package/dist/find/traverseFields.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/migrate.d.ts.map +1 -1
- package/dist/migrate.js +35 -13
- package/dist/migrate.js.map +1 -1
- package/dist/migrateDown.d.ts +2 -1
- package/dist/migrateDown.d.ts.map +1 -1
- package/dist/migrateDown.js +12 -2
- package/dist/migrateDown.js.map +1 -1
- package/dist/migrateFresh.d.ts +4 -2
- package/dist/migrateFresh.d.ts.map +1 -1
- package/dist/migrateFresh.js +21 -7
- package/dist/migrateFresh.js.map +1 -1
- package/dist/migrateRefresh.d.ts +2 -1
- package/dist/migrateRefresh.d.ts.map +1 -1
- package/dist/migrateRefresh.js +14 -3
- package/dist/migrateRefresh.js.map +1 -1
- package/dist/migrateReset.d.ts +2 -1
- package/dist/migrateReset.d.ts.map +1 -1
- package/dist/migrateReset.js +12 -2
- package/dist/migrateReset.js.map +1 -1
- package/dist/migrateStatus.d.ts +2 -1
- package/dist/migrateStatus.d.ts.map +1 -1
- package/dist/migrateStatus.js +11 -6
- package/dist/migrateStatus.js.map +1 -1
- package/dist/postgres/createDatabase.d.ts.map +1 -1
- package/dist/postgres/createExtensions.d.ts.map +1 -1
- package/dist/postgres/createJSONQuery/index.d.ts.map +1 -1
- package/dist/postgres/createJSONQuery/index.js +3 -3
- package/dist/postgres/createJSONQuery/index.js.map +1 -1
- package/dist/postgres/init.d.ts.map +1 -1
- package/dist/postgres/init.js +6 -0
- package/dist/postgres/init.js.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/groupUpSQLStatements.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/index.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/index.js +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/index.js.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/migrateRelationships.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/traverseFields.d.ts.map +1 -1
- package/dist/postgres/query/assertOperatorHandlerExtensionsInstalled.d.ts +15 -0
- package/dist/postgres/query/assertOperatorHandlerExtensionsInstalled.d.ts.map +1 -0
- package/dist/postgres/query/assertOperatorHandlerExtensionsInstalled.js +25 -0
- package/dist/postgres/query/assertOperatorHandlerExtensionsInstalled.js.map +1 -0
- package/dist/postgres/query/postgresUnaccent.d.ts +13 -0
- package/dist/postgres/query/postgresUnaccent.d.ts.map +1 -0
- package/dist/postgres/query/postgresUnaccent.js +40 -0
- package/dist/postgres/query/postgresUnaccent.js.map +1 -0
- package/dist/postgres/schema/buildDrizzleTable.d.ts.map +1 -1
- package/dist/postgres/schema/geometryColumn.d.ts +2 -2
- package/dist/postgres/schema/geometryColumn.d.ts.map +1 -1
- package/dist/postgres/types.d.ts +13 -2
- package/dist/postgres/types.d.ts.map +1 -1
- package/dist/postgres/types.js.map +1 -1
- package/dist/queries/addJoinTable.d.ts +1 -1
- package/dist/queries/addJoinTable.d.ts.map +1 -1
- package/dist/queries/buildOperatorConstraint.d.ts +22 -0
- package/dist/queries/buildOperatorConstraint.d.ts.map +1 -0
- package/dist/queries/buildOperatorConstraint.js +63 -0
- package/dist/queries/buildOperatorConstraint.js.map +1 -0
- package/dist/queries/buildOrderBy.d.ts +1 -1
- package/dist/queries/buildOrderBy.d.ts.map +1 -1
- package/dist/queries/buildQuery.d.ts.map +1 -1
- package/dist/queries/getTableAlias.d.ts.map +1 -1
- package/dist/queries/getTableColumnFromPath.d.ts +12 -3
- package/dist/queries/getTableColumnFromPath.d.ts.map +1 -1
- package/dist/queries/getTableColumnFromPath.js +59 -27
- package/dist/queries/getTableColumnFromPath.js.map +1 -1
- package/dist/queries/operatorMap.d.ts +7 -3
- package/dist/queries/operatorMap.d.ts.map +1 -1
- package/dist/queries/operatorMap.js.map +1 -1
- package/dist/queries/parseParams.d.ts.map +1 -1
- package/dist/queries/parseParams.js +262 -10
- package/dist/queries/parseParams.js.map +1 -1
- package/dist/queries/resolveRelationshipPath.d.ts +36 -0
- package/dist/queries/resolveRelationshipPath.d.ts.map +1 -0
- package/dist/queries/resolveRelationshipPath.js +66 -0
- package/dist/queries/resolveRelationshipPath.js.map +1 -0
- package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
- package/dist/queries/selectDistinct.d.ts.map +1 -1
- package/dist/queries/validateOperatorHandlers.d.ts +8 -0
- package/dist/queries/validateOperatorHandlers.d.ts.map +1 -0
- package/dist/queries/validateOperatorHandlers.js +30 -0
- package/dist/queries/validateOperatorHandlers.js.map +1 -0
- package/dist/schema/build.d.ts.map +1 -1
- package/dist/schema/buildDrizzleRelations.d.ts.map +1 -1
- package/dist/schema/buildRawSchema.d.ts.map +1 -1
- package/dist/schema/idToUUID.d.ts.map +1 -1
- package/dist/schema/traverseFields.d.ts.map +1 -1
- package/dist/schema/traverseFields.js +5 -5
- package/dist/schema/traverseFields.js.map +1 -1
- package/dist/schema/withDefault.d.ts.map +1 -1
- package/dist/sqlite/createJSONQuery/convertPathToJSONTraversal.d.ts.map +1 -1
- package/dist/sqlite/createJSONQuery/convertPathToJSONTraversal.js +3 -2
- package/dist/sqlite/createJSONQuery/convertPathToJSONTraversal.js.map +1 -1
- package/dist/sqlite/createJSONQuery/index.d.ts.map +1 -1
- package/dist/sqlite/createJSONQuery/index.js +6 -5
- package/dist/sqlite/createJSONQuery/index.js.map +1 -1
- package/dist/transform/read/hasManyNumber.d.ts.map +1 -1
- package/dist/transform/read/hasManyText.d.ts.map +1 -1
- package/dist/transform/read/index.d.ts.map +1 -1
- package/dist/transform/read/relationship.d.ts.map +1 -1
- package/dist/transform/read/traverseFields.d.ts.map +1 -1
- package/dist/transform/write/array.d.ts.map +1 -1
- package/dist/transform/write/blocks.d.ts.map +1 -1
- package/dist/transform/write/index.d.ts.map +1 -1
- package/dist/transform/write/numbers.d.ts.map +1 -1
- package/dist/transform/write/relationships.d.ts.map +1 -1
- package/dist/transform/write/selects.d.ts.map +1 -1
- package/dist/transform/write/texts.d.ts.map +1 -1
- package/dist/transform/write/traverseFields.d.ts.map +1 -1
- package/dist/transform/write/traverseFields.js +8 -14
- package/dist/transform/write/traverseFields.js.map +1 -1
- package/dist/types.d.ts +50 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/updateJobs.d.ts.map +1 -1
- package/dist/updateJobs.js +37 -0
- package/dist/updateJobs.js.map +1 -1
- package/dist/updateOne.d.ts.map +1 -1
- package/dist/updateOne.js +41 -1
- package/dist/updateOne.js.map +1 -1
- package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +1 -1
- package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +1 -1
- package/dist/upsertRow/handleUpsertError.d.ts.map +1 -1
- package/dist/upsertRow/index.d.ts +1 -1
- package/dist/upsertRow/index.d.ts.map +1 -1
- package/dist/upsertRow/index.js +25 -5
- package/dist/upsertRow/index.js.map +1 -1
- package/dist/upsertRow/insertArrays.d.ts.map +1 -1
- package/dist/upsertRow/shouldUseOptimizedUpsertRow.d.ts.map +1 -1
- package/dist/utilities/appendPrefixToKeys.d.ts.map +1 -1
- package/dist/utilities/blocksToJsonMigrator.d.ts.map +1 -1
- package/dist/utilities/buildCreateMigration.d.ts.map +1 -1
- package/dist/utilities/buildCreateMigration.js +12 -8
- package/dist/utilities/buildCreateMigration.js.map +1 -1
- package/dist/utilities/buildForeignKeyName.d.ts.map +1 -1
- package/dist/utilities/buildForeignKeyName.js +3 -2
- package/dist/utilities/buildForeignKeyName.js.map +1 -1
- package/dist/utilities/buildIndexName.d.ts.map +1 -1
- package/dist/utilities/buildIndexName.js +3 -2
- package/dist/utilities/buildIndexName.js.map +1 -1
- package/dist/utilities/checkTruncatedIdentifiers.d.ts +13 -0
- package/dist/utilities/checkTruncatedIdentifiers.d.ts.map +1 -0
- package/dist/utilities/checkTruncatedIdentifiers.js +56 -0
- package/dist/utilities/checkTruncatedIdentifiers.js.map +1 -0
- package/dist/utilities/createBlocksMap.d.ts.map +1 -1
- package/dist/utilities/createRelationshipMap.d.ts.map +1 -1
- package/dist/utilities/createSchemaGenerator.d.ts.map +1 -1
- package/dist/utilities/createSchemaGenerator.js +3 -0
- package/dist/utilities/createSchemaGenerator.js.map +1 -1
- package/dist/utilities/escapeSQLValue.d.ts.map +1 -1
- package/dist/utilities/executeSchemaHooks.d.ts.map +1 -1
- package/dist/utilities/extendDrizzleTable.d.ts.map +1 -1
- package/dist/utilities/getArrayRelationName.d.ts.map +1 -1
- package/dist/utilities/getCollectionIdType.d.ts.map +1 -1
- package/dist/utilities/getMigrationTemplate.d.ts.map +1 -1
- package/dist/utilities/getNameFromDrizzleTable.d.ts.map +1 -1
- package/dist/utilities/getPrimaryDb.d.ts +1 -1
- package/dist/utilities/getPrimaryDb.d.ts.map +1 -1
- package/dist/utilities/getTransaction.d.ts +1 -1
- package/dist/utilities/getTransaction.d.ts.map +1 -1
- package/dist/utilities/hasLocalesTable.d.ts.map +1 -1
- package/dist/utilities/isPolymorphicRelationship.d.ts.map +1 -1
- package/dist/utilities/isUUIDType.d.ts.map +1 -1
- package/dist/utilities/json.d.ts.map +1 -1
- package/dist/utilities/migrationTableExists.d.ts.map +1 -1
- package/dist/utilities/parseError.d.ts.map +1 -1
- package/dist/utilities/parseJSONPathSegment.d.ts +9 -0
- package/dist/utilities/parseJSONPathSegment.d.ts.map +1 -0
- package/dist/utilities/parseJSONPathSegment.js +17 -0
- package/dist/utilities/parseJSONPathSegment.js.map +1 -0
- package/dist/utilities/pushDevSchema.d.ts.map +1 -1
- package/dist/utilities/rawConstraint.d.ts.map +1 -1
- package/dist/utilities/sanitizePathSegment.d.ts.map +1 -1
- package/dist/utilities/validateExistingBlockIsIdentical.d.ts +1 -5
- package/dist/utilities/validateExistingBlockIsIdentical.d.ts.map +1 -1
- package/dist/utilities/validateExistingBlockIsIdentical.js.map +1 -1
- package/dist/utilities/validateIdentifierLength.d.ts +12 -0
- package/dist/utilities/validateIdentifierLength.d.ts.map +1 -0
- package/dist/utilities/validateIdentifierLength.js +18 -0
- package/dist/utilities/validateIdentifierLength.js.map +1 -0
- package/package.json +3 -3
- package/dist/upsertRow/handleUpsertError.spec.js +0 -42
- package/dist/upsertRow/handleUpsertError.spec.js.map +0 -1
- package/dist/utilities/isValidStringID.spec.js +0 -15
- package/dist/utilities/isValidStringID.spec.js.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { APIError } from 'payload';
|
|
2
|
+
/** Postgres max identifier length (NAMEDATALEN - 1). */ export const maxIdentifierLength = 63;
|
|
3
|
+
/**
|
|
4
|
+
* Cap for builder-generated identifiers (`buildIndexName`/`buildForeignKeyName`). Sits
|
|
5
|
+
* below `maxIdentifierLength` to leave headroom for the appended `_idx`/`_fk`/`_N` suffixes.
|
|
6
|
+
*/ export const maxGeneratedIdentifierLength = maxIdentifierLength - 3;
|
|
7
|
+
/**
|
|
8
|
+
* Throws if a table or enum identifier exceeds the Postgres 63-char limit.
|
|
9
|
+
*/ export const validateIdentifierLength = (name)=>{
|
|
10
|
+
if (name.length > maxIdentifierLength) {
|
|
11
|
+
throw new APIError(`Exceeded max identifier length for table or enum name of ${maxIdentifierLength} characters. Invalid name: ${name}.
|
|
12
|
+
Tip: You can use the dbName property to reduce the table name length.
|
|
13
|
+
`);
|
|
14
|
+
}
|
|
15
|
+
return name;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=validateIdentifierLength.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/validateIdentifierLength.ts"],"sourcesContent":["import { APIError } from 'payload'\n\n/** Postgres max identifier length (NAMEDATALEN - 1). */\nexport const maxIdentifierLength = 63\n\n/**\n * Cap for builder-generated identifiers (`buildIndexName`/`buildForeignKeyName`). Sits\n * below `maxIdentifierLength` to leave headroom for the appended `_idx`/`_fk`/`_N` suffixes.\n */\nexport const maxGeneratedIdentifierLength = maxIdentifierLength - 3\n\n/**\n * Throws if a table or enum identifier exceeds the Postgres 63-char limit.\n */\nexport const validateIdentifierLength = (name: string): string => {\n if (name.length > maxIdentifierLength) {\n throw new APIError(\n `Exceeded max identifier length for table or enum name of ${maxIdentifierLength} characters. Invalid name: ${name}.\nTip: You can use the dbName property to reduce the table name length.\n `,\n )\n }\n\n return name\n}\n"],"names":["APIError","maxIdentifierLength","maxGeneratedIdentifierLength","validateIdentifierLength","name","length"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,UAAS;AAElC,sDAAsD,GACtD,OAAO,MAAMC,sBAAsB,GAAE;AAErC;;;CAGC,GACD,OAAO,MAAMC,+BAA+BD,sBAAsB,EAAC;AAEnE;;CAEC,GACD,OAAO,MAAME,2BAA2B,CAACC;IACvC,IAAIA,KAAKC,MAAM,GAAGJ,qBAAqB;QACrC,MAAM,IAAID,SACR,CAAC,yDAAyD,EAAEC,oBAAoB,2BAA2B,EAAEG,KAAK;;MAElH,CAAC;IAEL;IAEA,OAAOA;AACT,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/drizzle",
|
|
3
|
-
"version": "4.0.0-internal.
|
|
3
|
+
"version": "4.0.0-internal.77191e5",
|
|
4
4
|
"description": "A library of shared functions used by different payload database adapters",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"@types/pg": "8.20.0",
|
|
56
56
|
"@types/to-snake-case": "1.0.0",
|
|
57
57
|
"@payloadcms/eslint-config": "3.28.0",
|
|
58
|
-
"payload": "4.0.0-internal.
|
|
58
|
+
"payload": "4.0.0-internal.77191e5"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"payload": "4.0.0-internal.
|
|
61
|
+
"payload": "4.0.0-internal.77191e5"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "pnpm build:swc && pnpm build:types",
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ValidationError } from 'payload';
|
|
2
|
-
import { describe, expect, it } from 'vitest';
|
|
3
|
-
import { handleUpsertError } from './handleUpsertError.js';
|
|
4
|
-
const adapter = {
|
|
5
|
-
fieldConstraints: {}
|
|
6
|
-
};
|
|
7
|
-
describe('handleUpsertError', ()=>{
|
|
8
|
-
it('preserves the failing sub-table name on the ValidationError', ()=>{
|
|
9
|
-
const pgError = {
|
|
10
|
-
code: '23505',
|
|
11
|
-
constraint: 'ultrasonic_avail_country_pkey',
|
|
12
|
-
detail: 'Key (id)=(6a27e2a63f4b64567370f595) already exists.'
|
|
13
|
-
};
|
|
14
|
-
let thrown;
|
|
15
|
-
try {
|
|
16
|
-
handleUpsertError({
|
|
17
|
-
adapter,
|
|
18
|
-
collectionSlug: 'ultrasonic',
|
|
19
|
-
error: pgError,
|
|
20
|
-
tableName: 'ultrasonic_avail_country'
|
|
21
|
-
});
|
|
22
|
-
} catch (error) {
|
|
23
|
-
thrown = error;
|
|
24
|
-
}
|
|
25
|
-
expect(thrown).toBeInstanceOf(ValidationError);
|
|
26
|
-
const validationError = thrown;
|
|
27
|
-
const fieldError = validationError.data.errors[0];
|
|
28
|
-
expect(fieldError.path).toBe('id');
|
|
29
|
-
expect(fieldError.tableName).toBe('ultrasonic_avail_country');
|
|
30
|
-
});
|
|
31
|
-
it('re-throws non unique-constraint errors unchanged', ()=>{
|
|
32
|
-
const otherError = new Error('some other db error');
|
|
33
|
-
expect(()=>handleUpsertError({
|
|
34
|
-
adapter,
|
|
35
|
-
collectionSlug: 'ultrasonic',
|
|
36
|
-
error: otherError,
|
|
37
|
-
tableName: 'ultrasonic_avail_country'
|
|
38
|
-
})).toThrow(otherError);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=handleUpsertError.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/upsertRow/handleUpsertError.spec.ts"],"sourcesContent":["import { ValidationError } from 'payload'\nimport { describe, expect, it } from 'vitest'\n\nimport type { DrizzleAdapter } from '../types.js'\n\nimport { handleUpsertError } from './handleUpsertError.js'\n\nconst adapter = { fieldConstraints: {} } as unknown as DrizzleAdapter\n\ndescribe('handleUpsertError', () => {\n it('preserves the failing sub-table name on the ValidationError', () => {\n const pgError = {\n code: '23505',\n constraint: 'ultrasonic_avail_country_pkey',\n detail: 'Key (id)=(6a27e2a63f4b64567370f595) already exists.',\n }\n\n let thrown: unknown\n try {\n handleUpsertError({\n adapter,\n collectionSlug: 'ultrasonic',\n error: pgError,\n tableName: 'ultrasonic_avail_country',\n })\n } catch (error) {\n thrown = error\n }\n\n expect(thrown).toBeInstanceOf(ValidationError)\n const validationError = thrown as ValidationError\n const fieldError = validationError.data.errors[0]!\n expect(fieldError.path).toBe('id')\n expect(fieldError.tableName).toBe('ultrasonic_avail_country')\n })\n\n it('re-throws non unique-constraint errors unchanged', () => {\n const otherError = new Error('some other db error')\n\n expect(() =>\n handleUpsertError({\n adapter,\n collectionSlug: 'ultrasonic',\n error: otherError,\n tableName: 'ultrasonic_avail_country',\n }),\n ).toThrow(otherError)\n })\n})\n"],"names":["ValidationError","describe","expect","it","handleUpsertError","adapter","fieldConstraints","pgError","code","constraint","detail","thrown","collectionSlug","error","tableName","toBeInstanceOf","validationError","fieldError","data","errors","path","toBe","otherError","Error","toThrow"],"mappings":"AAAA,SAASA,eAAe,QAAQ,UAAS;AACzC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,SAAQ;AAI7C,SAASC,iBAAiB,QAAQ,yBAAwB;AAE1D,MAAMC,UAAU;IAAEC,kBAAkB,CAAC;AAAE;AAEvCL,SAAS,qBAAqB;IAC5BE,GAAG,+DAA+D;QAChE,MAAMI,UAAU;YACdC,MAAM;YACNC,YAAY;YACZC,QAAQ;QACV;QAEA,IAAIC;QACJ,IAAI;YACFP,kBAAkB;gBAChBC;gBACAO,gBAAgB;gBAChBC,OAAON;gBACPO,WAAW;YACb;QACF,EAAE,OAAOD,OAAO;YACdF,SAASE;QACX;QAEAX,OAAOS,QAAQI,cAAc,CAACf;QAC9B,MAAMgB,kBAAkBL;QACxB,MAAMM,aAAaD,gBAAgBE,IAAI,CAACC,MAAM,CAAC,EAAE;QACjDjB,OAAOe,WAAWG,IAAI,EAAEC,IAAI,CAAC;QAC7BnB,OAAOe,WAAWH,SAAS,EAAEO,IAAI,CAAC;IACpC;IAEAlB,GAAG,oDAAoD;QACrD,MAAMmB,aAAa,IAAIC,MAAM;QAE7BrB,OAAO,IACLE,kBAAkB;gBAChBC;gBACAO,gBAAgB;gBAChBC,OAAOS;gBACPR,WAAW;YACb,IACAU,OAAO,CAACF;IACZ;AACF"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { isValidStringID } from './isValidStringID.js';
|
|
3
|
-
describe('isValidStringID', ()=>{
|
|
4
|
-
it('should pass', ()=>{
|
|
5
|
-
expect(isValidStringID('1')).toBe(true);
|
|
6
|
-
expect(isValidStringID('a_b_c')).toBe(true);
|
|
7
|
-
expect(isValidStringID('8cc2df6d-6e07-4da4-be48-5fa747c3b92b')).toBe(true);
|
|
8
|
-
});
|
|
9
|
-
it('should not pass', ()=>{
|
|
10
|
-
expect(isValidStringID('1 2 3')).toBe(false);
|
|
11
|
-
expect(isValidStringID('1@')).toBe(false);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=isValidStringID.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/isValidStringID.spec.ts"],"sourcesContent":["import { describe, it, expect } from 'vitest'\nimport { isValidStringID } from './isValidStringID.js'\n\ndescribe('isValidStringID', () => {\n it('should pass', () => {\n expect(isValidStringID('1')).toBe(true)\n expect(isValidStringID('a_b_c')).toBe(true)\n expect(isValidStringID('8cc2df6d-6e07-4da4-be48-5fa747c3b92b')).toBe(true)\n })\n\n it('should not pass', () => {\n expect(isValidStringID('1 2 3')).toBe(false)\n expect(isValidStringID('1@')).toBe(false)\n })\n})\n"],"names":["describe","it","expect","isValidStringID","toBe"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ,SAAQ;AAC7C,SAASC,eAAe,QAAQ,uBAAsB;AAEtDH,SAAS,mBAAmB;IAC1BC,GAAG,eAAe;QAChBC,OAAOC,gBAAgB,MAAMC,IAAI,CAAC;QAClCF,OAAOC,gBAAgB,UAAUC,IAAI,CAAC;QACtCF,OAAOC,gBAAgB,yCAAyCC,IAAI,CAAC;IACvE;IAEAH,GAAG,mBAAmB;QACpBC,OAAOC,gBAAgB,UAAUC,IAAI,CAAC;QACtCF,OAAOC,gBAAgB,OAAOC,IAAI,CAAC;IACrC;AACF"}
|