-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: remove metadata definition class (#163)
- Loading branch information
Showing
36 changed files
with
191 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
projects/ngx-meta/src/core/src/__tests__/make-global-metadata-definition.ts
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
projects/ngx-meta/src/core/src/__tests__/make-metadata-provider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { MetadataProvider } from '../metadata-provider' | ||
import { makeGlobalMetadata } from '../make-global-metadata' | ||
|
||
export function makeMetadataProvider<T, Id extends string>( | ||
opts: { | ||
id?: Id | ||
spyName?: string | ||
} = {}, | ||
) { | ||
const id = opts.id ?? 'dummy' | ||
const metadata: MetadataProvider<T> = { | ||
metadata: makeGlobalMetadata(id), | ||
set: jasmine.createSpy(opts.spyName ?? id), | ||
} | ||
return metadata | ||
} |
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
projects/ngx-meta/src/core/src/__tests__/make-scoped-metadata-definition.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Metadata } from './metadata' | ||
import { makeMetadata } from './make-metadata' | ||
|
||
export const makeGlobalMetadata = <Global extends string = string>( | ||
global: Global, | ||
): Metadata => makeMetadata([global]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Metadata } from './metadata' | ||
|
||
export const makeMetadata = <Global extends string = string>( | ||
jsonPath: ReadonlyArray<string>, | ||
global?: Global, | ||
): Metadata => ({ | ||
id: jsonPath.join('.'), | ||
jsonPath, | ||
global, | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.