This file contains hidden or 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
| // Author: Mitch Allen | |
| // File: parser.js | |
| import { readFileSync } from 'fs'; | |
| import Ajv from 'ajv'; | |
| const ajv = new Ajv(); | |
| export function parser(inputFile, schemaFile) { |
This file contains hidden or 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
| { | |
| "foox": 1, | |
| "bar": "abc" | |
| } |
This file contains hidden or 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
| { | |
| "foo": 1, | |
| "bar": "abc" | |
| } |
This file contains hidden or 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
| { | |
| "type": "object", | |
| "properties": { | |
| "foo": { | |
| "type": "integer" | |
| }, | |
| "bar": { | |
| "type": "string" | |
| } | |
| }, |
This file contains hidden or 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
| // Author: Mitch Allen | |
| // File: index.js | |
| import { parser } from './parser.js'; | |
| function main() { | |
| let args = process.argv.slice(2); | |
| if (args.length < 2) { |
This file contains hidden or 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
| // Author: Mitch Allen | |
| // File: parser.js | |
| import { readFileSync } from 'fs'; | |
| import Ajv from 'ajv'; | |
| const ajv = new Ajv(); | |
| export function parser( inputFile, schemaFile ) { |
This file contains hidden or 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
| function createZeroBasedCounter( options = {} ) { | |
| // zero based | |
| // increment automatically wraps | |
| let { | |
| cursor = 0, | |
| limit = 5, // [0..(limit -1)] |
This file contains hidden or 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
| function factory() { | |
| let value = 42; | |
| return { | |
| get price() { return value }, | |
| set price( p ) { | |
| value = p; | |
| } | |
| } |
This file contains hidden or 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
| // Author: Mitch Allen | |
| // Project: js-clone | |
| // File: index.js | |
| // 1. Define a nicer log function | |
| let stringify = (obj) => console.log(JSON.stringify(obj,null,2)); | |
| // 2. Define a source object | |
| let alpha = { name: "Alpha", value: 100 }; |
This file contains hidden or 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
| // File: UseDropdownInput.tsx | |
| // Author: Mitch Allen | |
| import {FormControl, InputLabel, Select, Input, FormHelperText, SelectChangeEvent, MenuItem} from "@mui/material"; | |
| import {ReactNode, useCallback, useState} from "react"; | |
| /* | |
| // App() |