Unverified Commit 9858cea9 authored by Hong Minhee's avatar Hong Minhee
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
{
  "recommendations": [
    "denoland.vscode-deno",
    "redhat.vscode-yaml",
    "streetsidesoftware.code-spell-checker"
  ]
}

.vscode/settings.json

0 → 100755
+45 −0
Original line number Diff line number Diff line
{
  "deno.enable": true,
  "deno.unstable": true,
  "files.eol": "\n",
  "files.insertFinalNewline": true,
  "files.trimFinalNewlines": true,
  "yaml.completion": true,
  "yaml.format.enable": false,
  "yaml.hover": true,
  "yaml.schemas": {
    "codegen/schema.yaml": "/vocab/*.yaml",
    "https://json-schema.org/draft/2020-12/schema": "/codegen/schema.yaml"
  },
  "yaml.validate": true,
  "[json]": {
    "editor.defaultFormatter": "vscode.json-language-features",
    "editor.formatOnSave": true
  },
  "[jsonc]": {
    "editor.defaultFormatter": "vscode.json-language-features",
    "editor.formatOnSave": true
  },
  "[typescript]": {
    "editor.defaultFormatter": "denoland.vscode-deno",
    "editor.formatOnSave": true
  },
  "cSpell.words": [
    "bccs",
    "btos",
    "codegen",
    "Deno",
    "docloader",
    "fedify",
    "fediverse",
    "jsonld",
    "langstr",
    "Lemmy",
    "phensley",
    "Pixelfed",
    "rels",
    "subproperty",
    "superproperty",
    "webfinger"
  ]
}

.zed/settings.json

0 → 100644
+17 −0
Original line number Diff line number Diff line
{
  "deno": {
    "enable": true
  },
  "ensure_final_newline_on_save": true,
  "format_on_save": "on",
  "formatter": {
    "external": {
      "command": "deno",
      "arguments": [
        "fmt",
        "-"
      ]
    }
  },
  "preferred_line_length": 80
}

LICENSE

0 → 100644
+0 −0

File added.

Preview size limit exceeded, changes collapsed.

codegen/class.test.ts

0 → 100644
+61 −0
Original line number Diff line number Diff line
import { assertEquals } from "https://deno.land/std@0.217.0/assert/mod.ts";
import { sortTopologically } from "./class.ts";

Deno.test("sortTopologically()", () => {
  const sorted = sortTopologically({
    "https://example.com/quux": {
      uri: "https://example.com/quux",
      name: "Foo",
      extends: "https://example.com/qux",
      entity: true,
      description: "",
      properties: [],
      defaultContext: {},
    },
    "https://example.com/qux": {
      uri: "https://example.com/qux",
      name: "Foo",
      extends: "https://example.com/bar",
      entity: true,
      description: "",
      properties: [],
      defaultContext: {},
    },
    "https://example.com/baz": {
      uri: "https://example.com/baz",
      name: "Foo",
      extends: "https://example.com/foo",
      entity: true,
      description: "",
      properties: [],
      defaultContext: {},
    },
    "https://example.com/bar": {
      uri: "https://example.com/bar",
      name: "Foo",
      extends: "https://example.com/foo",
      entity: true,
      description: "",
      properties: [],
      defaultContext: {},
    },
    "https://example.com/foo": {
      uri: "https://example.com/foo",
      name: "Foo",
      entity: true,
      description: "",
      properties: [],
      defaultContext: {},
    },
  });
  assertEquals(
    sorted,
    [
      "https://example.com/foo",
      "https://example.com/bar",
      "https://example.com/qux",
      "https://example.com/quux",
      "https://example.com/baz",
    ],
  );
});