diff --git a/__tests__/decorators/attribute.test.ts b/__tests__/decorators/attribute.test.ts index f6db8bf..415ccb2 100644 --- a/__tests__/decorators/attribute.test.ts +++ b/__tests__/decorators/attribute.test.ts @@ -1,7 +1,7 @@ import { Chance } from 'chance'; import { Attribute, attributesSymbol } from '../../src/decorators'; -import { isValidFieldKey } from '../../src/utils/isValidFieldKey'; -jest.mock('../../src/utils/isValidFieldKey'); +import { isValidFieldKey } from '../../src/decorators/utils/isValidFieldKey'; +jest.mock('../../src/decorators/utils/isValidFieldKey'); const isValidFieldKeyMocked = jest.mocked(isValidFieldKey); diff --git a/__tests__/decorators/id.test.ts b/__tests__/decorators/id.test.ts index 27a6796..607718b 100644 --- a/__tests__/decorators/id.test.ts +++ b/__tests__/decorators/id.test.ts @@ -1,8 +1,8 @@ -import Chance from 'chance'; +import { Chance } from 'chance'; import { Id, idSymbol } from '../../src/decorators'; -import { isValidFieldKey } from '../../src/utils/isValidFieldKey'; +import { isValidFieldKey } from '../../src/decorators/utils/isValidFieldKey'; -jest.mock('../../src/utils/isValidFieldKey'); +jest.mock('../../src/decorators/utils/isValidFieldKey'); const isValidFieldKeyMocked = jest.mocked(isValidFieldKey); describe('`Id`', () => { @@ -54,7 +54,7 @@ describe('`Id`', () => { metadata, } as ClassFieldDecoratorContext); } catch (error) { - expect(error.message).toBe( + expect((error as Error).message).toBe( `Id() can only be applied once per class. Unable to denote ${key} as an id because ${metadata[idSymbol]} is already an id.`, ); } diff --git a/__tests__/decorators/links.test.ts b/__tests__/decorators/links.test.ts index 0ad9124..d58edb1 100644 --- a/__tests__/decorators/links.test.ts +++ b/__tests__/decorators/links.test.ts @@ -1,9 +1,9 @@ -import Chance from 'chance'; +import { Chance } from 'chance'; import { Link, linksSymbol } from '../../src/decorators'; +import { isValidFieldKey } from '../../src/decorators/utils/isValidFieldKey'; import type { JSONAPILinksObject } from '../../src/types'; -import { isValidFieldKey } from '../../src/utils/isValidFieldKey'; -jest.mock('../../src/utils/isValidFieldKey'); +jest.mock('../../src/decorators/utils/isValidFieldKey'); const isValidFieldKeyMocked = jest.mocked(isValidFieldKey); describe('`Link`', () => { diff --git a/__tests__/decorators/meta.test.ts b/__tests__/decorators/meta.test.ts index a710b02..12bb87e 100644 --- a/__tests__/decorators/meta.test.ts +++ b/__tests__/decorators/meta.test.ts @@ -1,9 +1,9 @@ import { Chance } from 'chance'; import { Meta, metaSymbol } from '../../src/decorators'; +import { isValidFieldKey } from '../../src/decorators/utils/isValidFieldKey'; import type { JSONDataTypes } from '../../src/types'; -import { isValidFieldKey } from '../../src/utils/isValidFieldKey'; -jest.mock('../../src/utils/isValidFieldKey'); +jest.mock('../../src/decorators/utils/isValidFieldKey'); const isValidFieldKeyMocked = jest.mocked(isValidFieldKey); diff --git a/__tests__/decorators/relationship.test.ts b/__tests__/decorators/relationship.test.ts index aee364c..884c35f 100644 --- a/__tests__/decorators/relationship.test.ts +++ b/__tests__/decorators/relationship.test.ts @@ -1,8 +1,8 @@ import { Chance } from 'chance'; import { Relationship, relationshipsSymbol } from '../../src/decorators'; -import { isValidFieldKey } from '../../src/utils/isValidFieldKey'; +import { isValidFieldKey } from '../../src/decorators/utils/isValidFieldKey'; -jest.mock('../../src/utils/isValidFieldKey'); +jest.mock('../../src/decorators/utils/isValidFieldKey'); const isValidFieldKeyMocked = jest.mocked(isValidFieldKey); diff --git a/__tests__/utils/buildSymbol.test.ts b/__tests__/decorators/utils/buildSymbol.test.ts similarity index 82% rename from __tests__/utils/buildSymbol.test.ts rename to __tests__/decorators/utils/buildSymbol.test.ts index 25c5731..65f30f4 100644 --- a/__tests__/utils/buildSymbol.test.ts +++ b/__tests__/decorators/utils/buildSymbol.test.ts @@ -1,5 +1,5 @@ import { Chance } from 'chance'; -import { buildSymbol } from '../../src/utils/buildSymbol'; +import { buildSymbol } from '../../../src/decorators/utils/buildSymbol'; describe('`buildSymbol`', () => { let chance: Chance.Chance; diff --git a/__tests__/utils/isValidFieldKey.test.ts b/__tests__/decorators/utils/isValidFieldKey.test.ts similarity index 86% rename from __tests__/utils/isValidFieldKey.test.ts rename to __tests__/decorators/utils/isValidFieldKey.test.ts index 7f7b326..ed89b05 100644 --- a/__tests__/utils/isValidFieldKey.test.ts +++ b/__tests__/decorators/utils/isValidFieldKey.test.ts @@ -3,8 +3,8 @@ import { firstOnlyCharacters, middleOnlyCharacters, reservedCharacters, -} from '../../src/constants/characterSets'; -import { isValidFieldKey } from '../../src/utils/isValidFieldKey'; +} from '../../../src/decorators/constants/characterSets'; +import { isValidFieldKey } from '../../../src/decorators/utils/isValidFieldKey'; describe('`isValidFieldKey`', () => { let chance: Chance.Chance; @@ -20,7 +20,7 @@ describe('`isValidFieldKey`', () => { try { isValidFieldKey(decoratorName, key); } catch (error) { - expect(error.message).toContain( + expect((error as Error).message).toContain( `@${decoratorName} can only be applied to specific keys. Expected key ${key.toString()}`, ); } @@ -32,7 +32,7 @@ describe('`isValidFieldKey`', () => { try { isValidFieldKey('some-decorator', key); } catch (error) { - expect(error.message).toContain( + expect((error as Error).message).toContain( `Expected key ${key.toString()} to be of type string, but received ${typeof key}.`, ); } @@ -44,7 +44,9 @@ describe('`isValidFieldKey`', () => { try { isValidFieldKey('some-decorator', key); } catch (error) { - expect(error.message).toContain('Expected key to be non-empty.'); + expect((error as Error).message).toContain( + 'Expected key to be non-empty.', + ); } }); @@ -54,7 +56,7 @@ describe('`isValidFieldKey`', () => { try { isValidFieldKey('some-decorator', key); } catch (error) { - expect(error.message).toContain( + expect((error as Error).message).toContain( `Expected key ${key} to not contain any reserved characters, but found ${key}.`, ); } @@ -67,7 +69,7 @@ describe('`isValidFieldKey`', () => { try { isValidFieldKey('some-decorator', key); } catch (error) { - expect(error.message).toContain( + expect((error as Error).message).toContain( `Expected key ${key} to not contain the characters ${firstOnlyCharacter}, except as the first character.`, ); } @@ -87,7 +89,7 @@ describe('`isValidFieldKey`', () => { try { isValidFieldKey('some-decorator', key); } catch (error) { - expect(error.message).toContain( + expect((error as Error).message).toContain( `Expected key ${key} to not contain the characters ${middleOnlyCharacter}, ${middleOnlyCharacter} as the first or last character.`, ); } diff --git a/__tests__/serializers/utils/assertMetadataIsPresent.test.ts b/__tests__/serializers/utils/assertMetadataIsPresent.test.ts new file mode 100644 index 0000000..30a5668 --- /dev/null +++ b/__tests__/serializers/utils/assertMetadataIsPresent.test.ts @@ -0,0 +1,88 @@ +import { assertMetadataIsPresent } from '../../../src/serializers/utils/assertMetadataIsPresent'; + +describe('`assertMetadataIsPresent`', () => { + it('should throw an error if `Symbol.metadata` is undefined', () => { + const originalSymbolMetadata = Symbol.metadata; + + // @ts-expect-error + Symbol.metadata = undefined; + + try { + assertMetadataIsPresent({}); + } catch (error) { + expect((error as Error).message).toEqual( + 'Failed to assert the presence of metadata because the metadata symbol is undefined. You may need to import the `@tsmetadata/polyfill` package.', + ); + } + + // @ts-expect-error + Symbol.metadata = originalSymbolMetadata; + }); + + describe('when the candidate is an array of objects', () => { + it('should throw an error if at least one candidate is not an object', () => { + const candidate = [1, {}]; + + try { + assertMetadataIsPresent(candidate); + } catch (error) { + expect((error as Error).message).toEqual( + 'Failed to assert the presence of metadata because at least one candidate is not an object, meaning no constructor is present.', + ); + } + }); + + it('should throw an error if no metadata is found on an object constructor', () => { + const candidate = [{}, {}]; + + try { + assertMetadataIsPresent(candidate); + } catch (error) { + expect((error as Error).message).toEqual( + 'No metadata was found on an object constructor.', + ); + } + }); + + it('should return `true` if metadata is found on all object constructors', () => { + const candidate = [ + { constructor: { [Symbol.metadata]: 'metadata' } }, + { constructor: { [Symbol.metadata]: 'metadata' } }, + ]; + + expect(assertMetadataIsPresent(candidate)).toBe(true); + }); + }); + + describe('when the candidate is an object', () => { + it('should throw an error if the candidate is not an object', () => { + const candidate = 1; + + try { + assertMetadataIsPresent(candidate); + } catch (error) { + expect((error as Error).message).toEqual( + 'Failed to assert the presence of metadata because at least one candidate is not an object, meaning no constructor is present.', + ); + } + }); + + it('should throw an error if no metadata is found on the object constructor', () => { + const candidate = {}; + + try { + assertMetadataIsPresent(candidate); + } catch (error) { + expect((error as Error).message).toEqual( + 'No metadata was found on an object constructor.', + ); + } + }); + + it('should return `true` if metadata is found on the object constructor', () => { + const candidate = { constructor: { [Symbol.metadata]: 'metadata' } }; + + expect(assertMetadataIsPresent(candidate)).toBe(true); + }); + }); +}); diff --git a/__tests__/serializers/utils/getMetadataBySymbol.test.ts b/__tests__/serializers/utils/getMetadataBySymbol.test.ts new file mode 100644 index 0000000..ede5fb9 --- /dev/null +++ b/__tests__/serializers/utils/getMetadataBySymbol.test.ts @@ -0,0 +1,43 @@ +import { Chance } from 'chance'; +import { assertMetadataIsPresent } from '../../../src/serializers/utils/assertMetadataIsPresent'; +import { getMetadataBySymbol } from '../../../src/serializers/utils/getMetadataBySymbol'; + +jest.mock('../../../src/serializers/utils/assertMetadataIsPresent'); +const assertMetadataIsPresentMocked = jest.mocked(assertMetadataIsPresent); + +describe('`getMetadataSymbol`', () => { + let chance: Chance.Chance; + + beforeEach(() => { + chance = new Chance(); + }); + + it('should assert metadata is present in the given object', () => { + const object = { + constructor: { + [Symbol.metadata]: {}, + }, + }; + + getMetadataBySymbol(object, Symbol('test')); + + expect(assertMetadataIsPresentMocked).toHaveBeenCalledTimes(1); + expect(assertMetadataIsPresentMocked).toHaveBeenCalledWith(object); + }); + + it("should return the symbol's metadata on the given object", () => { + const symbol = Symbol(chance.string()); + + const object = { + constructor: { + [Symbol.metadata]: { + [symbol]: chance.string(), + }, + }, + }; + + const metadata = getMetadataBySymbol(object, symbol); + + expect(metadata).toBe(object.constructor[Symbol.metadata][symbol]); + }); +}); diff --git a/__tests__/serializers/utils/isObject.test.ts b/__tests__/serializers/utils/isObject.test.ts new file mode 100644 index 0000000..cba4205 --- /dev/null +++ b/__tests__/serializers/utils/isObject.test.ts @@ -0,0 +1,15 @@ +import { isObject } from '../../../src/serializers/utils/isObject'; + +describe('`isObject`', () => { + it('should return `false` when the value is `null`', () => { + expect(isObject(null)).toBe(false); + }); + + it('should return `false` when the value is not an object', () => { + expect(isObject('')).toBe(false); + }); + + it('should return `true` when the value is an object', () => { + expect(isObject({})).toBe(true); + }); +}); diff --git a/__tests__/tsconfig.json b/__tests__/tsconfig.json new file mode 100644 index 0000000..c1ea386 --- /dev/null +++ b/__tests__/tsconfig.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@tsmetadata/polyfill/lib/tsconfig.polyfill.json", + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true + }, + "include": ["./**/*.ts"] +} diff --git a/jest.config.ts b/jest.config.ts index dd03e78..8eaf7c3 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -2,6 +2,7 @@ import type { Config } from 'jest'; const config: Config = { preset: 'ts-jest', + setupFilesAfterEnv: ['/jest.setup.ts'], testEnvironment: 'node', coverageThreshold: { global: { diff --git a/jest.setup.ts b/jest.setup.ts new file mode 100644 index 0000000..9a60bf0 --- /dev/null +++ b/jest.setup.ts @@ -0,0 +1,5 @@ +import '@tsmetadata/polyfill'; + +afterEach(() => { + jest.clearAllMocks(); +}); diff --git a/package-lock.json b/package-lock.json index 92c94c4..294d9e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -550,6 +550,74 @@ "@biomejs/cli-win32-x64": "1.9.4" } }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", + "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-darwin-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", + "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", + "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", + "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, "node_modules/@biomejs/cli-linux-x64": { "version": "1.9.4", "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", @@ -584,6 +652,40 @@ "node": ">=14.21.3" } }, + "node_modules/@biomejs/cli-win32-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", + "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", + "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -1512,9 +1614,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001677", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001677.tgz", - "integrity": "sha512-fmfjsOlJUpMWu+mAAtZZZHz7UEwsUxIIvu1TJfO1HqFQvB/B+ii0xr9B5HpbZY/mC4XZ8SvjHJqtAY6pDPQEog==", + "version": "1.0.30001679", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001679.tgz", + "integrity": "sha512-j2YqID/YwpLnKzCmBOS4tlZdWprXm3ZmQLBH9ZBXFOhoxLA46fwyBvx6toCBWBmnuwUY/qB3kEU6gFx8qgCroA==", "dev": true, "funding": [ { @@ -1686,9 +1788,9 @@ "license": "MIT" }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.5.tgz", + "integrity": "sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==", "dev": true, "license": "MIT", "dependencies": { @@ -1790,9 +1892,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.52", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.52.tgz", - "integrity": "sha512-xtoijJTZ+qeucLBDNztDOuQBE1ksqjvNjvqFoST3nGC7fSpqJ+X6BdTBaY5BHG+IhWWmpc6b/KfpeuEDupEPOQ==", + "version": "1.5.55", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.55.tgz", + "integrity": "sha512-6maZ2ASDOTBtjt9FhqYPRnbvKU5tjG0IN9SztUOWYw2AzNDNpKJYLJmlK0/En4Hs/aiWnB+JZ+gW19PIGszgKg==", "dev": true, "license": "ISC" }, @@ -1994,6 +2096,21 @@ "dev": true, "license": "ISC" }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", diff --git a/src/decorators/attribute.ts b/src/decorators/attribute.ts index 1d50a77..8b8567b 100644 --- a/src/decorators/attribute.ts +++ b/src/decorators/attribute.ts @@ -1,5 +1,5 @@ -import { buildSymbol } from '../utils/buildSymbol'; -import { isValidFieldKey } from '../utils/isValidFieldKey'; +import { buildSymbol } from './utils/buildSymbol'; +import { isValidFieldKey } from './utils/isValidFieldKey'; export const attributesSymbol = buildSymbol('attributes'); diff --git a/src/constants/characterSets.ts b/src/decorators/constants/characterSets.ts similarity index 100% rename from src/constants/characterSets.ts rename to src/decorators/constants/characterSets.ts diff --git a/src/decorators/id.ts b/src/decorators/id.ts index 14c633a..fb4128d 100644 --- a/src/decorators/id.ts +++ b/src/decorators/id.ts @@ -1,5 +1,5 @@ -import { buildSymbol } from '../utils/buildSymbol'; -import { isValidFieldKey } from '../utils/isValidFieldKey'; +import { buildSymbol } from './utils/buildSymbol'; +import { isValidFieldKey } from './utils/isValidFieldKey'; export const idSymbol = buildSymbol('id'); diff --git a/src/decorators/links.ts b/src/decorators/links.ts index 44eeb62..3a13b57 100644 --- a/src/decorators/links.ts +++ b/src/decorators/links.ts @@ -1,5 +1,5 @@ -import { buildSymbol } from '../utils/buildSymbol'; -import { isValidFieldKey } from '../utils/isValidFieldKey'; +import { buildSymbol } from './utils/buildSymbol'; +import { isValidFieldKey } from './utils/isValidFieldKey'; import type { JSONAPILinksObject } from '../types'; diff --git a/src/decorators/meta.ts b/src/decorators/meta.ts index 2c49ed2..2230ca3 100644 --- a/src/decorators/meta.ts +++ b/src/decorators/meta.ts @@ -1,5 +1,5 @@ -import { buildSymbol } from '../utils/buildSymbol'; -import { isValidFieldKey } from '../utils/isValidFieldKey'; +import { buildSymbol } from './utils/buildSymbol'; +import { isValidFieldKey } from './utils/isValidFieldKey'; import type { JSONDataTypes } from '../types'; diff --git a/src/decorators/relationship.ts b/src/decorators/relationship.ts index c3136bd..b2fb5b5 100644 --- a/src/decorators/relationship.ts +++ b/src/decorators/relationship.ts @@ -1,7 +1,7 @@ import type { NonArray } from '../types/utils/nonArray'; -import { buildSymbol } from '../utils/buildSymbol'; -import { isValidFieldKey } from '../utils/isValidFieldKey'; +import { buildSymbol } from './utils/buildSymbol'; +import { isValidFieldKey } from './utils/isValidFieldKey'; export const relationshipsSymbol = buildSymbol('relationships'); diff --git a/src/decorators/resource.ts b/src/decorators/resource.ts index f377345..19b0d90 100644 --- a/src/decorators/resource.ts +++ b/src/decorators/resource.ts @@ -1,4 +1,4 @@ -import { buildSymbol } from '../utils/buildSymbol'; +import { buildSymbol } from './utils/buildSymbol'; export const resourceSymbol = buildSymbol('resource'); diff --git a/src/utils/buildSymbol.ts b/src/decorators/utils/buildSymbol.ts similarity index 100% rename from src/utils/buildSymbol.ts rename to src/decorators/utils/buildSymbol.ts diff --git a/src/utils/isValidFieldKey.ts b/src/decorators/utils/isValidFieldKey.ts similarity index 100% rename from src/utils/isValidFieldKey.ts rename to src/decorators/utils/isValidFieldKey.ts diff --git a/tsconfig.json b/tsconfig.json index 069016f..bff089a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,6 @@ "forceConsistentCasingInFileNames": true, "strict": true, "declaration": true, - "skipLibCheck": true, "outDir": "./lib" }, "include": ["./src/**/*.ts"],