-
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.
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const $lib = createTypeSpecLibrary({ | ||
// ... | ||
state: { | ||
customName: { description: "State for the @customName decorator" }, | ||
}, | ||
}); | ||
|
||
export const StateKeys = $lib.stateKeys; |
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,25 @@ | ||
// import { StateKeys } from "./lib.js"; | ||
|
||
// // Create a unique key | ||
// const key = StateKeys.customName; | ||
// export function $faker(context, target, name) { | ||
// // Keep a mapping between the target and a value. | ||
// context.program.stateMap(key).set(target, name); | ||
|
||
// // Keep an index of a type. | ||
// context.program.stateSet(key).add(target); | ||
// } | ||
let key = 0; | ||
export function $faker(context, target, name) { | ||
console.log(target.node) | ||
// if (target.model) { | ||
// console.log(name); | ||
// // console.log(context); | ||
// console.log(target.model.properties); | ||
// // context.program.stateMap(key).set(target, name); | ||
// // key += 1; | ||
|
||
// target.type['x-faker'] = name.value; | ||
// console.log('---------------------'); | ||
// } | ||
} |
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