@modernpoacher/halacious 6.2.6 → 6.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  declare module '@modernpoacher/halacious' {
2
- export const plugin: object
2
+ const plugin: object
3
+ export {
4
+ plugin
5
+ }
3
6
  }
package/lib/plugin.js CHANGED
@@ -10,6 +10,12 @@ const async = require('async')
10
10
  const {
11
11
  marked
12
12
  } = require('marked')
13
+ const {
14
+ mangle
15
+ } = require('marked-mangle')
16
+ const {
17
+ gfmHeadingId
18
+ } = require('marked-gfm-heading-id')
13
19
  const urlTemplate = require('url-template')
14
20
  const Negotiator = require('negotiator')
15
21
  const URITemplate = require('urijs/src/URITemplate')
@@ -98,7 +104,8 @@ exports.plugin = {
98
104
  settings = validated
99
105
  })
100
106
 
101
- marked.setOptions(settings.marked)
107
+ marked.use(gfmHeadingId(settings.marked))
108
+ marked.use(mangle(settings.marked))
102
109
 
103
110
  const selection = settings.apiServerLabel
104
111
  ? server.select(settings.apiServerLabel)
@@ -2,8 +2,8 @@
2
2
  const _ = require('lodash')
3
3
  const hoek = require('@hapi/hoek')
4
4
 
5
- const templatedRE = new RegExp('{*}')
6
5
  const URI = require('urijs')
6
+ const templatedRE = /{*}/
7
7
 
8
8
  /**
9
9
  * A HAL wrapper interface around an entity. Provides an api for adding new links and recursively embedding child
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/halacious",
3
- "version": "6.2.6",
3
+ "version": "6.2.7",
4
4
  "description": "A HAL processor for Hapi",
5
5
  "keywords": [
6
6
  "HAL",
@@ -30,15 +30,20 @@
30
30
  "lint": "eslint .",
31
31
  "lint:fix": "npm run lint -- --fix",
32
32
  "test": "cross-env NODE_ENV=test mocha test",
33
- "pre-commit": "npm run lint && npm test"
33
+ "prepare": "husky install"
34
34
  },
35
35
  "dependencies": {
36
36
  "@hapi/boom": "9.1.0",
37
37
  "@hapi/hoek": "9.0.4",
38
38
  "@hapi/joi": "15.1.1",
39
+ "@typescript-eslint/eslint-plugin": "^5.59.7",
40
+ "@typescript-eslint/parser": "^5.59.7",
39
41
  "async": "^3.2.4",
42
+ "eslint-config-standard-with-typescript": "^34.0.1",
40
43
  "lodash": "^4.17.21",
41
44
  "marked": "^5.0.3",
45
+ "marked-gfm-heading-id": "^3.0.3",
46
+ "marked-mangle": "^1.0.1",
42
47
  "negotiator": "^0.6.3",
43
48
  "pug": "^3.0.2",
44
49
  "urijs": "^1.19.11",
package/tsconfig.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "NodeNext",
4
+ "target": "ESNext",
5
+ "moduleResolution": "NodeNext",
6
+ "noEmit": true,
7
+ "strict": true,
8
+ "isolatedModules": true,
9
+ "baseUrl": "."
10
+ }
11
+ }
package/types/index.d.ts CHANGED
@@ -1,4 +1,12 @@
1
1
  declare namespace halacious {
2
+ export interface Collection {
3
+ uid: string
4
+ }
5
+
6
+ export interface Member {
7
+ uid: string
8
+ }
9
+
2
10
  export interface Representation {
3
11
  request: {
4
12
  route: {
@@ -11,8 +19,8 @@ declare namespace halacious {
11
19
  }
12
20
  }
13
21
  entity: {
14
- collections?: Array<{ uid: string }>
15
- members?: Array<{ uid: string }>
22
+ collections?: Collection[]
23
+ members?: Member[]
16
24
  }
17
25
  ignore: (v: string) => void
18
26
  embed: (v: string, u: string, m: object) => void
package/views/rel.jade CHANGED
@@ -4,4 +4,4 @@ head
4
4
  body
5
5
  h1=rel.name
6
6
  =rel.description
7
- !=relData
7
+ !=relData