hash
stringlengths 40
40
| diff
stringlengths 172
2.63k
| message
stringlengths 12
593
| project
stringlengths 7
65
| split
stringclasses 1
value | diff_languages
stringclasses 54
values |
|---|---|---|---|---|---|
fb76d555fe7822e7aec2a0967122a0c192d3dc27
|
diff --git a/.eslintrc.js b/.eslintrc.js
index <HASH>..<HASH> 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -27,6 +27,7 @@ module.exports = {
rules: {
'arrow-parens': 'off',
+ 'arrow-body-style': 'off',
'comma-dangle': ['error', 'never'],
'class-methods-use-this': 'off',
'consistent-return': 'off',
|
chore(eslint): disable arrow-body-style again (team consensus)
|
instana_nodejs-sensor
|
train
|
js
|
fa0dc3a237806c9d28ba08063055433b2c48aa22
|
diff --git a/test/browser/test.js b/test/browser/test.js
index <HASH>..<HASH> 100755
--- a/test/browser/test.js
+++ b/test/browser/test.js
@@ -12,6 +12,10 @@ var server = require('./server.js');
var testTimeout = 30 * 60 * 1000;
+var retries = 0;
+var MAX_RETRIES = 5;
+var MS_BEFORE_RETRY = 20000;
+
var username = process.env.SAUCE_USERNAME;
var accessKey = process.env.SAUCE_ACCESS_KEY;
@@ -101,9 +105,16 @@ function startSauceConnect(callback) {
sauceConnectLauncher(options, function (err, _sauceConnectProcess) {
if (err) {
- console.error('Failed to connect to saucelabs');
- console.error(err);
- process.exit(1);
+ console.error('Failed to connect to saucelabs, err=', err);
+
+ if (++retries > MAX_RETRIES) {
+ console.log('Max retries reached, exiting');
+ process.exit(1);
+ } else {
+ console.log('Retry', retries);
+ startSauceConnect(callback);
+ }
+
} else {
sauceConnectProcess = _sauceConnectProcess;
sauceClient = wd.promiseChainRemote('localhost', 4445, username, accessKey);
|
feat(sauce): retry
|
delta-db_deltadb-common-utils
|
train
|
js
|
ad9e64d086d8a5d12a046b6a38ed54d371068ee2
|
diff --git a/lib/browser/api/web-contents.js b/lib/browser/api/web-contents.js
index <HASH>..<HASH> 100644
--- a/lib/browser/api/web-contents.js
+++ b/lib/browser/api/web-contents.js
@@ -184,7 +184,7 @@ WebContents.prototype.executeJavaScript = function (code, hasUserGesture, callba
return asyncWebFrameMethods.call(this, requestId, 'executeJavaScript', callback, code, hasUserGesture)
} else {
return new Promise((resolve, reject) => {
- this.once('did-finish-load', () => {
+ this.once('did-stop-loading', () => {
asyncWebFrameMethods.call(this, requestId, 'executeJavaScript', callback, code, hasUserGesture).then(resolve).catch(reject)
})
})
|
fix: remove race condition for executeJavaScript (#<I>)
Replaces 'did-finish-load' with 'did-stop-loading' which semantically
maps to the events inside Chromium. Before I think we were relying
on a natural <I>% winnable race condition.
Fixes #<I>
|
electron_electron
|
train
|
js
|
e73e253f25c755031d986f1f8c1ec4a31b4f4ba0
|
diff --git a/spec/rack/app/middleware_spec.rb b/spec/rack/app/middleware_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/rack/app/middleware_spec.rb
+++ b/spec/rack/app/middleware_spec.rb
@@ -6,15 +6,24 @@ describe Rack::App do
describe '.use' do
rack_app do
+
use BlockMiddlewareTester, 'test' do
'testing'
end
- get '/' do
+ use SampleMiddleware, "hello", "world"
+
+ get '/BlockMiddlewareTester' do
request.env['test']
end
+
+ get '/SampleMiddleware' do
+ request.env['hello']
+ end
end
- it { expect(get('/').body).to eq 'testing' }
+ it { expect(get('/BlockMiddlewareTester').body).to eq 'testing' }
+ it { expect(get('/SampleMiddleware').body).to eq 'world' }
+
end
end
|
test: add more test to cover more the use method
|
rack-app_rack-app
|
train
|
rb
|
7441e64622d2c229f8e065d86fe1602655128540
|
diff --git a/src/config/.eslintrc.js b/src/config/.eslintrc.js
index <HASH>..<HASH> 100644
--- a/src/config/.eslintrc.js
+++ b/src/config/.eslintrc.js
@@ -6,10 +6,12 @@ module.exports = {
},
env: {
'jest/globals': true,
+ es6: true,
browser: true,
node: true,
},
rules: {
+ 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'prefer-const': 'error',
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
|
fix(lint): support es6 and unused vars starting with _
|
macklinu_mdu-scripts
|
train
|
js
|
8aaa37a8c6d18a6d962f0bde78b5429e4c92a571
|
diff --git a/config/build.config.js b/config/build.config.js
index <HASH>..<HASH> 100644
--- a/config/build.config.js
+++ b/config/build.config.js
@@ -1,7 +1,7 @@
const pkg = require('../package.json');
module.exports = {
- ngVersion: '1.6.7',
+ ngVersion: '1.7.2',
version: pkg.version,
repository: pkg.repository.url
.replace(/^git/,'https')
|
chore(docs): update from AngularJS <I> to <I> (#<I>)
|
angular_material
|
train
|
js
|
c9e077902165d221e2f52ccb263cea0913901e36
|
diff --git a/tests/unit/s3-driver.spec.js b/tests/unit/s3-driver.spec.js
index <HASH>..<HASH> 100644
--- a/tests/unit/s3-driver.spec.js
+++ b/tests/unit/s3-driver.spec.js
@@ -29,6 +29,7 @@ const config = {
bucket: process.env.SES_BUCKET,
region: process.env.SES_REGION
}
+console.log(config)
test.group('S3 Driver', () => {
test('return false when file doesn\'t exists', async (assert) => {
|
ci(travis): log config
|
Slynova-Org_flydrive
|
train
|
js
|
1812ac9288e41d05dcc4e36caecf4ed7ccb62576
|
diff --git a/pysrt/srttime.py b/pysrt/srttime.py
index <HASH>..<HASH> 100644
--- a/pysrt/srttime.py
+++ b/pysrt/srttime.py
@@ -86,12 +86,14 @@ class SubRipTime(Comparable):
def __iadd__(self, other):
self.ordinal += self._coerce(other).ordinal
+ return self
def __sub__(self, other):
return self.from_ordinal(self.ordinal - self._coerce(other).ordinal)
def __isub__(self, other):
self.ordinal -= self._coerce(other).ordinal
+ return self
@classmethod
def _coerce(cls, other):
|
fix: iadd and isub for SubRipTime
|
byroot_pysrt
|
train
|
py
|
156c3082397952b1958c5bc8aeff37ced9889594
|
diff --git a/src/geshi/vb.php b/src/geshi/vb.php
index <HASH>..<HASH> 100644
--- a/src/geshi/vb.php
+++ b/src/geshi/vb.php
@@ -45,7 +45,7 @@ $language_data = array (
'COMMENT_MULTI' => array(),
'COMMENT_REGEXP' => array(
// Comments (either single or multiline with _
- 1 => '/\'.*[^_]\n/sU',
+ 1 => '/\'.*(?<! _)\n/sU',
),
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
'QUOTEMARKS' => array('"'),
|
fix: must be " _" i.e. with whitespace
|
GeSHi_geshi-1.0
|
train
|
php
|
9dff89249a3be7f39c0d2a8cc3a3eccc2d9415b7
|
diff --git a/src/utils/http-browser.js b/src/utils/http-browser.js
index <HASH>..<HASH> 100644
--- a/src/utils/http-browser.js
+++ b/src/utils/http-browser.js
@@ -19,12 +19,17 @@ export async function http ({
res.body && res.body.getReader
? fromStream(res.body)
: [new Uint8Array(await res.arrayBuffer())]
+ // convert Header object to ordinary JSON
+ headers = {}
+ for (let [key, value] of res.headers.entries()) {
+ headers[key] = value
+ }
return {
url: res.url,
method: res.method,
statusCode: res.status,
statusMessage: res.statusText,
body: iter,
- headers: res.headers
+ headers: headers
}
}
|
fix: the `headers` returned by the HTTP plugin should be JSON objects
|
isomorphic-git_isomorphic-git
|
train
|
js
|
f23a05d6120aa1d52e87bfb44fbd9905b363dee2
|
diff --git a/packages/input-checkbox/src/Checkbox.story.js b/packages/input-checkbox/src/Checkbox.story.js
index <HASH>..<HASH> 100644
--- a/packages/input-checkbox/src/Checkbox.story.js
+++ b/packages/input-checkbox/src/Checkbox.story.js
@@ -31,7 +31,13 @@ storiesOf("Checkbox Input", "module")
withInfo()(() => (
<fieldset>
<Checkbox label="Checkbox Label 1" name="foo" />
- <Checkbox disabled label="Checkbox Label 2" name="foo" />
+ <Checkbox disabled label="Disabled Checkbox" name="foo" />
+ <Checkbox
+ checked
+ disabled
+ label="Checked Disabled Checkbox"
+ name="foo"
+ />
<Checkbox label="Checkbox Label 3" name="foo" />
<div style={{ marginTop: 24 }}>
<label>
|
test(stories): add a disabled checked checkbox to the fieldset example
affects: @crave/farmblocks-input-checkbox
|
CraveFood_farmblocks
|
train
|
js
|
b085f8a9e0ad8d0895537e1866f63d58d6005741
|
diff --git a/src/Lucid/Relations/Parser.js b/src/Lucid/Relations/Parser.js
index <HASH>..<HASH> 100644
--- a/src/Lucid/Relations/Parser.js
+++ b/src/Lucid/Relations/Parser.js
@@ -30,9 +30,13 @@ class RelationParser {
* @return {Object}
*/
_normalizeRelations (relations) {
- return !Array.isArray(relations)
- ? relations
- : _.zipObject(relations, _.fill(new Array(relations.length), null))
+ if (!Array.isArray(relations)) {
+ return relations
+ }
+
+ return _.transform(relations, (result, relation) => {
+ return (result[relation] = null)
+ }, {})
}
/**
|
fix(relations): changed method _normalizeRelations
|
adonisjs_adonis-lucid
|
train
|
js
|
dc03060de299cb778c1a0f040c4c77dec1550181
|
diff --git a/test/test_specification.rb b/test/test_specification.rb
index <HASH>..<HASH> 100644
--- a/test/test_specification.rb
+++ b/test/test_specification.rb
@@ -66,5 +66,15 @@ module ParseGemspec
ParseGemspec::Specification.load(gemspec_path)
end
end
+ test 'not gemspec file' do
+ not_gemspec_file = File.join(
+ 'checkstyle_filter-git-1.0.2',
+ 'Gemfile'
+ )
+ not_gemspec_path = File.join(fixture_path, not_gemspec_file)
+ assert_raise(ParseGemspecError) do
+ ParseGemspec::Specification.load(not_gemspec_path)
+ end
+ end
end
end
|
test(load): not gemspec file
|
packsaddle_ruby-parse_gemspec
|
train
|
rb
|
4dc2671c8262bc9876ec71263cf8ac24f9655f75
|
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -74,12 +74,12 @@ export const sessionStoreBuilder = () => ({
})
},
switchOrganization({ state, commit, dispatch }, organizationId) {
- if (organizationId) this.cookies.set(`${state.cookieName}_org`, organizationId, { domain: state.cookieDomain })
+ if (organizationId) this.cookies.set(`${state.cookieName}_org`, organizationId, { domain: state.cookieDomain, path: '/' })
else this.cookies.remove(`${state.cookieName}_org`)
dispatch('readCookie')
},
setAdminMode({ state, commit, dispatch }, adminMode) {
- if (adminMode) this.cookies.set(`${state.cookieName}_admin`, 'true', { domain: state.cookieDomain })
+ if (adminMode) this.cookies.set(`${state.cookieName}_admin`, 'true', { domain: state.cookieDomain, path: '/' })
else this.cookies.remove(`${state.cookieName}_admin`)
dispatch('readCookie')
},
|
fix: set path / for admin and org cookies
|
koumoul-dev_sd-vue
|
train
|
js
|
0684fa6d6bf640a7d476839c80660a987c27d525
|
diff --git a/Model/EventRepository.php b/Model/EventRepository.php
index <HASH>..<HASH> 100644
--- a/Model/EventRepository.php
+++ b/Model/EventRepository.php
@@ -87,7 +87,9 @@ class EventRepository implements EventRepositoryInterface
return (bool)$this->eventResourceModel->getConnection()->fetchOne(
sprintf(
"SELECT (SELECT COALESCE(MAX(event_id), %d) FROM %s) < %d;",
- (int)$sinceId, $eventsTableName, (int)$sinceId
+ (int)$sinceId,
+ $eventsTableName,
+ (int)$sinceId
)
);
}
|
fix(code-style): build fix CDP-<I>
|
emartech_magento2-extension
|
train
|
php
|
692166d51811d96fc89c20e4dbb7e80579fc4172
|
diff --git a/lib/inspectors/res.js b/lib/inspectors/res.js
index <HASH>..<HASH> 100644
--- a/lib/inspectors/res.js
+++ b/lib/inspectors/res.js
@@ -373,9 +373,15 @@ module.exports = function(req, res, next) {
Object.keys(deleteHeaders.reqHeaders).forEach(function(prop) {
delete headers[prop];
});
-
+ var isDelete = options.method === 'DELETE' && options.headers['content-length'] == null;
+ if (isDelete) {
+ delete options.headers['transfer-encoding'];
+ }
options.headers = formatHeaders(options.headers, req.rawHeaderNames);
delete headers[config.WEBUI_HEAD];
+ if (isDelete) {
+ options.headers['Transfer-Encoding'] = 'chunked';
+ }
_request();
}
}, req.pluginRules, req.rulesFileMgr, req.headerRulesMgr);
|
refactor: support delete request to transfer request body
|
avwo_whistle
|
train
|
js
|
8e89c3c7f6aa0b780ceefc3f035cd600b841779c
|
diff --git a/js/src/forum/utils/getMentionText.js b/js/src/forum/utils/getMentionText.js
index <HASH>..<HASH> 100644
--- a/js/src/forum/utils/getMentionText.js
+++ b/js/src/forum/utils/getMentionText.js
@@ -27,7 +27,7 @@ export default function getMentionText(user, postId) {
}
// @"Display name"#UserID
const cleanText = getCleanDisplayName(user);
- return `@"${cleanText}"${user.id()}`;
+ return `@"${cleanText}"#${user.id()}`;
} else {
// @"Display name"#pPostID
const cleanText = getCleanDisplayName(user);
|
fix: Missing `#` from autocompleted user mention format (#<I>)
|
flarum_mentions
|
train
|
js
|
ee5cb49176ebcdf7bb816b58fdfe0181bd0b5fa3
|
diff --git a/src/Presentation.js b/src/Presentation.js
index <HASH>..<HASH> 100644
--- a/src/Presentation.js
+++ b/src/Presentation.js
@@ -1,9 +1,18 @@
+import keypress from 'keypress';
+
import { Slide } from './Slide';
+import { Cursor } from './Cursor';
export class Presentation {
constructor() {
this._slides = [];
this._currentSlideIndex = 0;
+ this._cursor = new Cursor([process.stdout], [process.stdin]);
+
+ keypress(process.stdin);
+
+ process.stdin.setRawMode(true);
+ process.stdin.setEncoding('utf8');
}
/**
|
refactor(presentation): Move cursor functionality to presentation
|
ghaiklor_kittik
|
train
|
js
|
077892645bd59d1b5c50e3291701cb4241c0bbdf
|
diff --git a/src/managers/GuildManager.js b/src/managers/GuildManager.js
index <HASH>..<HASH> 100644
--- a/src/managers/GuildManager.js
+++ b/src/managers/GuildManager.js
@@ -175,15 +175,15 @@ class GuildManager extends BaseManager {
delete channel.parentID;
if (!channel.permissionOverwrites) continue;
for (const overwrite of channel.permissionOverwrites) {
- if (overwrite.allow) overwrite.allow = Permissions.resolve(overwrite.allow);
- if (overwrite.deny) overwrite.deny = Permissions.resolve(overwrite.deny);
+ if (overwrite.allow) overwrite.allow = Permissions.resolve(overwrite.allow).toString();
+ if (overwrite.deny) overwrite.deny = Permissions.resolve(overwrite.deny).toString();
}
channel.permission_overwrites = channel.permissionOverwrites;
delete channel.permissionOverwrites;
}
for (const role of roles) {
if (role.color) role.color = resolveColor(role.color);
- if (role.permissions) role.permissions = Permissions.resolve(role.permissions);
+ if (role.permissions) role.permissions = Permissions.resolve(role.permissions).toString();
}
return new Promise((resolve, reject) =>
this.client.api.guilds
|
fix(GuildManager): add missing toString() on Permission#resolve fns (#<I>)
|
discordjs_discord.js
|
train
|
js
|
e0c0c9fe99d6b6fc08103625b472e5b4ebb5d4a6
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -63,10 +63,8 @@ function duplex (reader, read) {
cbs.push(cb)
if (needDrain) {
- next(function () {
- s.emit('drain')
- needDrain = false
- })
+ needDrain = false
+ s.emit('drain')
}
}
}
|
fix: emit drain event immediately, with safe state transition
|
pull-stream_pull-stream-to-stream
|
train
|
js
|
55e1c3ca56a208df40b812050707b2d896f8abcb
|
diff --git a/packages/@vue/cli-service/generator/index.js b/packages/@vue/cli-service/generator/index.js
index <HASH>..<HASH> 100644
--- a/packages/@vue/cli-service/generator/index.js
+++ b/packages/@vue/cli-service/generator/index.js
@@ -41,7 +41,7 @@ module.exports = (api, options) => {
},
less: {
'less': '^3.0.4',
- 'less-loader': '^4.1.0'
+ 'less-loader': '^5.0.0'
},
stylus: {
'stylus': '^0.54.5',
|
feat: bump default less-loader version (#<I>)
Resolves #<I>
|
vuejs_vue-cli
|
train
|
js
|
80f703dc2e255a30c17d7f8daa796b30a55b8bed
|
diff --git a/lib/light-service/context.rb b/lib/light-service/context.rb
index <HASH>..<HASH> 100644
--- a/lib/light-service/context.rb
+++ b/lib/light-service/context.rb
@@ -115,9 +115,9 @@ module LightService
end
def define_accessor_methods_for_keys(keys)
- return if keys.nil?
+ return if keys.blank?
- keys.each do |key|
+ Array(keys).each do |key|
next if respond_to?(key.to_sym)
define_singleton_method(key.to_s) { fetch(key) }
|
refactor: Context#define_accessor_methods_for_keys can accept single values or lists
|
adomokos_light-service
|
train
|
rb
|
5e1b22818b12b5e874c3ca49c30f08ce75e440fd
|
diff --git a/example/hello.js b/example/hello.js
index <HASH>..<HASH> 100755
--- a/example/hello.js
+++ b/example/hello.js
@@ -59,7 +59,7 @@ myApp.config(function($stateProvider) {
myApp.run(function($http, $rootScope, $uiRouter) {
- var Visualizer = window['ui-router-visualizer'].Visualizer;
+ var Visualizer = window['@uirouter/visualizer'].Visualizer;
var visPlugin = $uiRouter.plugin(Visualizer);
$http.get('data/people.json', { cache: true });
|
fix(example): use window['@uirouter/visualizer']
|
ui-router_visualizer
|
train
|
js
|
2bb643af5824b46128314ce0662732c764411667
|
diff --git a/test/unit/chunked-uploads.js b/test/unit/chunked-uploads.js
index <HASH>..<HASH> 100644
--- a/test/unit/chunked-uploads.js
+++ b/test/unit/chunked-uploads.js
@@ -247,7 +247,7 @@ if (qqtest.canDownloadFileAsBlob) {
});
describe("resume feature tests", function() {
- var nativeLocalStorage = window.localStorage;
+ var nativeLocalStorageSetItem = window.localStorage.setItem;
beforeEach(function() {
window.localStorage.setItem = function() {
@@ -256,7 +256,7 @@ if (qqtest.canDownloadFileAsBlob) {
});
afterEach(function() {
- window.localStorage = nativeLocalStorage;
+ window.localStorage.setItem = nativeLocalStorageSetItem;
});
it("ensures failure to use localStorage does not prevent uploading", function(done) {
|
test(resume): attempt to fix resume unit test
#<I>
|
FineUploader_fine-uploader
|
train
|
js
|
1f5915574781ee3f6e74d42cdd9b11dd1594fd96
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -82,6 +82,7 @@ HtmlWebpackInlineSourcePlugin.prototype.resolveSourceMaps = function (compilatio
HtmlWebpackInlineSourcePlugin.prototype.processTag = function (compilation, regex, tag, filename) {
var assetUrl;
+ var preTag = tag;
// inline js
if (tag.tagName === 'script' && tag.attributes && regex.test(tag.attributes.src)) {
@@ -115,8 +116,12 @@ HtmlWebpackInlineSourcePlugin.prototype.processTag = function (compilation, rege
}
var assetName = path.posix.relative(publicUrlPrefix, assetUrl);
var asset = getAssetByName(compilation.assets, assetName);
- var updatedSource = this.resolveSourceMaps(compilation, assetName, asset);
- tag.innerHTML = (tag.tagName === 'script') ? updatedSource.replace(/(<)(\/script>)/g, '\\x3C$2') : updatedSource;
+ if (compilation.assets[assetName] !== undefined) {
+ var updatedSource = this.resolveSourceMaps(compilation, assetName, asset);
+ tag.innerHTML = (tag.tagName === 'script') ? updatedSource.replace(/(<)(\/script>)/g, '\\x3C$2') : updatedSource;
+ }else{
+ return preTag;
+ }
}
return tag;
|
fix: close #<I>, 'source' undefined
When the ConcatSource Object is css file chunk or javascript file chunk, the 'source' property is undefined. Then, it should return original 'tag'
|
DustinJackson_html-webpack-inline-source-plugin
|
train
|
js
|
9694ec300020cb6c194eeb14c9521b3c5f31b4dd
|
diff --git a/tests/test_hg.py b/tests/test_hg.py
index <HASH>..<HASH> 100644
--- a/tests/test_hg.py
+++ b/tests/test_hg.py
@@ -40,7 +40,7 @@ def test_repo_mercurial(tmpdir, parentdir, hg_remote):
}
)
- run(['hg', 'init', mercurial_repo.name], cwd=str(tmpdir))
+ run(['hg', 'init', mercurial_repo.repo_name], cwd=str(tmpdir))
mercurial_repo.update_repo()
|
ci(hg): Update test to use repo_name
|
vcs-python_libvcs
|
train
|
py
|
9ba4f473676a94605f6e14755c7d453fa4705bce
|
diff --git a/src/scripts/ngTableController.js b/src/scripts/ngTableController.js
index <HASH>..<HASH> 100644
--- a/src/scripts/ngTableController.js
+++ b/src/scripts/ngTableController.js
@@ -184,7 +184,7 @@
$scope.show_filter = value;
});
} else {
- $scope.$watch(hasFilterColumn, function(value){
+ $scope.$watch(hasVisibleFilterColumn, function(value){
$scope.show_filter = value;
})
}
@@ -222,11 +222,11 @@
});
}
- function hasFilterColumn(){
+ function hasVisibleFilterColumn(){
if (!$scope.$columns) return false;
return some($scope.$columns, function($column){
- return $column.filter($scope);
+ return $column.show($scope) && $column.filter($scope);
});
}
|
fix(ngTableController): should not show filter row when all filterable columns are hidden
|
esvit_ng-table
|
train
|
js
|
87ea3ada89375558afab342b3ccbf89f37ffb44e
|
diff --git a/views/js/qtiCreator/widgets/component/minMax/minMax.js b/views/js/qtiCreator/widgets/component/minMax/minMax.js
index <HASH>..<HASH> 100644
--- a/views/js/qtiCreator/widgets/component/minMax/minMax.js
+++ b/views/js/qtiCreator/widgets/component/minMax/minMax.js
@@ -348,6 +348,9 @@ define([
if(fromField === fields.min && minValue > maxValue){
this.setMaxValue(minValue);
}
+ } else if (minValue === 0 && maxValue > 0) {
+ this.enableField(fields.min, 1);
+ this.setMinValue(maxValue);
}
}
return this;
|
feat: Add validation to enable field and set min value
|
oat-sa_extension-tao-itemqti
|
train
|
js
|
e0409c90baa76c493d225926db2c46a1fcd45959
|
diff --git a/lib/cmds/aws/delete-test-bundle.js b/lib/cmds/aws/delete-test-bundle.js
index <HASH>..<HASH> 100644
--- a/lib/cmds/aws/delete-test-bundle.js
+++ b/lib/cmds/aws/delete-test-bundle.js
@@ -25,7 +25,7 @@ class DeleteTestBundleCommand extends Command {
}
if (Pro) {
- DeleteTestBundleCommand.description = Pro.oclif.createTestBundle.description;
+ DeleteTestBundleCommand.description = Pro.oclif.deleteTestBundle.description;
DeleteTestBundleCommand.flags = Pro.oclif.deleteTestBundle.flags;
DeleteTestBundleCommand.args = Pro.oclif.deleteTestBundle.args;
} else {
|
fix: delete-test-bundle command description
|
artilleryio_artillery
|
train
|
js
|
6fa9cd03166fd471c8b6cdcc0e5855d0ba68635b
|
diff --git a/packages/optimizely-sdk/lib/core/optimizely_config/index.js b/packages/optimizely-sdk/lib/core/optimizely_config/index.js
index <HASH>..<HASH> 100644
--- a/packages/optimizely-sdk/lib/core/optimizely_config/index.js
+++ b/packages/optimizely-sdk/lib/core/optimizely_config/index.js
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+var projectConfig = require('../project_config');
// Get Experiment Ids which are part of rollouts
function getRolloutExperimentIds(rollouts) {
@@ -41,9 +42,11 @@ function getExperimentsMap(configObj) {
variations[variation.key] = {
id: variation.id,
key: variation.key,
- featureEnabled: variation.featureEnabled,
variablesMap: getMergedVariablesMap(configObj, variation, experiment.id, featureVariablesMap)
};
+ if (projectConfig.isFeatureExperiment(configObj, experiment.id)) {
+ variations[variation.key].featureEnabled = variation.featureEnabled;
+ }
return variations;
}, {}),
};
|
fix: feature enabled will now only be available when experiment is feature experiment (#<I>)
OptimizelyConfig was using featureEnabled directly from projectConfig Object without verifying if experiment is feature experiment or not. Now featureEnabled key on variation will only be available if experiment is a feature experiment.
|
optimizely_javascript-sdk
|
train
|
js
|
01c7eaa3792f01df518422c0d78ce025e6f26ee7
|
diff --git a/master/buildbot/test/unit/test_steps_http.py b/master/buildbot/test/unit/test_steps_http.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/test/unit/test_steps_http.py
+++ b/master/buildbot/test/unit/test_steps_http.py
@@ -13,8 +13,6 @@
#
# Copyright Buildbot Team Members
-import collections
-
import mock
from twisted.internet import defer
@@ -177,17 +175,14 @@ OK'''.format(self.get_connection_string())
def test_post_data_dict(self):
url = self.getURL("path")
- # make sure the order of keys is stable
- data = collections.OrderedDict([('key1', 'value1'), ('key2', 'value2')])
-
- self.setupStep(http.POST(url, data=data))
+ self.setupStep(http.POST(url, data={'key1': 'value1'}))
self.expectOutcome(result=SUCCESS, state_string="Status code: 200")
self.expectLogfile('log', '''\
URL: {}
Status: 200
------ Content ------
-OK:key1=value1&key2=value2'''.format(url))
- self.expectLogfile('content', "OK:key1=value1&key2=value2")
+OK:key1=value1'''.format(url))
+ self.expectLogfile('content', "OK:key1=value1")
return self.runStep()
def test_header(self):
|
test: Fix stability of HTTP step test_post_data_dict test
|
buildbot_buildbot
|
train
|
py
|
4ed4bec58dc72d5c232f47c4201dab4812e7b8ce
|
diff --git a/vyper/compile_lll.py b/vyper/compile_lll.py
index <HASH>..<HASH> 100644
--- a/vyper/compile_lll.py
+++ b/vyper/compile_lll.py
@@ -510,7 +510,7 @@ def assembly_to_evm(assembly, start_pos=0):
# to avoid unnecessary bytecode bloat.
i = 0
while i < len(assembly) - 1:
- if assembly[i] in ("JUMP", "STOP", "REVERT") and not (
+ if assembly[i] in ("JUMP", "RETURN", "REVERT", "STOP") and not (
is_symbol(assembly[i + 1]) or assembly[i + 1] == "JUMPDEST"
):
del assembly[i + 1]
|
fix: add RETURN when looking for unreachable code
|
ethereum_vyper
|
train
|
py
|
d924aa898ae5e279b8313d566faabcaa4c222f3c
|
diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -193,6 +193,10 @@ gulp.task('index', () => {
// codes.push(`import {position} from './moveWrapper/position';`);
// components.push('position');
+ // sort
+ codes.sort((a, b) => a > b ? 1 : -1);
+ components.sort((a, b) => a > b ? 1 : -1);
+
codes.push('', `export {\n ${components.join(',\n ')}\n};`);
codes.push('', `export const version = '${packageJson.version}';`);
const path = './components/index.js';
|
chore: sort codes of index.js to keep order
|
ksc-fe_kpc
|
train
|
js
|
16493e65fd3e2b9a49afbdd58603bd43f3a4005a
|
diff --git a/src/util/DataResolver.js b/src/util/DataResolver.js
index <HASH>..<HASH> 100644
--- a/src/util/DataResolver.js
+++ b/src/util/DataResolver.js
@@ -90,7 +90,8 @@ class DataResolver extends null {
* Data that can be resolved to give a Buffer. This can be:
* * A Buffer
* * The path to a local file
- * * A URL
+ * * A URL <warn>When provided a URL, discord.js will fetch the URL internally in order to create a Buffer.
+ * This can pose a security risk when the URL has not been sanitized</warn>
* @typedef {string|Buffer} BufferResolvable
*/
|
docs(BufferResolvable): add warning for URL input (#<I>)
|
discordjs_discord.js
|
train
|
js
|
c779b79c36d451c98e4732d20d4f28cf94db269b
|
diff --git a/js/src/forum/utils/getCleanDisplayName.js b/js/src/forum/utils/getCleanDisplayName.js
index <HASH>..<HASH> 100644
--- a/js/src/forum/utils/getCleanDisplayName.js
+++ b/js/src/forum/utils/getCleanDisplayName.js
@@ -1,3 +1,5 @@
+import extractText from 'flarum/common/utils/extractText';
+
/**
* Whether to use the old mentions format.
*
@@ -5,7 +7,7 @@
*/
export const shouldUseOldFormat = () => app.forum.attribute('allowUsernameMentionFormat') || false;
-const getDeletedUserText = () => app.translator.trans('core.lib.username.deleted_text');
+const getDeletedUserText = () => extractText(app.translator.trans('core.lib.username.deleted_text'));
/**
* Fetches a user's username or display name.
|
fix: Cannot reply to posts by deleted authors (#<I>)
|
flarum_mentions
|
train
|
js
|
df61fa3303ef943e2c7744d3489d47d159e93e1c
|
diff --git a/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/controllers/group/view/MembersAdapter.java b/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/controllers/group/view/MembersAdapter.java
index <HASH>..<HASH> 100644
--- a/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/controllers/group/view/MembersAdapter.java
+++ b/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/controllers/group/view/MembersAdapter.java
@@ -99,16 +99,10 @@ public class MembersAdapter extends HolderAdapter<GroupMember> {
callback.onLoaded();
}
}
- rawMembers.clear();
- rawMembers.addAll(groupMembersSlice.getUids());
nextMembers = groupMembersSlice.getNext();
loaddedToEnd = nextMembers == null;
- ArrayList<GroupMember> nMembers = new ArrayList<>();
- for (Integer uid : rawMembers) {
- nMembers.add(new GroupMember(uid, 0, 0, false));
- }
loadInProgress = false;
- setMembers(nMembers, false);
+ setMembers(groupMembersSlice.getMembers(), false);
});
}
}
|
fix(android): Fixing member loading
|
actorapp_actor-platform
|
train
|
java
|
27edbb00d343e87d02dd1709ded2d483cc9ca178
|
diff --git a/src/Auditable.php b/src/Auditable.php
index <HASH>..<HASH> 100644
--- a/src/Auditable.php
+++ b/src/Auditable.php
@@ -463,7 +463,7 @@ trait Auditable
*/
public function transitionTo(Contracts\Audit $audit, bool $old = false): Contracts\Auditable
{
- // The Audit must be for this Auditable model of this type
+ // The Audit must be for an Auditable model of this type
if ($this->getMorphClass() !== $audit->auditable_type) {
throw new AuditableTransitionException(sprintf(
'Expected Auditable type %s, got %s instead',
|
chore(Auditable): wording
|
owen-it_laravel-auditing
|
train
|
php
|
2c5f70d4203a1a777981d616d1d3605ad282cb7a
|
diff --git a/src/migrations/20211202120808-add-custom-roles.js b/src/migrations/20211202120808-add-custom-roles.js
index <HASH>..<HASH> 100644
--- a/src/migrations/20211202120808-add-custom-roles.js
+++ b/src/migrations/20211202120808-add-custom-roles.js
@@ -199,6 +199,8 @@ exports.down = function (db, cb) {
ALTER TABLE role_permission
ADD COLUMN project TEXT,
ADD COLUMN permission TEXT;
+
+ DROP TABLE permissions;
`,
cb,
);
|
refactor: drop permissions table on down migration (#<I>)
|
Unleash_unleash
|
train
|
js
|
194601b9d63f291129dae1091d017fa36b19cec5
|
diff --git a/src/components/Dropdown/DropdownMenu.react.js b/src/components/Dropdown/DropdownMenu.react.js
index <HASH>..<HASH> 100644
--- a/src/components/Dropdown/DropdownMenu.react.js
+++ b/src/components/Dropdown/DropdownMenu.react.js
@@ -27,7 +27,7 @@ export type Props = {|
/**
* Show the DropdownMenu
*/
- +show?: boolean,
+ show?: boolean,
|};
/**
|
refactor(DropdownMenu): Show prop should not be readonly
|
tabler_tabler-react
|
train
|
js
|
79ce3425be68241d6604deef748a18f0e37811ab
|
diff --git a/src/components/Wizard/WizardContents.js b/src/components/Wizard/WizardContents.js
index <HASH>..<HASH> 100644
--- a/src/components/Wizard/WizardContents.js
+++ b/src/components/Wizard/WizardContents.js
@@ -39,14 +39,16 @@ WizardContents.propTypes = {
/** The wizard step index for these contents */
stepIndex: PropTypes.number.isRequired,
/** The wizard sub step index for these contents */
- subStepIndex: PropTypes.number.isRequired,
+ subStepIndex: PropTypes.number,
/** The active wizard step index */
activeStepIndex: PropTypes.number.isRequired,
/** The active wizard sub step index */
- activeSubStepIndex: PropTypes.number.isRequired
+ activeSubStepIndex: PropTypes.number
};
WizardContents.defaultProps = {
children: null,
- className: ''
+ className: '',
+ subStepIndex: null,
+ activeSubStepIndex: null
};
export default WizardContents;
|
fix(wizard): fix wizard contents default props (#<I>)
|
patternfly_patternfly-react
|
train
|
js
|
e64a14ef8ff7165abee4a7a8ad67bb2f888ae876
|
diff --git a/bin/ember-template-lint.js b/bin/ember-template-lint.js
index <HASH>..<HASH> 100755
--- a/bin/ember-template-lint.js
+++ b/bin/ember-template-lint.js
@@ -67,7 +67,12 @@ function getRelativeFilePaths() {
var relativeFilePaths = fileArgs
.reduce((filePaths, fileArg) => {
- return filePaths.concat(globby.sync(fileArg, { gitignore: true }));
+ return filePaths.concat(
+ globby.sync(fileArg, {
+ ignore: ['**/dist/**', '**/tmp/**', '**/node_modules/**'],
+ gitignore: true,
+ })
+ );
}, [])
.filter(filePath => filePath.slice(-4) === '.hbs');
|
fix: always ignore dist, tmp, node_modules by default.
|
ember-template-lint_ember-template-lint
|
train
|
js
|
21b4ea4ddf6b31fd35a1d06c9b4c4416e7d76bc4
|
diff --git a/httprunner/api.py b/httprunner/api.py
index <HASH>..<HASH> 100644
--- a/httprunner/api.py
+++ b/httprunner/api.py
@@ -200,6 +200,10 @@ class HttpRunner(object):
logger.log_warning("parse failures occurred ...")
utils.dump_logs(parse_failed_testfiles, project_mapping, "parse_failed")
+ if len(parsed_testcases) == 0:
+ logger.log_error("failed to parse all cases, abort.")
+ raise exceptions.ParseTestsFailure
+
if self.save_tests:
utils.dump_logs(parsed_testcases, project_mapping, "parsed")
diff --git a/httprunner/exceptions.py b/httprunner/exceptions.py
index <HASH>..<HASH> 100644
--- a/httprunner/exceptions.py
+++ b/httprunner/exceptions.py
@@ -11,6 +11,10 @@ class MyBaseFailure(Exception):
pass
+class ParseTestsFailure(MyBaseFailure):
+ pass
+
+
class ValidationFailure(MyBaseFailure):
pass
|
fix: abort test when failed to parse all cases
|
HttpRunner_HttpRunner
|
train
|
py,py
|
9c54c99bca0a7deb00a13199b9c9713802296b1f
|
diff --git a/components/sdk-get/sdk-get.js b/components/sdk-get/sdk-get.js
index <HASH>..<HASH> 100644
--- a/components/sdk-get/sdk-get.js
+++ b/components/sdk-get/sdk-get.js
@@ -48,6 +48,8 @@ export class SdkGet extends React.Component {
onError: this.props.onError,
});
}
+
+ // eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps) {
if (
nextProps.shouldRefetch(
|
refactor: disable eslint camcelcase for all unsafe lifeycle methods
|
commercetools_merchant-center-application-kit
|
train
|
js
|
50ea7aaa5b22fc7269ec73bf269abfcf6f35b657
|
diff --git a/src/network.js b/src/network.js
index <HASH>..<HASH> 100644
--- a/src/network.js
+++ b/src/network.js
@@ -79,6 +79,10 @@ class Network extends EventEmitter {
* @param {AbortSignal} [options.signal]
*/
async * sendRequest (to, msg, options = {}) {
+ if (!this._running) {
+ return
+ }
+
this._log('sending %s to %p', MESSAGE_TYPE_LOOKUP[msg.type], to)
try {
@@ -111,6 +115,10 @@ class Network extends EventEmitter {
* @param {AbortSignal} [options.signal]
*/
async * sendMessage (to, msg, options = {}) {
+ if (!this._running) {
+ return
+ }
+
this._log('sending %s to %p', MESSAGE_TYPE_LOOKUP[msg.type], to)
yield dialingPeerEvent({ peer: to })
|
fix: do not send messages if the network is not running (#<I>)
Otherwise we can end up dialing a node during libp2p shut down
|
libp2p_js-libp2p-kad-dht
|
train
|
js
|
29d5fd163c62ff03aa642f111972914fdeed3669
|
diff --git a/src/util/Constants.js b/src/util/Constants.js
index <HASH>..<HASH> 100644
--- a/src/util/Constants.js
+++ b/src/util/Constants.js
@@ -945,7 +945,7 @@ exports.ApplicationCommandPermissionTypes = createEnum([null, 'ROLE', 'USER']);
* * APPLICATION_COMMAND
* * MESSAGE_COMPONENT
* @typedef {string} InteractionType
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-request-type}
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type}
*/
exports.InteractionTypes = createEnum([null, 'PING', 'APPLICATION_COMMAND', 'MESSAGE_COMPONENT']);
|
docs(Constants): Fix interaction type link (#<I>)
|
discordjs_discord.js
|
train
|
js
|
00c0526417444d4cbf33c9b79fc6d6d08100381d
|
diff --git a/packages/mdc-menu/addon/mixins/menu-item.js b/packages/mdc-menu/addon/mixins/menu-item.js
index <HASH>..<HASH> 100644
--- a/packages/mdc-menu/addon/mixins/menu-item.js
+++ b/packages/mdc-menu/addon/mixins/menu-item.js
@@ -3,7 +3,10 @@ import ListItem from 'ember-cli-mdc-list/mixins/list-item';
export default Mixin.create (ListItem, {
classNames: ['mdc-menu-item'],
- classNameBindings: ['selected:mdc-menu-item--selected'],
+
+ classNameBindings: [
+ 'selected:mdc-menu-item--selected'
+ ],
selected: false,
|
chore: refactored code
|
onehilltech_ember-cli-mdc
|
train
|
js
|
77e45729651eda118ec232c0adf603171d7686b0
|
diff --git a/src/util/dom.js b/src/util/dom.js
index <HASH>..<HASH> 100644
--- a/src/util/dom.js
+++ b/src/util/dom.js
@@ -5,9 +5,9 @@
export const domArray = (target, document) => {
if (typeof target === 'string') return Array.from(document.querySelectorAll(target))
if (target.tagName) return [target]
- if (target.jquery) return target.toArray()
if (Array.isArray(target)) return target
- return []
+ // Support NodeList and jQuery arrays
+ return Array.from(target)
}
/**
@@ -18,6 +18,7 @@ export const domArray = (target, document) => {
export const domSelector = (target, document) => {
if (typeof target === 'string') return document.querySelector(target)
if (target.tagName) return target
- if (target.jquery) return target[0]
+ // Support NodeList and jQuery arrays
+ if (target[0]) return target[0]
return target
}
|
fix: Support NodeList entries in domArray helper
|
livingdocsIO_editable.js
|
train
|
js
|
88f2fbe3e8263dc79b35cb22b1c0a61b24abde96
|
diff --git a/src/main/java/net/emaze/dysfunctional/multiplexing/CyclicIterator.java b/src/main/java/net/emaze/dysfunctional/multiplexing/CyclicIterator.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/emaze/dysfunctional/multiplexing/CyclicIterator.java
+++ b/src/main/java/net/emaze/dysfunctional/multiplexing/CyclicIterator.java
@@ -10,7 +10,7 @@ import net.emaze.dysfunctional.iterations.ReadOnlyIterator;
* A cyclic iterator. The given iterator is iterated indefinitely.
*
* @param <E> the element type
- * @author mcodella, asturman
+ * @author mcodella, asturman, rferranti
*/
public class CyclicIterator<E> extends ReadOnlyIterator<E> {
@@ -19,13 +19,12 @@ public class CyclicIterator<E> extends ReadOnlyIterator<E> {
public CyclicIterator(Iterator<E> source) {
dbc.precondition(source != null, "source iterator cannot be null");
- dbc.precondition(source.hasNext(), "source iterator cannot be empty");
this.source = source;
}
@Override
public boolean hasNext() {
- return true;
+ return source.hasNext() || !memory.isEmpty();
}
@Override
|
fix: can now create an empty CyclicIterator
|
cybazeitalia_emaze-dysfunctional
|
train
|
java
|
2d2b5ee516a6a1fe764adc7fadf1cdc221f4a26b
|
diff --git a/coverage/blanket.js b/coverage/blanket.js
index <HASH>..<HASH> 100644
--- a/coverage/blanket.js
+++ b/coverage/blanket.js
@@ -1,3 +1,6 @@
require('blanket')({
- pattern: '/espower/lib/'
+ pattern: [
+ '/espower/index.js',
+ '/espower/lib/'
+ ]
});
|
chore(espower): add index.js to coverage statistics
|
power-assert-js_espower
|
train
|
js
|
da5a1e175b05a85813a737a0a698f3d648457752
|
diff --git a/dist/ng-describe.js b/dist/ng-describe.js
index <HASH>..<HASH> 100644
--- a/dist/ng-describe.js
+++ b/dist/ng-describe.js
@@ -3280,6 +3280,8 @@ if (String(/a/mig) !== '/a/gim') {
bdd.beforeEach(function checkEnvironment() {
la(check.object(root.angular), 'angular is undefined');
la(check.has(root.angular, 'mock'), 'angular.mock is undefined');
+ la(check.fn(root.angular.mock.module),
+ 'missing angular mock module fn, is running inside jasmine or mocha?');
});
bdd.beforeEach(function mockModules() {
diff --git a/src/ng-describe.js b/src/ng-describe.js
index <HASH>..<HASH> 100644
--- a/src/ng-describe.js
+++ b/src/ng-describe.js
@@ -274,6 +274,8 @@
bdd.beforeEach(function checkEnvironment() {
la(check.object(root.angular), 'angular is undefined');
la(check.has(root.angular, 'mock'), 'angular.mock is undefined');
+ la(check.fn(root.angular.mock.module),
+ 'missing angular mock module fn, is running inside jasmine or mocha?');
});
bdd.beforeEach(function mockModules() {
|
fix(mock): checking mocks.module function before running
|
kensho_ng-describe
|
train
|
js,js
|
2a96c858bfb8fa2e67e613e1a4892abddc102dbd
|
diff --git a/test/scripts/processors/asset.js b/test/scripts/processors/asset.js
index <HASH>..<HASH> 100644
--- a/test/scripts/processors/asset.js
+++ b/test/scripts/processors/asset.js
@@ -83,7 +83,28 @@ describe('asset', () => {
return asset.remove();
}).finally(() => fs.unlink(file.source));
});
+ it('asset - type: create (when source path is configed to parent directory)', () => {
+ const file = newFile({
+ path: '../../source/foo.jpg',
+ type: 'create',
+ renderable: false
+ });
+
+ return fs.writeFile(file.source, 'foo').then(() => process(file)).then(() => {
+ const id = '../source/foo.jpg'; // The id should a relative path,because the 'lib/models/assets.js' use asset path by joining base path with "_id" directly.
+ const asset = Asset.findById(id);
+
+ asset._id.should.eql(id);
+ asset.path.should.eql(file.path);
+ asset.modified.should.be.true;
+ asset.renderable.should.be.false;
+ return asset.remove();
+ }).finally(() => {
+ fs.unlink(file.source);
+ fs.rmdir(pathFn.dirname(file.source));
+ });
+ });
it('asset - type: update', () => {
const file = newFile({
path: 'foo.jpg',
|
test: add unit test for asset id
|
hexojs_hexo
|
train
|
js
|
ad0b356ae2b70fc99c63c631d670ae2ac4bdc0dc
|
diff --git a/lib/record-scenario.js b/lib/record-scenario.js
index <HASH>..<HASH> 100644
--- a/lib/record-scenario.js
+++ b/lib/record-scenario.js
@@ -14,13 +14,21 @@ async function recordScenario ({request, scenario}) {
if (Array.isArray(scenario)) {
// if scenario is an array of request options, send requests sequentially
await scenario.reduce(async (promise, step) => {
+ let response
+
try {
- await promise
+ response = await promise
} catch (error) {
// don’t fail on 4xx errors, they are valid fixtures
if (error.response.status >= 500) {
throw error
}
+
+ response = error.response
+ }
+
+ if (typeof step === 'function') {
+ return request(step(response))
}
return request(step)
|
feat(normalization): async normalization methods
|
octokit_fixtures
|
train
|
js
|
6ce9f3372b0a632b997301eba9914c30e9fa87ef
|
diff --git a/modules/utils.js b/modules/utils.js
index <HASH>..<HASH> 100755
--- a/modules/utils.js
+++ b/modules/utils.js
@@ -39,10 +39,8 @@ export function buildItemStack<Item>(
const defaultProps = ['component', 'render', 'pattern', 'exactly']
// Map all children
return Children.toArray(children).reduce((items, child) => {
- // child === <Match /> || child === <MatchCard />
const displayName = child.displayName || child.type.displayName || child.type.name
const isAdvancedMatch = matchComponent === displayName
- if (displayName !== 'Match' && !isAdvancedMatch) return items
// Build item
const item = Object.keys(child.props).reduce((props, key) => {
if (key === 'pattern') {
|
fix(Stack): accept non match component
|
winoteam_react-router-navigation
|
train
|
js
|
a509ba3825766f70767e44050232c23c3dd7c63c
|
diff --git a/src/createMixin.js b/src/createMixin.js
index <HASH>..<HASH> 100644
--- a/src/createMixin.js
+++ b/src/createMixin.js
@@ -6,20 +6,22 @@ export default GlobalEmitter => ({
created() {
this.$options.sockets = this.$options.sockets || {};
const { sockets } = this.$options;
+ const addListener = GlobalEmitter.addListener.bind(null, this);
+ const removeListenersByLabel = GlobalEmitter.removeListenersByLabel.bind(null, this);
Object.keys(sockets).forEach((key) => {
- GlobalEmitter.addListener(this, key, sockets[key]);
+ addListener(key, sockets[key]);
});
Object.defineProperties(this.$options.sockets, {
$subscribe: {
- value: (key, fn) => GlobalEmitter.addListener(this, key, fn),
+ value: addListener,
writable: false,
enumerable: false,
configurable: true,
},
$unsubscribe: {
- value: key => GlobalEmitter.removeListenersByLabel(this, key),
+ value: removeListenersByLabel,
writable: false,
enumerable: false,
configurable: true,
|
refactor: use partial application to refactor mixin
|
probil_vue-socket.io-extended
|
train
|
js
|
e56b1906d89ce14e065ed65b06be8904b7c46e9b
|
diff --git a/src/events/websocket/WebSocketServer.js b/src/events/websocket/WebSocketServer.js
index <HASH>..<HASH> 100644
--- a/src/events/websocket/WebSocketServer.js
+++ b/src/events/websocket/WebSocketServer.js
@@ -21,8 +21,8 @@ export default class WebSocketServer {
log.debug(`verifyClient:${key} ${connectionId}`)
- // Use the websocket key to correlate connection IDs
- this.#connectionIds[key] = connectionId
+ // use the websocket key to correlate connection IDs
+ this.#connectionIds.set(key, connectionId)
this.#webSocketClients
.verifyClient(connectionId, req)
@@ -47,7 +47,7 @@ export default class WebSocketServer {
const { headers } = request
const key = headers['sec-websocket-key']
- const connectionId = this.#connectionIds[key]
+ const connectionId = this.#connectionIds.get(key)
log.debug(`connect:${connectionId}`)
|
fix: getter/setter map
|
dherault_serverless-offline
|
train
|
js
|
7d3c9ee7055c7493838c675636d4b2d64310ee69
|
diff --git a/lib/components/places/StandaloneSearchBox.js b/lib/components/places/StandaloneSearchBox.js
index <HASH>..<HASH> 100644
--- a/lib/components/places/StandaloneSearchBox.js
+++ b/lib/components/places/StandaloneSearchBox.js
@@ -118,7 +118,9 @@ var SearchBox = (function(_React$PureComponent) {
/*
* @see https://developers.google.com/maps/documentation/javascript/3.exp/reference#SearchBox
*/
- var searchBox = new google.maps.places.SearchBox(element)
+ var searchBox = new google.maps.places.SearchBox(
+ element.querySelector("input") || element
+ )
;(0, _MapChildHelper.construct)(
SearchBox.propTypes,
updaterMap,
|
chore(lib): compile from src with `babel`
|
tomchentw_react-google-maps
|
train
|
js
|
2c67d7801bfa806426d698e7111cb8136d6cc38c
|
diff --git a/lib/components/Menu/index.js b/lib/components/Menu/index.js
index <HASH>..<HASH> 100644
--- a/lib/components/Menu/index.js
+++ b/lib/components/Menu/index.js
@@ -256,13 +256,6 @@ class Menu extends Component {
count++
- const {
- onSelect,
- onFocus,
- onBlur,
- ...childProps
- } = child.props
-
const ref = (c) => {
if (c) {
this._menuitems.push(c)
@@ -271,11 +264,11 @@ class Menu extends Component {
const props = {
controls: controls,
- ...childProps, // child 'controls' prop should override parent
+ ...child.props.controls, // child 'controls' prop should override parent
disabled: (disabled || child.props.disabled),
- onFocus: createChainedFunction(onFocus, this.handleItemFocus, this.props.onFocus),
- onBlur: createChainedFunction(onBlur, this.handleItemBlur, this.props.onBlur),
- onSelect: createChainedFunction(onSelect, this.props.onSelect),
+ onFocus: createChainedFunction(this.handleItemFocus, this.props.onFocus),
+ onBlur: createChainedFunction(this.handleItemBlur, this.props.onBlur),
+ onSelect: this.props.onSelect,
onMouseOver: this.handleMenuItemMouseOver
}
|
fix(Menu): MenuItem.onSelect is being fired twice
Regression from changes made in INSTUI-<I>
fixes INSTUI-<I>
Test plan:
Add an onSelect to any MenuItem in Menu example and verify it only logs
once
Change-Id: Iae<I>f<I>df9b3e<I>f8abfe<I>a<I>
Reviewed-on: <URL>
|
instructure_instructure-ui
|
train
|
js
|
1b2a31964345d0481d43cdd3028f9c4b484364cc
|
diff --git a/lib/manager/docker/update.js b/lib/manager/docker/update.js
index <HASH>..<HASH> 100644
--- a/lib/manager/docker/update.js
+++ b/lib/manager/docker/update.js
@@ -6,9 +6,9 @@ function setNewValue(currentFileContent, upgrade) {
try {
logger.debug(`setNewValue: ${upgrade.newFrom}`);
const oldLine = new RegExp(
- `(^|\n)${upgrade.fromPrefix}(\\s+)${upgrade.depName}.*?(\\s?)${
+ `(^|\\n)${upgrade.fromPrefix}(\\s+)${upgrade.depName}[^\\s]*(\\s?)${
upgrade.fromSuffix
- }\n`
+ }\\n`
);
let newLine = `$1${upgrade.fromPrefix}$2${upgrade.newFrom}$3`;
if (upgrade.fromSuffix.length) {
|
fix: use escaped line returns in docker regex escape
|
renovatebot_renovate
|
train
|
js
|
379308c3f0bfeab285de9ce7075a996de33ea5aa
|
diff --git a/packages/widget-chat/src/components/activity-item-post/index.js b/packages/widget-chat/src/components/activity-item-post/index.js
index <HASH>..<HASH> 100644
--- a/packages/widget-chat/src/components/activity-item-post/index.js
+++ b/packages/widget-chat/src/components/activity-item-post/index.js
@@ -41,7 +41,7 @@ export default function ActivityItemPost(props) {
let deleteAction;
if (isSelf) {
- deleteAction = <ActivityItemPostAction iconType={ICON_TYPE_DELETE} onClick={handleOnDelete} title="Delete this message" />
+ deleteAction = <ActivityItemPostAction iconType={ICON_TYPE_DELETE} onClick={handleOnDelete} title="Delete this message" />;
}
else {
deleteAction = <div className={classNames(`action-spacer`, styles.actionSpacer)} />;
|
fix(widget-chat): add missing semicolon for eslint failure
|
webex_spark-js-sdk
|
train
|
js
|
625b1508701e603c5213668dce57bd4a159384f4
|
diff --git a/etc/webpack.common.js b/etc/webpack.common.js
index <HASH>..<HASH> 100755
--- a/etc/webpack.common.js
+++ b/etc/webpack.common.js
@@ -90,7 +90,7 @@ var config = {
exprContextCritical: false,
noParse: [
- /angular2|zone.js/
+ /@angular|zone.js/
],
/*
|
fix(build): Fix "Unexpected token punc ({)"
fixes #<I>
|
holisticon_angular-common
|
train
|
js
|
8386519275d6a6c19d3fc3dc9eab81f7a0a890e0
|
diff --git a/lib/hydrate.js b/lib/hydrate.js
index <HASH>..<HASH> 100644
--- a/lib/hydrate.js
+++ b/lib/hydrate.js
@@ -13,9 +13,10 @@ value should have the following format
}
}
*/
- const xhr = value.body || {}
- const headers = value.headers || {}
export default function hydrate (value) {
+ const data = JSON.parse(value)
+ const xhr = data.body || {}
+ const headers = data.headers || {}
xhr.getAllResponseHeaders = function () {
return headers
|
feat(hydrate): parse JSON-based cache value
|
RasCarlito_axios-cache-adapter
|
train
|
js
|
fddd9e136148b28231520a139474a39cd2f5151f
|
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -235,7 +235,7 @@ class AureliaWebpackPlugin {
}
}
}
- if (moduleId) {
+ if (moduleId && !modules.find(m => m.id === moduleId)) {
module.id = moduleId;
}
}
|
fix(index): do not reassign moduleId when one with the same name exists already
|
aurelia_webpack-plugin
|
train
|
js
|
99ffff1f94eb7c5ece86a4fc347dc79ee0f8a56c
|
diff --git a/bin/luster.js b/bin/luster.js
index <HASH>..<HASH> 100755
--- a/bin/luster.js
+++ b/bin/luster.js
@@ -1,10 +1,12 @@
#!/usr/bin/env node
const /** @type {ClusterProcess} */
luster = require('../lib/luster'),
+ fs = require('fs'),
path = require('path');
// config path is right after this script in process.argv
-const scriptArgvIndex = process.argv.findIndex(arg => arg === __filename || path.resolve(arg) === __filename);
+// path in the argument may be relative or symlink
+const scriptArgvIndex = process.argv.findIndex(arg => arg === __filename || fs.realpathSync(path.resolve(arg)) === __filename);
const configFilePath = path.resolve(process.cwd(), process.argv[scriptArgvIndex + 1] || 'luster.conf');
luster.configure(require(configFilePath), true, path.dirname(configFilePath)).run();
|
fix: resolve symlink to bin script
|
nodules_luster
|
train
|
js
|
232b605f5bb8ab61156e1fb9860705fed017ed41
|
diff --git a/lib/postal/dkim_header.rb b/lib/postal/dkim_header.rb
index <HASH>..<HASH> 100644
--- a/lib/postal/dkim_header.rb
+++ b/lib/postal/dkim_header.rb
@@ -96,7 +96,7 @@ module Postal
end
def dkim_properties
- Array.new.tap do |header|
+ @dkim_properties ||= Array.new.tap do |header|
header << "a=rsa-sha256; c=relaxed/relaxed;"
header << "d=#{@domain_name};"
header << "s=#{@dkim_identifier}; t=#{Time.now.utc.to_i};"
|
fix(dkim): fixes timing race condition when signing emails
closes #<I>
|
atech_postal
|
train
|
rb
|
22ff76f48bd3b3aec8533ee992def9925eb7e7c4
|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -12,6 +12,7 @@ exports.register = function (plugin, options, next) {
if (stat && stat.isDirectory()) {
return readRoutes(dir + file + '/');
} else {
+ // istanbul ignore else
if (path.extname(file) === '.js') {
var route = require(dir + file);
routes = routes.concat(route);
|
refactor(register): added ignore else
|
bsiddiqui_hapi-router
|
train
|
js
|
552ec72542ec3b2b3ebf35c9fd84ab502dd746cf
|
diff --git a/packages/discord.js/src/managers/ThreadMemberManager.js b/packages/discord.js/src/managers/ThreadMemberManager.js
index <HASH>..<HASH> 100644
--- a/packages/discord.js/src/managers/ThreadMemberManager.js
+++ b/packages/discord.js/src/managers/ThreadMemberManager.js
@@ -113,7 +113,7 @@ class ThreadMemberManager extends CachedManager {
/**
* @typedef {BaseFetchOptions} FetchThreadMemberOptions
- * @property {ThreadMemberResolvable} [member] The thread member to fetch
+ * @property {ThreadMemberResolvable} member The thread member to fetch
*/
/**
|
docs(ThreadMemberManager): Require `member` in `FetchThreadMemberOptions` (#<I>)
|
discordjs_discord.js
|
train
|
js
|
660968b1298a5ae1b7c7d3507c0fbf6289b96f95
|
diff --git a/lib/reducers/create-otp-reducer.js b/lib/reducers/create-otp-reducer.js
index <HASH>..<HASH> 100644
--- a/lib/reducers/create-otp-reducer.js
+++ b/lib/reducers/create-otp-reducer.js
@@ -714,13 +714,16 @@ function createOtpReducer(config) {
}
})
case 'FIND_STOPS_FOR_PATTERN_RESPONSE':
+ if (!action.payload?.stops || action.payload.stops.length === 0)
+ return state
+
return update(state, {
transitIndex: {
routes: {
[action.payload.routeId]: {
patterns: {
[action.payload.patternId]: {
- stops: { $set: action.payload?.stops }
+ stops: { $set: action.payload.stops }
}
}
}
|
refactor: correctly avoid missing stopTimes crash
|
opentripplanner_otp-react-redux
|
train
|
js
|
2f6fa520ca71073053192627d92a5c7dddfee9bd
|
diff --git a/src/components/dialog/QDialog.js b/src/components/dialog/QDialog.js
index <HASH>..<HASH> 100644
--- a/src/components/dialog/QDialog.js
+++ b/src/components/dialog/QDialog.js
@@ -151,18 +151,18 @@ export default {
? extend({
color: this.color,
label: this.$q.i18n.label.ok,
- waitForRipple: true
+ noRipple: true
}, this.ok)
- : { color: this.color, flat: true, label: this.okLabel, waitForRipple: true }
+ : { color: this.color, flat: true, label: this.okLabel, noRipple: true }
},
cancelProps () {
return Object(this.cancel) === this.cancel
? extend({
color: this.color,
label: this.$q.i18n.label.cancel,
- waitForRipple: true
+ noRipple: true
}, this.cancel)
- : { color: this.color, flat: true, label: this.cancelLabel, waitForRipple: true }
+ : { color: this.color, flat: true, label: this.cancelLabel, noRipple: true }
}
},
methods: {
|
feat(QDialog): Disable ripple & wait-for-ripple for Buttons (unnecessary)
|
quasarframework_quasar
|
train
|
js
|
f646fb0325738648bf297952391267e4abae2212
|
diff --git a/js/releases/index.js b/js/releases/index.js
index <HASH>..<HASH> 100644
--- a/js/releases/index.js
+++ b/js/releases/index.js
@@ -101,7 +101,7 @@ module.exports = {
}
const args = ['releases', 'files', release, 'upload-sourcemaps', sourcemapPath];
- return helper.execute(helper.prepareCommand(args, SOURCEMAPS_SCHEMA, options));
+ return helper.execute(helper.prepareCommand(args, SOURCEMAPS_SCHEMA, options), true);
});
return Promise.all(uploads);
|
fix: Stream live output for sourcemap uploading (#<I>)
* Allow for streaming live output for uploading
* ref: Always live stream source map uploads.
|
getsentry_sentry-cli
|
train
|
js
|
e954f1443fc797a021e10740b19f89f95af33e11
|
diff --git a/lib/workers.js b/lib/workers.js
index <HASH>..<HASH> 100644
--- a/lib/workers.js
+++ b/lib/workers.js
@@ -149,13 +149,17 @@ Workers.prototype.addWorker = function(data) {
var self = this;
- var worker = extend(new WorkerRegistration(), data);
-
var topicName = data.topicName;
- self.emit('worker:register', worker);
+ if (this.workers[topicName]) {
+ throw new Error('worker for <' + topicName + '> already registered');
+ }
+
+ var worker = extend(new WorkerRegistration(), data);
+
+ this.emit('worker:register', worker);
- self.workers[topicName] = worker;
+ this.workers[topicName] = worker;
/**
* Remove the worker worker
diff --git a/test/workers-spec.js b/test/workers-spec.js
index <HASH>..<HASH> 100644
--- a/test/workers-spec.js
+++ b/test/workers-spec.js
@@ -112,6 +112,21 @@ describe('workers', function() {
});
+ it('should allow single worker per topic name only', function() {
+
+ // given
+ workers = Workers(engineUrl);
+
+ // when
+ workers.registerWorker('worker:Stuff', [ 'a', 'b' ], emptyCallback);
+
+ // then
+ expect(function() {
+ workers.registerWorker('worker:Stuff', [ 'a', 'b' ], emptyCallback);
+ }).to.throw('worker for <worker:Stuff> already registered');
+ });
+
+
it('should configure Workers with workerId', function() {
// given
|
feat(workers): fail on duplicate worker registration attempt
|
nikku_camunda-worker-node
|
train
|
js,js
|
4ba2d60f4692c245ae0d172d135327253337a6b1
|
diff --git a/packages/core/src/button/index.js b/packages/core/src/button/index.js
index <HASH>..<HASH> 100644
--- a/packages/core/src/button/index.js
+++ b/packages/core/src/button/index.js
@@ -20,8 +20,9 @@ export default class Button extends React.Component {
<button {...others} disabled={disabled || loading} type={htmlType} className={cls}>
{icon && <Icon type={icon} />}
{children && React.Children.map(children, (child) => {
+ if (!child) return child;
if (React.isValidElement(child)) return child;
- return <span> {child} </span>;
+ return <span>{child}</span>;
})}
</button>
);
|
fix(Button): Fix child does not exist to generate redundant element.
|
uiwjs_uiw
|
train
|
js
|
c4aabc209f2d42668c12b5c121a363384c7b42c4
|
diff --git a/config/changelog.js b/config/changelog.js
index <HASH>..<HASH> 100644
--- a/config/changelog.js
+++ b/config/changelog.js
@@ -8,7 +8,7 @@ module.exports = {
// ember style guide: https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md#commit-tagging
style: 'angular', // 'ember' 'jquery'
- head: 'master',
+ head: 'develop',
base: '-last', // a branch or tag name, `-last` defaults to the version in package.json
hooks: {
|
fix(changelog-config): generate changelog from the develop branch
|
html-next_vertical-collection
|
train
|
js
|
878f2e0ca43055051b7ac1a11b789314f6b14849
|
diff --git a/src/main/java/com/synopsys/integration/blackduck/bdio2/util/Bdio2Factory.java b/src/main/java/com/synopsys/integration/blackduck/bdio2/util/Bdio2Factory.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/synopsys/integration/blackduck/bdio2/util/Bdio2Factory.java
+++ b/src/main/java/com/synopsys/integration/blackduck/bdio2/util/Bdio2Factory.java
@@ -72,7 +72,8 @@ public class Bdio2Factory {
return new Project(projectExternalId.createBdioId().toString())
.identifier(projectExternalId.createExternalId())
.name(projectName)
- .version(projectVersionName);
+ .version(projectVersionName)
+ .namespace("root");
}
public Pair<List<Project>, List<Component>> createAndLinkComponents(final DependencyGraph dependencyGraph, final Project project) {
|
feat: added namespace "root" to root project node
|
blackducksoftware_blackduck-common
|
train
|
java
|
651002231dc2ea9bfddeaecb6c44bcf731203351
|
diff --git a/lib/superapi/api.js b/lib/superapi/api.js
index <HASH>..<HASH> 100644
--- a/lib/superapi/api.js
+++ b/lib/superapi/api.js
@@ -236,7 +236,7 @@ Api.prototype = {
},
status: function (name, handler) {
- if (!this.middlewares) {
+ if (!this.middleware("status")) {
this.register("status", Api.middlewares.status());
}
|
fix(status): fix issue if status is not the first middleware defined
|
stephanebachelier_superapi
|
train
|
js
|
8eb3a634fe9fb5e9180c014e768b56ce9a729c8b
|
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -134,8 +134,8 @@ html_theme_options = {
'github_banner': True,
'show_powered_by': False,
'extra_nav_links': {
- 'invenio-search-ui@GitHub': 'http://github.com/inveniosoftware/invenio-search-ui',
- 'invenio-search-ui@PyPI': 'http://pypi.python.org/pypi/invenio-search-ui/',
+ 'invenio-search-ui@GitHub': 'https://github.com/inveniosoftware/invenio-search-ui',
+ 'invenio-search-ui@PyPI': 'https://pypi.python.org/pypi/invenio-search-ui/',
}
}
@@ -326,3 +326,6 @@ texinfo_documents = [
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
+
+# Autodoc configuraton.
+autoclass_content = 'both'
|
docs: autodoc configuration and HTTPS fix
* Replaces HTTP links with HTTPS where possible.
|
inveniosoftware_invenio-search-ui
|
train
|
py
|
15a88a2e43e283a7fad60dc783d8d8d15dfc6345
|
diff --git a/lib/components/map/stops-overlay.js b/lib/components/map/stops-overlay.js
index <HASH>..<HASH> 100644
--- a/lib/components/map/stops-overlay.js
+++ b/lib/components/map/stops-overlay.js
@@ -1,6 +1,6 @@
import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
-import { MapLayer, Marker, Popup } from 'react-leaflet'
+import { FeatureGroup, MapLayer, Marker, Popup } from 'react-leaflet'
import { Button, ButtonGroup } from 'react-bootstrap'
import { divIcon } from 'leaflet'
@@ -55,7 +55,7 @@ class StopsOverlay extends MapLayer {
if (this.context.map.getZoom() < minZoom || !hasTransit(queryMode)) return null
return (
- <div>
+ <FeatureGroup>
{stops.map((stop) => {
const icon = divIcon({
iconSize: [20, 20],
@@ -106,7 +106,7 @@ class StopsOverlay extends MapLayer {
</Marker>
)
})}
- </div>
+ </FeatureGroup>
)
}
}
|
feat(overlay): Make StopsOverlay a FeatureGroup
|
opentripplanner_otp-react-redux
|
train
|
js
|
25b8299720c01f664911485e2043fa430a49f4c7
|
diff --git a/History.md b/History.md
index <HASH>..<HASH> 100644
--- a/History.md
+++ b/History.md
@@ -1,4 +1,10 @@
+v1.0.10 / 2022-02-03
+====================
+
+ * Merge pull request #113 from nottaw/master
+ * Use `==` for string comparisons
+
v1.0.9 / 2021-12-20
===================
diff --git a/filetype/__init__.py b/filetype/__init__.py
index <HASH>..<HASH> 100644
--- a/filetype/__init__.py
+++ b/filetype/__init__.py
@@ -7,4 +7,4 @@ from .helpers import * # noqa
from .match import * # noqa
# Current package semver version
-__version__ = version = '1.0.9'
+__version__ = version = '1.0.10'
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ from setuptools import find_packages, setup
setup(
name='filetype',
- version='1.0.9',
+ version='1.0.10',
description='Infer file type and MIME type of any file/buffer. '
'No external dependencies.',
long_description=codecs.open('README.rst', 'r',
|
feat(version): bump to <I>
|
h2non_filetype.py
|
train
|
md,py,py
|
c268fd5d235d8474214e17d5d03ac8a67cf27953
|
diff --git a/packages/vaex-core/vaex/test/dataset.py b/packages/vaex-core/vaex/test/dataset.py
index <HASH>..<HASH> 100644
--- a/packages/vaex-core/vaex/test/dataset.py
+++ b/packages/vaex-core/vaex/test/dataset.py
@@ -23,8 +23,10 @@ basedir = os.path.dirname(__file__)
def small_buffer(ds, size=3):
previous = ds.executor.buffer_size
ds.executor.buffer_size = size
- yield
- ds.executor.buffer_size = previous
+ try:
+ yield
+ finally:
+ ds.executor.buffer_size = previous
# these need to be global for pickling
|
test: fix: on failure, the buffer size wasnt't restored, causing the unittest to slow down
|
vaexio_vaex
|
train
|
py
|
534303a4504eae69f40f28d3d81cb69665449964
|
diff --git a/src/create-local-vue.js b/src/create-local-vue.js
index <HASH>..<HASH> 100644
--- a/src/create-local-vue.js
+++ b/src/create-local-vue.js
@@ -9,6 +9,12 @@ function createLocalVue (): Component {
instance._installedPlugins = []
instance.config = cloneDeep(Vue.config)
instance.util = cloneDeep(Vue.util)
+ instance._use = instance.use
+ instance.use = (plugin) => {
+ plugin.installed = false
+ plugin.install.installed = false
+ instance._use(plugin)
+ }
return instance
}
diff --git a/test/unit/specs/create-local-vue.spec.js b/test/unit/specs/create-local-vue.spec.js
index <HASH>..<HASH> 100644
--- a/test/unit/specs/create-local-vue.spec.js
+++ b/test/unit/specs/create-local-vue.spec.js
@@ -39,8 +39,6 @@ describe('createLocalVue', () => {
it('installs Router after a previous installed', () => {
const localVue = createLocalVue()
- VueRouter.installed = false
- VueRouter.install.installed = false
localVue.use(VueRouter)
const routes = [
{ path: '/foo', component: Component }
|
feat(createLocalVue): set plugin.installed to false in use
|
vuejs_vue-test-utils
|
train
|
js,js
|
7647166cde0a902bdb9b637f0688ef06c79722a6
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -61,7 +61,7 @@ function _loginCallback (publicUrl, jwksClient, cookieName, cookieOpts) {
debug(`Verify JWT token from the query parameter`)
const payload = await _verifyToken(jwksClient, linkToken)
debug('JWT token from query parameter is ok, store it in cookie', payload)
- res.cookie(cookieName, linkToken, {...cookieOpts, expires: new Date(payload.exp * 1000)})
+ cookies.set(cookieName, linkToken, {...cookieOpts, expires: new Date(payload.exp * 1000)})
} catch (err) {
// Token expired or bad in another way..
// TODO: a way to display warning to user ? throw error ?
@@ -124,7 +124,8 @@ function _auth (directoryUrl, publicUrl, jwksClient, cookieName, cookieOpts) {
const exchangedToken = exchangeRes.data
req.user = await _verifyToken(jwksClient, exchangedToken)
debug('Exchanged token is ok, store it', req.user)
- res.cookie(cookieName, exchangedToken, {...cookieOpts, expires: new Date(req.user.exp * 1000)})
+ const cookies = new Cookies(req, res)
+ cookies.set(cookieName, exchangedToken, {...cookieOpts, expires: new Date(req.user.exp * 1000)})
}
}
next()
|
fix: do not rely on res.cookie
|
koumoul-dev_sd-express
|
train
|
js
|
590ce38711d49d535ca29e1e25b0c8908fe35ccb
|
diff --git a/packages/webiny-api-cms/src/plugins/graphql/pageResolvers/createRevisionFrom.js b/packages/webiny-api-cms/src/plugins/graphql/pageResolvers/createRevisionFrom.js
index <HASH>..<HASH> 100644
--- a/packages/webiny-api-cms/src/plugins/graphql/pageResolvers/createRevisionFrom.js
+++ b/packages/webiny-api-cms/src/plugins/graphql/pageResolvers/createRevisionFrom.js
@@ -22,6 +22,7 @@ export default (entityFetcher: EntityFetcher) => async (
newRevision.populate({
url: sourceRev.url,
title: sourceRev.title,
+ snippet: sourceRev.snippet,
settings: sourceRev.settings,
content: sourceRev.content,
category: await sourceRev.category,
|
fix: snippet must be copied when creating a new page revision
|
Webiny_webiny-js
|
train
|
js
|
8aa788aef594d3d8eb0aa3d6d02c69e795ae8301
|
diff --git a/src/html-import-template-loader.js b/src/html-import-template-loader.js
index <HASH>..<HASH> 100644
--- a/src/html-import-template-loader.js
+++ b/src/html-import-template-loader.js
@@ -44,10 +44,10 @@ export class HTMLImportTemplateLoader {
if (bundleLink) {
this.onBundleReady = this._importBundle(bundleLink).then(doc => {
- return this._normalizeTemplateIds(loader, doc);
- }).then(() => {
- this.bundle = doc;
- this.onBundleReady = null;
+ return this._normalizeTemplateIds(loader, doc).then(() => {
+ this.bundle = doc;
+ this.onBundleReady = null;
+ });
});
return this.onBundleReady.then(() => this._tryGetTemplateFromBundle(entry));
|
fix(loader): missing context variable
Fixes #7
|
aurelia_html-import-template-loader
|
train
|
js
|
5b38f0392342bc1b26b0319e787065b7c178c24d
|
diff --git a/src/Leevel/Page/Page.php b/src/Leevel/Page/Page.php
index <HASH>..<HASH> 100644
--- a/src/Leevel/Page/Page.php
+++ b/src/Leevel/Page/Page.php
@@ -650,7 +650,7 @@ class Page implements IPage, IJson, IArray, IHtml, JsonSerializable
if (null === $render || is_string($render)) {
$render = $render ?: $this->getRender();
- $render = 'Leevel\Page\\'.ucfirst($render);
+ $render = __NAMESPACE__.'\\'.ucfirst($render);
$render = new $render($this);
} elseif (!$render instanceof IRender) {
throw new RuntimeException('Unsupported render type.');
diff --git a/src/Leevel/Router/Router.php b/src/Leevel/Router/Router.php
index <HASH>..<HASH> 100644
--- a/src/Leevel/Router/Router.php
+++ b/src/Leevel/Router/Router.php
@@ -438,7 +438,7 @@ class Router implements IRouter
*/
protected function normalizeMatchedData(string $matche): array
{
- $matche = 'Leevel\Router\Match\\'.$matche;
+ $matche = __NAMESPACE__.'\\Match\\'.$matche;
return (new $matche())->matche($this, $this->request);
}
|
refactor: use __NAMESPACE
|
hunzhiwange_framework
|
train
|
php,php
|
95adeb1421e640d4d50c300555faa678a4cd3cee
|
diff --git a/statuspage/statuspage.py b/statuspage/statuspage.py
index <HASH>..<HASH> 100644
--- a/statuspage/statuspage.py
+++ b/statuspage/statuspage.py
@@ -305,7 +305,7 @@ def get_files(repo):
"""
Get a list of all files.
"""
- return [file.path for file in repo.get_dir_contents("/", ref="gh-pages")]
+ return [file.path for file in repo.get_contents("/", ref="gh-pages")]
def get_config(repo):
|
chore: pygithub has depreciated get_dir_contents (#<I>)
|
jayfk_statuspage
|
train
|
py
|
28b75ef32a34d4db917269cb139ef668565d23a5
|
diff --git a/packages/ui-themes/src/canvas/high-contrast/colors.js b/packages/ui-themes/src/canvas/high-contrast/colors.js
index <HASH>..<HASH> 100644
--- a/packages/ui-themes/src/canvas/high-contrast/colors.js
+++ b/packages/ui-themes/src/canvas/high-contrast/colors.js
@@ -34,6 +34,7 @@
licorice: '#2D3B45',
oxford: '#394B58',
ash: '#556572',
+ slate: '#556572',
tiara: '#556572',
porcelain: '#FFFFFF',
white: '#FFFFFF'
|
fix(ui-themes): Make high-contrast theme backwards compatible with < <I>
Change-Id: Ia<I>c<I>cadea9c<I>da<I>c0e6e
Reviewed-on: <URL>
|
instructure_instructure-ui
|
train
|
js
|
c1342799a136396614e450ad740741d7f5d6be78
|
diff --git a/src/cli/args.js b/src/cli/args.js
index <HASH>..<HASH> 100644
--- a/src/cli/args.js
+++ b/src/cli/args.js
@@ -33,7 +33,7 @@ module.exports = {
alias: 'f',
type: 'string',
default: 'flow',
- coerce: value => value.startsWith('./') ? path.resolve(value) : value
+ coerce: value => value.slice(0, 2) === './' ? path.resolve(value) : value
})
// --type text
.option('type', {
diff --git a/src/report-html.js b/src/report-html.js
index <HASH>..<HASH> 100644
--- a/src/report-html.js
+++ b/src/report-html.js
@@ -66,7 +66,7 @@ function copyAssets(outputDir/* : string */) {
function renderHTMLReport(opt/* : Object */) {
if (opt.filename &&
- opt.filename.includes('..')) {
+ opt.filename.indexOf('..') >= 0) {
return Promise.reject(new Error(
'filename is not relative to the projectDir: ' +
[opt.projectDir, opt.filename].join(' - ')
|
fix: fixed minor node <I> incompatibilities
|
rpl_flow-coverage-report
|
train
|
js,js
|
a5d247cbcf678ff24c939b7a5d4442ea0d151da5
|
diff --git a/packages/components/bolt-ratio/__tests__/ratio.js b/packages/components/bolt-ratio/__tests__/ratio.js
index <HASH>..<HASH> 100644
--- a/packages/components/bolt-ratio/__tests__/ratio.js
+++ b/packages/components/bolt-ratio/__tests__/ratio.js
@@ -11,6 +11,11 @@ const timeout = 60000;
const imageVrtConfig = {
failureThreshold: '0.02',
failureThresholdType: 'percent',
+ customDiffConfig: {
+ // Please note the threshold set in the customDiffConfig is the per pixel sensitivity threshold. For example with a source pixel colour of #ffffff (white) and a comparison pixel colour of #fcfcfc (really light grey) if you set the threshold to 0 then it would trigger a failure on that pixel. However if you were to use say 0.5 then it wouldn't, the colour difference would need to be much more extreme to trigger a failure on that pixel, say #000000 (black)
+ threshold: '0.1',
+ includeAA: true, // If true, disables detecting and ignoring anti-aliased pixels. false by default.
+ },
};
describe('<bolt-ratio> Component', () => {
|
test: update VRT test config for the ratio component
|
bolt-design-system_bolt
|
train
|
js
|
66ee57da218ae9a16fe76da4f6d8daef278458ce
|
diff --git a/scripts/commit-scope-lint.js b/scripts/commit-scope-lint.js
index <HASH>..<HASH> 100644
--- a/scripts/commit-scope-lint.js
+++ b/scripts/commit-scope-lint.js
@@ -10,7 +10,7 @@ const rootScopes = ['deps', 'other'] // Scopes where modified files are typicall
const commitMessage = fs.readFileSync(process.argv[3], 'utf8')
const commitScope = commitMessage
.substr(commitMessage.indexOf('('), commitMessage.indexOf(':') - commitMessage.indexOf('('))
- .replace(/(core)|(community)|(-)|(\()|(\))/g, '')
+ .replace(/(core)|(community)|(shared)|(util)|(-)|(\()|(\))/g, '')
const gitDiff = spawnSync('git', ['diff', '--name-only', '--staged', 'HEAD'], {
stdio: 'pipe',
|
test(scripts): add shared and util as possible prefixes
|
telus_tds-core
|
train
|
js
|
cd709c30f7ebb8dd69ae982f6f5cb2f7e8f750ba
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -500,7 +500,7 @@ exports.isNumberArray = val => {
* //=> true
*
*/
-exports.isInstance = function isInstance(value) {
+exports.isInstance = value => {
if (value) {
const _isInstance = (
_.isFunction(_.get(value, 'toObject', null)) &&
|
refactor(isInstance): use function expression
|
lykmapipo_mongoose-common
|
train
|
js
|
d6b62cc840831dd596482010bc51e00178bbb67b
|
diff --git a/memote/suite/reporting/report.py b/memote/suite/reporting/report.py
index <HASH>..<HASH> 100644
--- a/memote/suite/reporting/report.py
+++ b/memote/suite/reporting/report.py
@@ -85,6 +85,10 @@ class GitEnabledReport(Report):
self.directory = directory
self.files = [join(self.directory, "{}.json".format(commit))
for commit in self.history]
+ if len(self.files) == 0:
+ raise RuntimeError(
+ "The given directory '{}' contains no JSON files."
+ " Cannot generate a report.".format(self.directory))
self.bag = ResultBagWrapper(self.files)
self.bag.build_index(index)
|
chore: error on empty dir (#<I>)
|
opencobra_memote
|
train
|
py
|
3c86c138d5c54aa0e91ac20f90ba3909a1481575
|
diff --git a/agent/agent.go b/agent/agent.go
index <HASH>..<HASH> 100644
--- a/agent/agent.go
+++ b/agent/agent.go
@@ -72,8 +72,14 @@ func (a *Agent) UpdateUnits() {
localUnits := a.getLocalUnits()
for unitName, unitValue := range registeredUnits {
- writeLocalUnit(unitName, unitValue)
- a.startUnit(unitName)
+ if _, ok := localUnits[unitName]; !ok {
+ writeLocalUnit(unitName, unitValue)
+ }
+
+ if state := a.getLocalUnitState(unitName); state != "active" {
+ a.startUnit(unitName)
+ }
+
}
d := parseDuration(a.ServiceTTL)
|
fix(agent): be more intelligent about starting services
* Only write out a unit file if it does not exist
* Only attempt to start the unit if the state is not active
|
coreos_fleet
|
train
|
go
|
8ade299dcb9546d6e7f392e04b6015fc840959c0
|
diff --git a/src/authService.js b/src/authService.js
index <HASH>..<HASH> 100644
--- a/src/authService.js
+++ b/src/authService.js
@@ -354,6 +354,10 @@ export class AuthService {
this.authentication.redirect(redirectUri, this.config.logoutRedirect);
+ if (typeof this.onLogout === 'function') {
+ this.onLogout(response);
+ }
+
resolve(response);
});
|
feat(authService): add onLogout. something is needed to eg clear cookies after authomatic logout
|
SpoonX_aurelia-authentication
|
train
|
js
|
8958e562bb159b00bb1fc0fa97e5ffd35dea058d
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -17,6 +17,21 @@ import os
import setuptools
+# Disable version normalization performed by setuptools.setup()
+try:
+ # Try the approach of using sic(), added in setuptools 46.1.0
+ from setuptools import sic
+except ImportError:
+ # Try the approach of replacing packaging.version.Version
+ sic = lambda v: v
+ try:
+ # setuptools >=39.0.0 uses packaging from setuptools.extern
+ from setuptools.extern import packaging
+ except ImportError:
+ # setuptools <39.0.0 uses packaging from pkg_resources.extern
+ from pkg_resources.extern import packaging
+ packaging.version.Version = packaging.version.LegacyVersion
+
name = "dialogflow"
description = "Client library for the Dialogflow API"
version = "2.1.2"
@@ -35,7 +50,7 @@ setuptools.setup(
name="google-cloud-dialogflow",
description=description,
long_description=readme,
- version=version,
+ version=sic(version),
author="Google LLC",
author_email="googleapis-packages@google.com",
license="Apache 2.0",
|
chore: prevent normalization of semver versioning (#<I>)
* chore: prevent normalization of semver versioning
* chore: update workaround to make sic work
|
googleapis_dialogflow-python-client-v2
|
train
|
py
|
546f85ea680c9749c750e8b49d388aa95067e27a
|
diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -132,7 +132,7 @@ module.exports = function(grunt) {
'{',
' "name": "angular-snap",',
' "version": "<%= pkg.version %>",',
- ' "authoer": "jtrussell",',
+ ' "author": "jtrussell",',
' "license": "MIT",',
' "repository": {',
' "type": "git",',
|
chore: Fix author field in generated gruntfile
|
jtrussell_angular-snap.js
|
train
|
js
|
aecae54b2dda4ab2173a3bfbfe50cfbce0d23dd7
|
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -137,8 +137,8 @@ html_theme_options = {
'github_banner': True,
'show_powered_by': False,
'extra_nav_links': {
- 'invenio-pidstore@GitHub': 'http://github.com/inveniosoftware/invenio-pidstore',
- 'invenio-pidstore@PyPI': 'http://pypi.python.org/pypi/invenio-pidstore/',
+ 'invenio-pidstore@GitHub': 'https://github.com/inveniosoftware/invenio-pidstore',
+ 'invenio-pidstore@PyPI': 'https://pypi.python.org/pypi/invenio-pidstore/',
}
}
@@ -329,3 +329,6 @@ texinfo_documents = [
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
+
+# Autodoc configuraton.
+autoclass_content = 'both'
|
docs: autodoc configuration and HTTPS fix
* Replaces HTTP links with HTTPS where possible.
|
inveniosoftware_invenio-pidstore
|
train
|
py
|
037d894a83fafda7f597783a264ca3b66c29f6a2
|
diff --git a/distributed/src/main/java/com/orientechnologies/orient/server/distributed/impl/ODistributedPlugin.java b/distributed/src/main/java/com/orientechnologies/orient/server/distributed/impl/ODistributedPlugin.java
index <HASH>..<HASH> 100644
--- a/distributed/src/main/java/com/orientechnologies/orient/server/distributed/impl/ODistributedPlugin.java
+++ b/distributed/src/main/java/com/orientechnologies/orient/server/distributed/impl/ODistributedPlugin.java
@@ -787,7 +787,10 @@ public class ODistributedPlugin extends OServerPluginAbstract
this, this.nodeName, iNodes.toString(), OUT, "Sent request %s", iRequest);
if (databaseName != null) {
- getMessageService().getDatabase(databaseName).incSentRequest();
+ ODistributedDatabaseImpl shared = getMessageService().getDatabase(databaseName);
+ if (shared != null) {
+ shared.incSentRequest();
+ }
}
if (iExecutionMode == ODistributedRequest.EXECUTION_MODE.RESPONSE)
|
fix: minor fix in distributed stat collecting logic
|
orientechnologies_orientdb
|
train
|
java
|
ba79822fbdbb553caec165bf2355c60f576627ca
|
diff --git a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/impl/task/ODDLPhasesExecutionTests.java b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/impl/task/ODDLPhasesExecutionTests.java
index <HASH>..<HASH> 100644
--- a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/impl/task/ODDLPhasesExecutionTests.java
+++ b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/impl/task/ODDLPhasesExecutionTests.java
@@ -51,6 +51,7 @@ public class ODDLPhasesExecutionTests {
messageSecond.execute(
new ODistributedRequestId(1, 11), server, session.getDistributedManager(), session);
assertTrue(session.existsCluster("bla"));
+ session.close();
}
@After
|
chore: minor fix in cleanups of distributed tests
|
orientechnologies_orientdb
|
train
|
java
|
5f08e1758a769d4fa6ebbf9bdfcd8e7ef4341fab
|
diff --git a/lib/request.js b/lib/request.js
index <HASH>..<HASH> 100644
--- a/lib/request.js
+++ b/lib/request.js
@@ -97,11 +97,7 @@ class Request extends AsyncResource {
let header = `${method} ${path} HTTP/1.1\r\nconnection: keep-alive\r\n`
if (headers) {
- const headerNames = Object.keys(headers)
- for (let i = 0; i < headerNames.length; i++) {
- const key = headerNames[i]
- const val = headers[key]
-
+ for (const [key, val] of Object.entries(headers)) {
if (typeof val === 'object') {
throw new InvalidArgumentError(`invalid ${key} header`)
} else if (val === undefined) {
|
refactor: prefer for of loop
|
mcollina_undici
|
train
|
js
|
e6ca097b4265ad8b2511c5be377b087e79dcd282
|
diff --git a/src/core/balancer.js b/src/core/balancer.js
index <HASH>..<HASH> 100644
--- a/src/core/balancer.js
+++ b/src/core/balancer.js
@@ -51,16 +51,18 @@ export class Balancer {
// private
static _startQuery(interval) {
- this._timer = setInterval(() => this._servers.map(
- (server, i) => {
- const startTime = now();
- const socket = net.connect(server, () => {
- this._pings[i] = now() - startTime;
- socket.end();
- });
- socket.on('error', () => this._pings[i] = -1);
- }
- ), interval);
+ if (this._servers.length > 1) {
+ this._timer = setInterval(() => this._servers.map(
+ (server, i) => {
+ const startTime = now();
+ const socket = net.connect(server, () => {
+ this._pings[i] = now() - startTime;
+ socket.end();
+ });
+ socket.on('error', () => this._pings[i] = -1);
+ }
+ ), interval);
+ }
}
static _stopQuery() {
|
chore(balancer): do not query when there is only one server in the list
|
blinksocks_blinksocks
|
train
|
js
|
2862d99caca04e2491eb20c5e1f1ca44f3561dfb
|
diff --git a/config/webpack.common.js b/config/webpack.common.js
index <HASH>..<HASH> 100644
--- a/config/webpack.common.js
+++ b/config/webpack.common.js
@@ -207,8 +207,7 @@ module.exports = {
* See: https://github.com/webpack/docs/wiki/optimization#multi-page-app
*/
new webpack.optimize.CommonsChunkPlugin({
- name: helpers.reverse(['polyfills', 'vendor', 'main']),
- minChunks: Infinity
+ name: helpers.reverse(['polyfills', 'vendor'])
}),
/*
|
chore: simplify usage of CommonsChunkPlugin (#<I>)
|
inchingorg_xdata-web
|
train
|
js
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.