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
import { useI18n } from 'vue-i18n' | |
export default function toRelativeTime(value: Date, options?: Intl.RelativeTimeFormatOptions) { | |
const { locale } = useI18n() | |
if (!options) { | |
options = { | |
localeMatcher: 'best fit', | |
numeric: 'auto', | |
style: 'long', |
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
import fastify from './fastify' | |
import mongoose from 'mongoose' | |
import { accessibleRecordsPlugin, accessibleFieldsPlugin } from '@casl/mongoose' | |
mongoose.plugin(accessibleRecordsPlugin) | |
mongoose.plugin(accessibleFieldsPlugin, { | |
getFields: (schema: Record<string, unknown>) => | |
Object.keys({ | |
...(schema as { paths: object }).paths, | |
...(schema as { virtuals: object }).virtuals, |