Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .terserrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
"@atom.inSpecMode": !isTest ? "() => false" : "() => true"
},
"ecma": "2018", // Change based on the target
// "toplevel": true, // controlled by Parcel
"toplevel": false,
"hoist_vars": false,
"hoist_funs": true,
"pure_getters": true,
Expand Down
2 changes: 1 addition & 1 deletion lib/decoration-management.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

import { Emitter } from 'atom'
import { escapeRegExp } from 'underscore-plus'
import { escapeRegExp } from './deps/underscore-plus'
import path from 'path'
import Decoration from './decoration'

Expand Down
22 changes: 22 additions & 0 deletions lib/deps/underscore-plus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const regexEscape = /[-/\\^$*+?.()|[\]{}]/g
export function escapeRegExp (string) {
if (string) {
return string.replace(regexEscape, '\\$&')
} else {
return ''
}
}

const regexDaherize = /([A-Z])|(_)/g
export function dasherize (string) {
if (!string) { return '' }

string = `${string[0].toLowerCase()}${string.slice(1)}`
return string.replace(regexDaherize, function (m, letter) {
if (letter) {
return `-${letter.toLowerCase()}`
} else {
return '-'
}
})
}
2 changes: 1 addition & 1 deletion lib/minimap-plugin-generator-element.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

import { dasherize } from 'underscore-plus'
import { dasherize } from './deps/underscore-plus'
import { getHomeDirectory, existsSync } from 'fs-plus'
import path from 'path'
import { BufferedProcess } from 'atom'
Expand Down
2 changes: 1 addition & 1 deletion lib/mixins/canvas-drawer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

import { escapeRegExp } from 'underscore-plus'
import { escapeRegExp } from '../deps/underscore-plus'
import Mixin from 'mixto'

import * as Main from '../main'
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
"delegato": "^1.0.0",
"element-resize-detector": "^1.2.1",
"fs-plus": "^3.1.1",
"mixto": "^1.0.0",
"underscore-plus": "^1.7.0"
"mixto": "^1.0.0"
},
"devDependencies": {
"@types/atom": "^1.40.5",
Expand All @@ -74,7 +73,8 @@
"rollup": "2.36.1",
"rollup-plugin-atomic": "^2.0.1",
"shx": "^0.3.3",
"standard": "^16.0.3"
"standard": "^16.0.3",
"underscore-plus": "^1.7.0"
},
"standard": {
"globals": [
Expand Down