« get me outta code hell

canonicalBase.js « wiki-properties « composite « data « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/wiki-properties/canonicalBase.js
blob: 81740d6cf220385255a0a6c44ea30c12618b3de2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import {isURL} from '#validators';

export default function() {
  return {
    flags: {update: true, expose: true},
    update: {validate: isURL},
    expose: {
      transform: (value) =>
        (value === null
          ? null
       : value.endsWith('/')
          ? value
          : value + '/'),
    },
  };
}