Socket
Socket
Sign inDemoInstall

electron-installer-common

Package Overview
Dependencies
Maintainers
5
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-installer-common - npm Package Compare versions

Comparing version 0.4.2 to 0.5.0

src/sanitizename.js

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 @@

2

package.json
{
"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')
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc