Skip to content

Commit

Permalink
Revert "Replace relative-date with a utility function"
Browse files Browse the repository at this point in the history
This reverts commit aafbf94.
  • Loading branch information
koddsson committed Oct 26, 2020
1 parent aafbf94 commit eef9070
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 42 deletions.
5 changes: 5 additions & 0 deletions koddsson.com/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions koddsson.com/package.json
Expand Up @@ -27,6 +27,7 @@
"html-entities": "^1.3.1",
"morgan": "^1.10.0",
"node-fetch": "^2.6.1",
"relative-date": "^1.1.3",
"sqlite": "^4.0.14",
"sqlite3": "^5.0.0"
},
Expand Down
3 changes: 2 additions & 1 deletion koddsson.com/src/data.ts
@@ -1,6 +1,7 @@
import relativeDate from 'relative-date'

import type {Note, Photo} from './types'
import {get} from './database.js'
import {relativeDate} from './utils/date.js'

async function getPhoto(slug: string): Promise<Photo> {
return (await get<Photo>('SELECT * FROM photos where slug = ?', slug))!
Expand Down
2 changes: 1 addition & 1 deletion koddsson.com/src/notes.ts
@@ -1,6 +1,7 @@
import fs from 'fs'
import express from 'express'
import bodyParser from 'body-parser'
import relativeDate from 'relative-date'
import hbs from 'hbs'
import markdown from 'helper-markdown'
import HTMLEntities from 'html-entities'
Expand All @@ -9,7 +10,6 @@ import {fileURLToPath} from 'url'
import {dirname} from 'path'

import * as db from './database.js'
import {relativeDate} from './utils/date.js'
import type {Note} from './types'

const __filename = fileURLToPath(import.meta.url)
Expand Down
4 changes: 4 additions & 0 deletions koddsson.com/src/types/relative-date/index.d.ts
@@ -0,0 +1,4 @@
declare module 'relative-date' {
function relativeDate(arg: number): string
export = relativeDate
}
40 changes: 0 additions & 40 deletions koddsson.com/src/utils/date.ts

This file was deleted.

0 comments on commit eef9070

Please sign in to comment.