Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

code-error-fragment

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-error-fragment - npm Package Compare versions

Comparing version 0.0.216 to 0.0.217

module.js

62

build.js

@@ -16,2 +16,64 @@ (function (global, factory) {

/**
* Results cache
*/
var res = '';
var cache;
/**
* Expose `repeat`
*/
var repeatString = repeat;
/**
* Repeat the given `string` the specified `number`
* of times.
*
* **Example:**
*
* ```js
* var repeat = require('repeat-string');
* repeat('A', 5);
* //=> AAAAA
* ```
*
* @param {String} `string` The string to repeat
* @param {Number} `number` The number of times to repeat the string
* @return {String} Repeated string
* @api public
*/
function repeat(str, num) {
if (typeof str !== 'string') {
throw new TypeError('expected a string');
}
// cover common, quick use cases
if (num === 1) return str;
if (num === 2) return str + str;
var max = str.length * num;
if (cache !== str || typeof cache === 'undefined') {
cache = str;
res = '';
} else if (res.length >= max) {
return res.substr(0, max);
}
while (max > res.length && num > 1) {
if (num & 1) {
res += str;
}
num >>= 1;
str += str;
}
res += str;
res = res.substr(0, max);
return res;
}
'use strict';

@@ -18,0 +80,0 @@

2

index.js

@@ -1,2 +0,2 @@

import nprepeatString from 'repeat-string';
import repeatString from 'repeat-string';
import padStart from 'pad-start';

@@ -3,0 +3,0 @@

{
"name": "code-error-fragment",
"version": "0.0.216",
"version": "0.0.217",
"author": "Vlad Trushin",

@@ -16,4 +16,4 @@ "homepage": "https://github.com/vtrushin/code-error-fragment",

"main": "build.js",
"module": "index",
"jsnext:main": "index",
"module": "module",
"jsnext:main": "module",
"dependencies": {

@@ -20,0 +20,0 @@ "pad-start": "^1.0.2",

@@ -6,27 +6,9 @@ import commonjs from 'rollup-plugin-commonjs';

export default {
const plugins = [
commonjs(),
resolve()
];
const settings = {
input: 'index.js',
name: 'codeErrorFragment',
output: {
file: 'build.js',
format: 'umd'
},
plugins: [
resolve(),
commonjs(),
babel({
exclude: 'node_modules/**',
presets: [
['es2015', {
modules: false
}],
'stage-3'
],
plugins: [
'external-helpers'
],
// fixing temporary rollup's regression, remove when https://github.com/rollup/rollup/issues/1595 gets solved
externalHelpersWhitelist: babelHelpersList.filter(helperName => helperName !== 'asyncGenerator'),
})
],
watch: {

@@ -36,2 +18,38 @@ include: '*.js',

}
}
};
export default [
// ES5 build
Object.assign({}, settings, {
name: 'codeErrorFragment',
output: {
file: 'build.js',
format: 'umd'
},
plugins: plugins.concat(
babel({
exclude: 'node_modules/**',
presets: [
['es2015', {
modules: false
}],
'stage-3'
],
plugins: [
'external-helpers'
],
// fixing temporary rollup's regression, remove when https://github.com/rollup/rollup/issues/1595 gets solved
externalHelpersWhitelist: babelHelpersList.filter(helperName => helperName !== 'asyncGenerator'),
})
)
}),
// ES6 module
Object.assign({}, settings, {
output: {
file: 'module.js',
format: 'es'
},
plugins
})
]
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