Skip to content

Commit 0e5ba99

Browse files
authored
Merge pull request #758 from atom-minimap/build
2 parents 61a8494 + 07512f3 commit 0e5ba99

File tree

6 files changed

+29
-7
lines changed

6 files changed

+29
-7
lines changed

.terserrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
"@atom.inSpecMode": !isTest ? "() => false" : "() => true"
1111
},
1212
"ecma": "2018", // Change based on the target
13-
// "toplevel": true, // controlled by Parcel
13+
"toplevel": false,
1414
"hoist_vars": false,
1515
"hoist_funs": true,
1616
"pure_getters": true,

lib/decoration-management.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
import { Emitter } from 'atom'
4-
import { escapeRegExp } from 'underscore-plus'
4+
import { escapeRegExp } from './deps/underscore-plus'
55
import path from 'path'
66
import Decoration from './decoration'
77

lib/deps/underscore-plus.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const regexEscape = /[-/\\^$*+?.()|[\]{}]/g
2+
export function escapeRegExp (string) {
3+
if (string) {
4+
return string.replace(regexEscape, '\\$&')
5+
} else {
6+
return ''
7+
}
8+
}
9+
10+
const regexDaherize = /([A-Z])|(_)/g
11+
export function dasherize (string) {
12+
if (!string) { return '' }
13+
14+
string = `${string[0].toLowerCase()}${string.slice(1)}`
15+
return string.replace(regexDaherize, function (m, letter) {
16+
if (letter) {
17+
return `-${letter.toLowerCase()}`
18+
} else {
19+
return '-'
20+
}
21+
})
22+
}

lib/minimap-plugin-generator-element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
import { dasherize } from 'underscore-plus'
3+
import { dasherize } from './deps/underscore-plus'
44
import { getHomeDirectory, existsSync } from 'fs-plus'
55
import path from 'path'
66
import { BufferedProcess } from 'atom'

lib/mixins/canvas-drawer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
import { escapeRegExp } from 'underscore-plus'
3+
import { escapeRegExp } from '../deps/underscore-plus'
44
import Mixin from 'mixto'
55

66
import * as Main from '../main'

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@
5959
"delegato": "^1.0.0",
6060
"element-resize-detector": "^1.2.1",
6161
"fs-plus": "^3.1.1",
62-
"mixto": "^1.0.0",
63-
"underscore-plus": "^1.7.0"
62+
"mixto": "^1.0.0"
6463
},
6564
"devDependencies": {
6665
"@types/atom": "^1.40.5",
@@ -74,7 +73,8 @@
7473
"rollup": "2.36.1",
7574
"rollup-plugin-atomic": "^2.0.1",
7675
"shx": "^0.3.3",
77-
"standard": "^16.0.3"
76+
"standard": "^16.0.3",
77+
"underscore-plus": "^1.7.0"
7878
},
7979
"standard": {
8080
"globals": [

0 commit comments

Comments
 (0)