electron-installer-common
Advanced tools
Comparing version 0.4.2 to 0.5.0
14
NEWS.md
@@ -5,4 +5,16 @@ # `electron-installer-common` - Changes by Version | ||
[Unreleased]: https://github.com/electron-userland/electron-installer-common/compare/v0.4.2...master | ||
[Unreleased]: https://github.com/electron-userland/electron-installer-common/compare/v0.5.0...master | ||
## [0.5.0] - 2019-01-04 | ||
[0.5.0]: https://github.com/electron-userland/electron-installer-common/compare/v0.4.2...v0.5.0 | ||
### Added | ||
* `sanitizeName` function (#10) | ||
### Changed | ||
* The default value for `replaceScopeName`'s `divider` parameter changed from `_` to `-` (#10) | ||
## [0.4.2] - 2019-01-03 | ||
@@ -9,0 +21,0 @@ |
{ | ||
"name": "electron-installer-common", | ||
"version": "0.4.2", | ||
"version": "0.5.0", | ||
"description": "Common functionality for creating distributable Electron apps", | ||
@@ -5,0 +5,0 @@ "author": "Mark Lee", |
@@ -13,2 +13,3 @@ 'use strict' | ||
const replaceScopeName = require('./replacescopename') | ||
const sanitizeName = require('./sanitizename') | ||
const spawn = require('./spawn') | ||
@@ -215,4 +216,5 @@ const tmp = require('tmp-promise') | ||
replaceScopeName: replaceScopeName, | ||
sanitizeName: sanitizeName, | ||
spawn: spawn, | ||
wrapError: error.wrapError | ||
} |
@@ -7,8 +7,8 @@ 'use strict' | ||
* @param {?string} [name=''] - the Node package name to normalize | ||
* @param {?string} [divider='_'] - the character(s) to replace slashes with | ||
* @param {?string} [divider='-'] - the character(s) to replace slashes with | ||
*/ | ||
module.exports = function replaceScopeName (name, divider) { | ||
name = name || '' | ||
divider = divider || '_' | ||
divider = divider || '-' | ||
return name.replace(/^@/, '').replace('/', divider) | ||
} |
@@ -15,7 +15,7 @@ 'use strict' | ||
test('Scoped name with default divider', t => { | ||
t.is(replaceScopeName('@scoped/core'), 'scoped_core') | ||
t.is(replaceScopeName('@scoped/core'), 'scoped-core') | ||
}) | ||
test('Scoped name using a custom divider', t => { | ||
t.is(replaceScopeName('@scoped/core', '-'), 'scoped-core') | ||
t.is(replaceScopeName('@scoped/core', '_'), 'scoped_core') | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60277
161
601