bajo 1.0.8 → 1.0.9

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.
@@ -0,0 +1,14 @@
1
+ function extractText (text, start, end) {
2
+ let result = ''
3
+ const open = text.indexOf(start)
4
+ if (open > -1) {
5
+ text = text.slice(open + end.length)
6
+ const close = text.indexOf(end)
7
+ if (close > -1) {
8
+ result = text.slice(0, close)
9
+ }
10
+ }
11
+ return result
12
+ }
13
+
14
+ export default extractText
@@ -48,7 +48,7 @@ class BajoError {
48
48
  const val = get(v, 'context.value')
49
49
  value[i] = {
50
50
  field,
51
- error: print.write(`validation.${v.type}`, v.context),
51
+ error: print.write(`validation.${v.type}`, v.context ?? {}, {}),
52
52
  value: val,
53
53
  ext: { type: v.type, context: v.context }
54
54
  }
@@ -35,7 +35,7 @@ class Print {
35
35
  let lang = this.plugin.app.bajo.config.lang
36
36
  if (isPlainObject(opts)) {
37
37
  args.pop()
38
- lang = opts.lang
38
+ if (opts.lang) lang = opts.lang
39
39
  }
40
40
  const { fallback, supported } = this.plugin.app.bajo.config.intl
41
41
  if (!unknownLangWarning && !supported.includes(lang)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "A framework to build a giant monstrous app rapidly",
5
5
  "main": "boot/index.js",
6
6
  "scripts": {