sha256 stringlengths 64 64 | language stringclasses 25
values | size int32 1 210k | lines int32 1 9.41k | content stringlengths 1 200k |
|---|---|---|---|---|
1f8a691b5e237ebc41d57179c59a79492f0f6a962e628bb91fbbb06231ddede2 | JavaScript | 551 | 16 | /*global opener */
'use strict';
{
const initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse);
switch(initData.action) {
case 'change':
opener.dismissChangeRelatedObjectPopup(window, initData.value, initData.obj, initData.new_value);
b... |
90e87cd1e95e833ee3ad0026eee6a4ad0cb8e14fe5c240e73a11522c434ef125 | JavaScript | 557 | 21 | const PACKET_TYPES = Object.create(null); // no Map = no polyfill
PACKET_TYPES["open"] = "0";
PACKET_TYPES["close"] = "1";
PACKET_TYPES["ping"] = "2";
PACKET_TYPES["pong"] = "3";
PACKET_TYPES["message"] = "4";
PACKET_TYPES["upgrade"] = "5";
PACKET_TYPES["noop"] = "6";
const PACKET_TYPES_REVERSE = Object.create(null);
... |
d099739e2a6083f31a2295ff08ca074e74e7352d3ceb694661da453e45f917ec | JavaScript | 564 | 32 | 'use strict'
const tape = require('tape')
const { BufferList, BufferListStream } = require('../')
const { Buffer } = require('buffer')
tape('isBufferList positives', (t) => {
t.ok(BufferList.isBufferList(new BufferList()))
t.ok(BufferList.isBufferList(new BufferListStream()))
t.end()
})
tape('isBufferList neg... |
bde1cf7372664037a901e5fc5bce12d88f8a6701d080cb2916d2ac3739443e85 | JavaScript | 569 | 21 | getJasmineRequireObj().StringMatching = function(j$, private$) {
'use strict';
function StringMatching(expected) {
if (!private$.isString(expected) && !private$.isA('RegExp', expected)) {
throw new Error('Expected is not a String or a RegExp');
}
this.regexp = new RegExp(expected);
}
String... |
d90980d40651005ee003b507a8379bcb0ae648243241bc11a8ae4770becb47c9 | JavaScript | 569 | 24 | var canvas = document.getElementById('osci'),
context = canvas.getContext('2d'),
block = 0;
context.fillStyle = '#000';
context.fillRect(0, 0, 1024, 480); // canvas.width canvas.height
var socket = io.connect();
socket.on('connect', function(){
socket.on('data', function(data){
var i, l = data.length;
contex... |
04f67460a03a202f4a614a500965dc5f722fad63dbb71e8f7fcddff74c3a4d31 | JavaScript | 579 | 25 | getJasmineRequireObj().toContain = function() {
'use strict';
/**
* {@link expect} the actual value to contain a specific value.
* @function
* @name matchers#toContain
* @since 2.0.0
* @param {Object} expected - The value to look for.
* @example
* expect(array).toContain(anElement);
* expec... |
241da8ec1b9b20312a525601d49169b343487c4e65c1f57bbf4f5762c8ce7acd | JavaScript | 584 | 24 | getJasmineRequireObj().toBeLessThanOrEqual = function() {
'use strict';
/**
* {@link expect} the actual value to be less than or equal to the expected value.
* @function
* @name matchers#toBeLessThanOrEqual
* @since 2.0.0
* @param {Number} expected - The expected value to compare against.
* @exam... |
98920f0209fc4078e2feb4aa3ba58a35111ba640882c5ae344208e435fbd4a84 | JavaScript | 586 | 15 | 'use strict';
{
const $ = django.jQuery;
const fields = $('#django-admin-prepopulated-fields-constants').data('prepopulatedFields');
$.each(fields, function(index, field) {
$(
'.empty-form .form-row .field-' + field.name +
', .empty-form.form-row .field-' + field.name +
... |
307eb1a631f1434c42c48416a28ad36fefd284caaea183107f71d9b665bf5c3c | JavaScript | 587 | 32 |
class intro_SceneManager{
scene = null;
constructor() {
// Transition to the instruction scene
this.transition(intro_Scene.Instruction);
}
// Update the scene, called every frame
update(){
// Draw the background color
Scene_util.drawBackGround(intro_Scene, intro_... |
7bfa57948b15cbd380b6cf9215a39f3a192d772d5383748d2d30a5c4f58985a3 | JavaScript | 587 | 13 | describe('formatErrorMsg', function() {
it('should format an error with a domain', function() {
const formator = privateUnderTest.formatErrorMsg('api');
expect(formator('message')).toBe('api : message');
expect(formator('message2')).toBe('api : message2');
});
it('should format an error with a domain... |
97ebd99c38b877b99e5d03d55e1f035d729918841ec6340096759ef33a2cd9ce | JavaScript | 588 | 22 | var parse = require('../');
var test = require('tape');
test('dotted alias', function (t) {
var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});
t.equal(argv.a.b, 22);
t.equal(argv.aa.bb, 22);
t.end();
});
test('dotted default', function (t) {
var argv = parse('', {d... |
ebe92bffe2cd437a6af913bde0c674eb830ab20f5c8c3f94f4c06dba817de4cc | JavaScript | 588 | 25 | 'use strict';
const is = require('@sindresorhus/is');
module.exports = url => {
const options = {
protocol: url.protocol,
hostname: url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,
hash: url.hash,
search: url.search,
pathname: url.pathname,
href: url.href
};
if (is.string(url.po... |
a46218585cc7cb565c00a97072974f83f204a4470934002888ce7ced5f2f3d04 | JavaScript | 589 | 29 | //@ImageJ ij
//@UIService ui
//@LogService log
//@ScriptService script
//@DisplayService display
//header
importClass(Packages.bar.Utils);
function run() {
// Load template BAR lib. Exit if file is not available
// (see 'BAR>Utilities>Install Multi-language libs...')
try {
load(Utils.getLibDir() + "BARlib.js")... |
33f80965e53cdcf3245ceec647c83d058b47268eec0a663b15d86d9d9c27d680 | JavaScript | 595 | 19 | describe('toBeFalse', function() {
it('passes for false', function() {
const matcher = privateUnderTest.matchers.toBeFalse();
const result = matcher.compare(false);
expect(result.pass).toBe(true);
});
it('fails for non-false', function() {
const matcher = privateUnderTest.matchers.toBeFalse();
... |
b274741e6026831e66890e04e87b6e99425c0890987e4ad0dd73b8c2efa083c5 | JavaScript | 601 | 24 | getJasmineRequireObj().toBeGreaterThanOrEqual = function() {
'use strict';
/**
* {@link expect} the actual value to be greater than or equal to the expected value.
* @function
* @name matchers#toBeGreaterThanOrEqual
* @since 2.0.0
* @param {Number} expected - The expected value to compare against.
... |
cce4de3910aad62f575d5fec6920410ce5dba2ee54b59bf1605a553eac50d364 | JavaScript | 606 | 16 | 'use strict';
{
const inputTags = ['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'];
const modelName = document.getElementById('django-admin-form-add-constants').dataset.modelName;
if (modelName) {
const form = document.getElementById(modelName + '_form');
for (const element of form.elements) {
... |
8f53ff4881443e25976313de40c5974e984016f364d0cac1c71425b13b000090 | JavaScript | 609 | 21 | 'use strict'
const tape = require('tape')
const { BufferList, BufferListStream } = require('../')
const { Buffer } = require('buffer')
tape('convert from BufferList to BufferListStream', (t) => {
const data = Buffer.from(`TEST-${Date.now()}`)
const bl = new BufferList(data)
const bls = new BufferListStream(bl)
... |
5754f556e5e9888233cbef45872a7f8b49419527403a4fd5c77b99278b389fcd | JavaScript | 610 | 32 | /* eslint-disable babel/new-cap, xo/throw-new-error */
'use strict';
module.exports = function (str, pos) {
if (str === null || str === undefined) {
throw TypeError();
}
str = String(str);
var size = str.length;
var i = pos ? Number(pos) : 0;
if (Number.isNaN(i)) {
i = 0;
}
if (i < 0 || i >= size) {
r... |
a32f3a5f8f11ef9065514f38999feacb1353b259dece2f0c52719c6739c6e6b2 | JavaScript | 611 | 19 | var test = require('tape');
var github = require('../');
var packages = {
a : require('./a.json'),
b : require('./b.json'),
c : require('./c.json'),
d : require('./d.json'),
e : require('./e.json')
};
test(function (t) {
t.plan(5);
var url = 'https://github.com/substack/beep-boop';
t.eq... |
4ab6736fcd053a2475ba6d87aff70d821c3ecc8ca3bb05f50ae3e529568c83cc | JavaScript | 614 | 12 | 'use strict'
exports.directories = function () {
return [
'.git', // Git repository files, see <https://git-scm.com/>
'.nyc_output', // Temporary directory where nyc stores coverage data, see <https://github.com/bcoe/nyc>
'.sass-cache', // Cache folder for node-sass, see <https://github.com/sass/node-sas... |
2957dc2045a462606df224526d880fcc7a472bc992a74b0db9b23bf1984a9b20 | JavaScript | 616 | 24 | 'use strict'
var util = require('util')
var User = exports.User = function User (msg) {
var err = new Error(msg)
Error.captureStackTrace(err, User)
err.code = 'EGAUGE'
return err
}
exports.MissingTemplateValue = function MissingTemplateValue (item, values) {
var err = new User(util.format('Missing template ... |
2efee673549499f8e6773d966003e8752f6cad4d289ae4780bc690322ab8a905 | JavaScript | 618 | 30 | getJasmineRequireObj().Empty = function(j$, private$) {
'use strict';
function Empty() {}
Empty.prototype.asymmetricMatch = function(other) {
if (
private$.isString(other) ||
Array.isArray(other) ||
private$.isTypedArray(other)
) {
return other.length === 0;
}
if (privat... |
a5835ffe4e7de6144bca3c41c8b696785664cecaa5e900b95ae28311c5f9fbfd | JavaScript | 628 | 29 | 'use strict';
const PassThrough = require('stream').PassThrough;
const zlib = require('zlib');
const mimicResponse = require('mimic-response');
module.exports = response => {
// TODO: Use Array#includes when targeting Node.js 6
if (['gzip', 'deflate'].indexOf(response.headers['content-encoding']) === -1) {
return ... |
12f7ca97faea523e10cc2e87be2204a82a893154541411a474ae66f9fbdb8dde | JavaScript | 637 | 31 | getJasmineRequireObj().NotEmpty = function(j$, private$) {
'use strict';
function NotEmpty() {}
NotEmpty.prototype.asymmetricMatch = function(other) {
if (
private$.isString(other) ||
Array.isArray(other) ||
private$.isTypedArray(other)
) {
return other.length !== 0;
}
i... |
5856e9557dd0477f5326f863af988ce1056723776142f6f64d213fa5733244ad | JavaScript | 644 | 32 | 'use strict';
const fs = require('fs');
const util = require('util');
const is = require('@sindresorhus/is');
const isFormData = require('./is-form-data');
module.exports = async options => {
const {body} = options;
if (options.headers['content-length']) {
return Number(options.headers['content-length']);
}
if... |
da37e9e71bc22b2b31f5e70c485ac2544e9defef5b98c99aabb1646f639c0093 | JavaScript | 649 | 36 | 'use strict';
const stripAnsi = require('strip-ansi');
const isFullwidthCodePoint = require('is-fullwidth-code-point');
module.exports = str => {
if (typeof str !== 'string' || str.length === 0) {
return 0;
}
str = stripAnsi(str);
let width = 0;
for (let i = 0; i < str.length; i++) {
const code = str.codeP... |
5b81d2da89374aca3e891db5f79186e1c7288e73e4be39aadc16377e81d276bd | JavaScript | 653 | 26 | let warningSent = false
const wrapWithHiddenComName = async portsPromise => {
const ports = await portsPromise
return ports.map(port => {
const newPort = { ...port }
return Object.defineProperties(newPort, {
comName: {
get() {
if (!warningSent) {
warningSent = true
... |
84b1fa15e4401903e5d93aedd50a24012231376743cffd96f0f3c9ba0091202c | JavaScript | 657 | 30 | getJasmineRequireObj().errors = function() {
'use strict';
function ExpectationFailed() {}
ExpectationFailed.prototype = new Error();
ExpectationFailed.prototype.constructor = ExpectationFailed;
class PendingSpecException extends Error {
constructor(message) {
super();
this.message = messag... |
f7055f40138c028925ca76b74ea5a4041b4d67d2fa4dae2f78c2ec326ebc2bf3 | JavaScript | 657 | 16 | "use strict"
var os = require("os")
var hasUnicode = module.exports = function () {
// Recent Win32 platforms (>XP) CAN support unicode in the console but
// don't have to, and in non-english locales often use traditional local
// code pages. There's no way, short of windows system calls or execing
// the chcp... |
223c25dba6fefbb7cb491b026a32f070b1425475d3cd2d04627be5d71a07fd38 | JavaScript | 666 | 24 |
var sep = require('path').sep || '/';
var assert = require('assert');
var uri2path = require('../');
var tests = require('./tests.json');
describe('file-uri-to-path', function () {
Object.keys(tests).forEach(function (uri) {
// the test cases were generated from Windows' PathCreateFromUrlA() function.
// ... |
4086022d3d089c260b6d8c2daafa2a389a2b90d4e3d82a79a943e2c26ddbc62b | JavaScript | 668 | 18 |
var assert = require('assert');
var logger = require('..');
describe('noop-logger', function(){
it('should expose methods', function(){
assert.equal('function', typeof logger.debug);
assert.equal('function', typeof logger.info);
assert.equal('function', typeof logger.warn);
assert.equal('function', ... |
2f3bbc7d7e54e16d91683936a7fa70db16e2cf1b4c8c72451f3d3a6a40e0f701 | JavaScript | 672 | 26 | module.exports = function (opts) {
var sep = opts ? opts.sep : '{}'
var len = sep.length
var whitespace = '\\s*'
var left = escape(sep.substring(0, len / 2)) + whitespace
var right = whitespace + escape(sep.substring(len / 2, len))
return function (template, values) {
Object.keys(values).forEach(funct... |
34a98a1fcd39e12adbc98cc2d6dc3d99bb5a5a83ce8e57050826e9e539b4ecb0 | JavaScript | 672 | 23 | if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
wr... |
991b1e4df06f0992c81369d5a2afa3484f5d12464518351d4233ff393a91f385 | JavaScript | 674 | 26 | getJasmineRequireObj().StringContaining = function(j$, private$) {
'use strict';
function StringContaining(expected) {
if (!private$.isString(expected)) {
throw new Error('Expected is not a String');
}
this.expected = expected;
}
StringContaining.prototype.asymmetricMatch = function(other) ... |
e95a3a03d2aa0a597e4e51b71a183d4492612febd901aa72b8378e7c35c88690 | JavaScript | 674 | 25 | var log = require('npmlog')
var fs = require('fs')
var path = require('path')
module.exports = function (rc, env) {
log.heading = 'prebuild-install'
if (rc.verbose) {
log.level = 'verbose'
} else {
log.level = env.npm_config_loglevel || 'notice'
}
// Temporary workaround for npm 7 which swallows ou... |
a8d367d69914ba23dee9ecad7c162d24dd12754e4b1b5f083d271ab211537769 | JavaScript | 675 | 25 | describe('Spy Registry browser-specific behavior', function() {
function createSpy(name, originalFn) {
return privateUnderTest.Spy(name, originalFn);
}
it('can spy on and unspy window.onerror', function() {
const spies = [];
const spyRegistry = new privateUnderTest.SpyRegistry({
currentSpies: f... |
44bed5fcccb6c8f6cd92ff4bc034005b9d46ba560c572979944772555d4f2585 | JavaScript | 690 | 24 | 'use strict'
/* eslint-env mocha */
/* eslint no-proto: 0 */
var assert = require('assert')
var setPrototypeOf = require('..')
describe('setProtoOf(obj, proto)', function () {
it('should merge objects', function () {
var obj = { a: 1, b: 2 }
var proto = { b: 3, c: 4 }
var mergeObj = setPrototypeOf(obj, p... |
a4969a552701982cd415005d5ce162f955cf26c205229d2f4c75ed4a75bceceb | JavaScript | 690 | 26 | /**
* Encodes a string in a colour: red, yellow or green
* @param {String} c colour to highlight in
* @param {String} str the string to encode
* @return {String} coloured string for terminal printing
*/
function colour(c, str) {
return (colour[c] || colour.black) + str + colour.black;
}
function strip(s... |
6448b2234865827c74b0c38c68f9f4a7ff3cf50ba9c8746d3182d6fdc007c2b9 | JavaScript | 695 | 30 | 'use strict';
try {
const isValidUTF8 = require('utf-8-validate');
exports.isValidUTF8 =
typeof isValidUTF8 === 'object'
? isValidUTF8.Validation.isValidUTF8 // utf-8-validate@<3.0.0
: isValidUTF8;
} catch (e) /* istanbul ignore next */ {
exports.isValidUTF8 = () => true;
}
/**
* Checks if a s... |
21d97bd38d32451123dc12480de17d063457b71c09d790ce34f3f0b7c51bcd73 | JavaScript | 700 | 32 | 'use strict';
const utils = require('./utils');
module.exports = (ast, options = {}) => {
let stringify = (node, parent = {}) => {
let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
let invalidNode = node.invalid === true && options.escapeInvalid === true;
let output = '';
if... |
0e70c11bdcb004e7f155bd955e0ef5c4147fb4408f031c3b40b859397889e1fa | JavaScript | 707 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(n){return"請刪掉"+(n.input.length-n.maximum)+"個字元"},inputTooShor... |
69607a9ee51b63333d0e7ee20a38b52e1e96652a4bbc09c701d70835fbbfe10a | JavaScript | 710 | 22 | "use strict";
// Update this array if you add/rename/remove files in this directory.
// We support Browserify by skipping automatic module discovery and requiring modules directly.
var modules = [
require("./internal"),
require("./utf16"),
require("./utf7"),
require("./sbcs-codec"),
require("./sbcs... |
a94c6fa4adb064a12c7113bad482e78c3d3c57d8011d37e0fa82a917bd849b0e | JavaScript | 717 | 33 | getJasmineRequireObj().toBeNaN = function(j$, private$) {
'use strict';
/**
* {@link expect} the actual value to be `NaN` (Not a Number).
* @function
* @name matchers#toBeNaN
* @since 1.3.0
* @example
* expect(thing).toBeNaN();
*/
function toBeNaN(matchersUtil) {
return {
compare: ... |
4cc886b5d06b3a73b7260e8dd116d7d99683713fe1a0a8c6bf8b1dac36fa428f | JavaScript | 720 | 29 | getJasmineRequireObj().AllOf = function(j$, private$) {
'use strict';
function AllOf() {
const expectedValues = Array.from(arguments);
if (expectedValues.length === 0) {
throw new TypeError(
'jasmine.allOf() expects at least one argument to be passed.'
);
}
this.expectedValues =... |
37f294edfb688dfd8782f2519693fc2aa1ba84a21baa28183772b4607fdcb6e4 | JavaScript | 721 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/az",[],function(){return{inputTooLong:function(n){return n.input.length-n.maximum+" simvol silin"},inputTooShor... |
2944f1d3c8c5d5c5e07e7c30d6cbef5fc37440b7c73de47aeb37fa8424f04bf1 | JavaScript | 729 | 16 | var Stream = require('stream');
if (process.env.READABLE_STREAM === 'disable' && Stream) {
module.exports = Stream.Readable;
Object.assign(module.exports, Stream);
module.exports.Stream = Stream;
} else {
exports = module.exports = require('./lib/_stream_readable.js');
exports.Stream = Stream || exports;
ex... |
fa7b84bb6e37fba06f79793937e55baf6ebc1bee051e350e11c7ca681a9f3db7 | JavaScript | 731 | 9 | /*
* jQuery throttle / debounce - v1.1 - 3/7/2010
* http://benalman.com/projects/jquery-throttle-debounce-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=... |
1c1678d18dc75f67bbfae8c92836543af6990bce6b1cf1ad3acfb52285dac393 | JavaScript | 733 | 27 | var fs = require('fs');
var path = require('path');
const supportsColor = require('supports-color');
module.exports = help;
const highlight = supportsColor.stdout ? '\x1B\[$1m' : '';
function help(item) {
if (!item) {
item = 'help';
} else if (item === true) { // if used with -h or --help and no args
ite... |
7d88178fb35726264fa3a8500abeae44d5b585491edf3cd5b0ecf4dec1bbb299 | JavaScript | 741 | 37 | 'use strict';
var stripAnsi = require('strip-ansi');
var codePointAt = require('code-point-at');
var isFullwidthCodePoint = require('is-fullwidth-code-point');
// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345
module.exports = function (str) {
if (typeof str !== 's... |
cdbed99634b523be655225df1547cd00295e3041cb02848c652ddad5e6787e49 | JavaScript | 749 | 27 | 'use strict';
var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE;
function highWaterMarkFrom(options, isDuplex, duplexKey) {
return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
}
function getHighWaterMark(state, options, duplexKey, is... |
85747e89f4c8eecc82130834c3fade5dcb1ead57c3ed779088bb3f9bd7af0262 | JavaScript | 751 | 39 | 'use strict';
const stripAnsi = require('strip-ansi');
const isFullwidthCodePoint = require('is-fullwidth-code-point');
const emojiRegex = require('emoji-regex')();
module.exports = input => {
input = input.replace(emojiRegex, ' ');
if (typeof input !== 'string' || input.length === 0) {
return 0;
}
input = st... |
ad322a7b1dec60f3d2ebda2091816469efb55b567d241cf3cf0fa4c5a4afe500 | JavaScript | 753 | 27 | if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
if (superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
... |
c6812ab3e25ec7a78c3b47cdb94e4cafc605d8893bea394cf32e7028d1f3caf9 | JavaScript | 754 | 23 | /*========================================================================
* Configure Require.js
*========================================================================
*/
var require = {
/* The following is required
for URL busting and avoiding cache! */
urlArgs: "bust=" + (new Date()).getTime(... |
8646e134f6c0c711a2b79697134e750df6a93008da7657e9a7674e1c3e76675e | JavaScript | 756 | 32 | var parse = require('../');
var test = require('tape');
test('flag boolean true (default all --args to boolean)', function (t) {
var argv = parse(['moo', '--honk', 'cow'], {
boolean: true
});
t.deepEqual(argv, {
honk: true,
_: ['moo', 'cow']
});
t.deepEqual(typeof ... |
fa4b908e73bd08c0a91e5885488bfceda85a1e6641c8c59cd80d5d54ea7bcfd5 | JavaScript | 757 | 29 | /*******************************
Intro scene shown before measurement starts
*******************************/
//p5.js preload images
function preload() {
let imgPath_slide;
imgPath_slide = [
STATIC_ROOT + "abx_app/img/01_introduction_wet/01.png" + APP_VER,
STATIC_ROOT + "abx_ap... |
bd79149e13a94500f560887d2865b5871a4f4ac976ab7985854f5815fe05c995 | JavaScript | 758 | 25 | /**
* Convert a typed array to a Buffer without a copy
*
* Author: Feross Aboukhadijeh <https://feross.org>
* License: MIT
*
* `npm install typedarray-to-buffer`
*/
var isTypedArray = require('is-typedarray').strict
module.exports = function typedarrayToBuffer (arr) {
if (isTypedArray(arr)) {
// To av... |
f3f22eb462031b083266f9810a66dfc6c9d9a186fd5c10a3f7c016b06cd535ff | JavaScript | 758 | 32 | 'use strict';
// We define these manually to ensure they're always copied
// even if they would move up the prototype chain
// https://nodejs.org/api/http.html#http_class_http_incomingmessage
const knownProps = [
'destroy',
'setTimeout',
'socket',
'headers',
'trailers',
'rawHeaders',
'statusCode',
'httpVersion... |
a7ec9054d5b9385b701d5b3e5921f7002151df3c3415c2c49fe34451a6aefd66 | JavaScript | 759 | 29 | let jasmineCore;
verifyNoGlobals(() => { jasmineCore = require('../lib/jasmine-core.js'); });
jasmineCore.installGlobals();
const Jasmine = require('jasmine');
const runner = new Jasmine({jasmineCore});
runner.loadConfigFile('./spec/support/jasmine.json');
runner.exitOnCompletion = false;
runner.execute()
.then(
... |
c8aceab78c355e84619d3c4273f115521a8cc98a81433d21214b4cf76c4a7fda | JavaScript | 759 | 40 | getJasmineRequireObj().CurrentRunableTracker = function() {
'use strict';
class CurrentRunableTracker {
#currentSpec;
#currentlyExecutingSuites;
constructor() {
this.#currentlyExecutingSuites = [];
}
currentRunable() {
return this.currentSpec() || this.currentSuite();
}
c... |
b7b5babc8e9dbc3976141b83f605135e87a00783ea14e8d9a8617777cb200ed6 | JavaScript | 762 | 33 | describe('Printing a big object', function() {
function rand(upper) {
return Math.round(upper * Math.random());
}
function generateObject(level) {
const object = {};
for (let i = 0; i < 50; i++) {
const decide = rand(2);
switch (decide) {
case 0:
object['cycle' + i] = o... |
7c627ef80c3bd0fa739371202e317557f42fa83daafee7d78e740823266a6207 | JavaScript | 768 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(n){re... |
a2501dbcf439aac37d219bb100a80355033e6e57b15275930d35d4b62a2bca02 | JavaScript | 768 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(n){return"请删除"+(n.in... |
99410695bfbd9d01efcdc4d823ed648ec07b26c3d11a92f159b8eb27c511b615 | JavaScript | 771 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/tk",[],function(){return{errorLoading:function(){return"Netije ýüklenmedi."},inputTooLong:function(e){return e.... |
a1efa3fa06393aff652f3529ea1b1bc32134d49eb794b23272fb0ba13d214550 | JavaScript | 771 | 19 | var Stream = require('stream');
if (process.env.READABLE_STREAM === 'disable' && Stream) {
module.exports = Stream;
exports = module.exports = Stream.Readable;
exports.Readable = Stream.Readable;
exports.Writable = Stream.Writable;
exports.Duplex = Stream.Duplex;
exports.Transform = Stream.Transform;
expo... |
743cfc892a74eef6f1f6072222acf9eb099cd932c78f9bfca3a7acef9bf39995 | JavaScript | 775 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/tr",[],function(){return{errorLoading:function(){return"Sonuç yüklenemedi"},inputTooLong:function(n){return n.i... |
3c1910e75d38e1656fbb1d592d21d863bffdb569878833a9081317b22a73dd50 | JavaScript | 778 | 35 | var test = require('tape');
var parse = require('../');
test('boolean default true', function (t) {
var argv = parse([], {
boolean: 'sometrue',
default: { sometrue: true }
});
t.equal(argv.sometrue, true);
t.end();
});
test('boolean default false', function (t) {
var argv = parse([... |
79db8a086efa2778883eb51e9020c2abbe35ae71b8c43ed353713b2e26fbb0f1 | JavaScript | 778 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e)... |
c2ec0fc2eef2dfa17b81c3a07f853a5493b88805f1c2d6743bfbac39a4dd66ac | JavaScript | 779 | 31 | var test = require('tape');
var parse = require('../');
test('long opts', function (t) {
t.deepEqual(
parse([ '--bool' ]),
{ bool : true, _ : [] },
'long boolean'
);
t.deepEqual(
parse([ '--pow', 'xixxle' ]),
{ pow : 'xixxle', _ : [] },
'long capture sp'
... |
430867f74e72fc85ac0117ad028565b935b57ca33f4a209e93408f6d1f236aa1 | JavaScript | 780 | 28 | /* eslint-disable unicorn/no-process-exit */
'use strict';
let updateNotifier = require('.');
const options = JSON.parse(process.argv[2]);
updateNotifier = new updateNotifier.UpdateNotifier(options);
(async () => {
// Exit process when offline
setTimeout(process.exit, 1000 * 30);
const update = await updateNotif... |
73a9ea5268ad2ace3fe809580ef8827ba1ea2f2387aa8b7622bbc94468e3d491 | JavaScript | 786 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(n){... |
7261aa253de585183089fd1c1974576d7427428f301edd6700afabc91a82e21f | JavaScript | 794 | 29 | describe('toBeLessThanOrEqual', function() {
it('passes when actual <= expected', function() {
const matcher = privateUnderTest.matchers.toBeLessThanOrEqual();
let result;
result = matcher.compare(1, 2);
expect(result.pass).toBe(true);
result = matcher.compare(1, 1);
expect(result.pass).toBe... |
9b04dec92b14020aaefc803a86f17333285c488335cc684d60aabc1bb5ffb693 | JavaScript | 796 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/vi",[],function(){return{inputTooLong:function(n){return"Vui lòng xóa bớt "+(n.input.length-n.maximum)+" ký tự"... |
e963c05053adf4f814b93c0baf16eae9cdf5f526891dc015c5c6944365df4613 | JavaScript | 797 | 33 | 'use strict';
exports.htmlEscape = string => string
.replace(/&/g, '&')
.replace(/"/g, '"')
.replace(/'/g, ''')
.replace(/</g, '<')
.replace(/>/g, '>');
exports.htmlUnescape = htmlString => htmlString
.replace(/>/g, '>')
.replace(/</g, '<')
.replace(/�?39;/g, '\'')
.replace(/"... |
36210b109fbf29152744a5bc509b185b813b480a7e806ebdfd77085cca53cc60 | JavaScript | 800 | 37 | const exec = require('child_process').exec;
const tree = require('./tree');
const utils = require('./utils');
var hasPS = true;
// discover if the OS has `ps`, and therefore can use psTree
exec('ps', (error) => {
module.exports.hasPS = hasPS = !error;
});
module.exports = function main(pid, callback) {
if (typeof... |
2e02e074e90a8dceb7b2fc4fd546bb034cded4be96aefd17ea7a7ef22443e73c | JavaScript | 801 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var n=e.input.length-e.maximum,t="Sisesta "+n+" täht";return ... |
a90d4d4f1310332d1170f3c86fa04d4dc69dd4f7228ca5c59454546d6ea995f0 | JavaScript | 801 | 28 | 'use strict';
const os = require('os');
const path = require('path');
const homeDirectory = os.homedir();
const {env} = process;
exports.data = env.XDG_DATA_HOME ||
(homeDirectory ? path.join(homeDirectory, '.local', 'share') : undefined);
exports.config = env.XDG_CONFIG_HOME ||
(homeDirectory ? path.join(homeDire... |
2951a2ae118635e7bf888a4c18b5f91331ff52435ef8538f0bfd38f381be410d | JavaScript | 803 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/fi",[],function(){return{errorLoading:function(){return"Tuloksia ei saatu ladattua."},inputTooLong:function(n){... |
4d5db9dfe2382b0530f61175fd7b891ebc2f1e40ae94c56c659433fcd41a3bf9 | JavaScript | 803 | 29 | describe('toBeGreaterThanOrEqual', function() {
it('passes when actual >= expected', function() {
const matcher = privateUnderTest.matchers.toBeGreaterThanOrEqual();
let result;
result = matcher.compare(2, 1);
expect(result.pass).toBe(true);
result = matcher.compare(1, 1);
expect(result.pass... |
9259995d8e1ca1737ff36cf4f97c80e55d812726ec4ead43b6c0829ce9679df9 | JavaScript | 804 | 43 | 'use strict';
var fs = require('fs');
/**
* Parse the nodemon config file, supporting both old style
* plain text config file, and JSON version of the config
*
* @param {String} filename
* @param {Function} callback
*/
function parse(filename, callback) {
var rules = {
ignore: [],
watch: [],
};
... |
40d3a4f566c1e1808a23ef293693e906d39f1812cb89cf7037315831320d5558 | JavaScript | 807 | 20 | // CHECK VALIDATION CHECKBOX ON SLIDER CLICK
let elements = document.getElementsByClassName("slider");
let onClick = function() {
document.getElementsByName(this.getAttribute("name").concat("_validator"))[0].checked = true
};
Array.from(elements).forEach((element) => {element.addEventListener('click', onClick)});
... |
827d1d748a939c95f8c24fad582e6014e449b357648081fd30ec0b96306e40ad | JavaScript | 807 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/is",[],function(){return{inputTooLong:function(n){var t=n.input.length-n.maximum,e="Vinsamlegast styttið texta ... |
342cf8467b642597fc6030c2d53141bcafa7927f83f9c18dcbbc2886aa9a403e | JavaScript | 811 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:funct... |
ef69f862c6e41a35caf6d09df940937890642a40cb59605a7880de51ef3bac76 | JavaScript | 811 | 33 | getJasmineRequireObj().toBePositiveInfinity = function(j$, private$) {
'use strict';
/**
* {@link expect} the actual value to be `Infinity` (infinity).
* @function
* @name matchers#toBePositiveInfinity
* @since 2.6.0
* @example
* expect(thing).toBePositiveInfinity();
*/
function toBePositive... |
90e55df90eb90a10f71875b7040eefa314a460ea1a13ad974540f1c407c3ca3f | JavaScript | 815 | 33 | getJasmineRequireObj().toBeNegativeInfinity = function(j$, private$) {
'use strict';
/**
* {@link expect} the actual value to be `-Infinity` (-infinity).
* @function
* @name matchers#toBeNegativeInfinity
* @since 2.6.0
* @example
* expect(thing).toBeNegativeInfinity();
*/
function toBeNegati... |
d1f1a9af4234aed56139239ad564f913eb2fac8557c563e95dd996be77d515f8 | JavaScript | 815 | 28 | var ignoreRoot = require('ignore-by-default').directories();
// default options for config.options
module.exports = {
restartable: 'rs',
colours: true,
execMap: {
py: 'python',
rb: 'ruby',
ts: 'ts-node',
// more can be added here such as ls: lsc - but please ensure it's cross
// compatible wi... |
4f72600a6f90113c283014e3c782af003a377fafabaca20e08a808e28928db7f | JavaScript | 817 | 34 | getJasmineRequireObj().toBeRejected = function(j$, private$) {
'use strict';
/**
* Expect a promise to be rejected.
* @function
* @async
* @name async-matchers#toBeRejected
* @since 3.1.0
* @example
* await expectAsync(aPromise).toBeRejected();
* @example
* return expectAsync(aPromise).t... |
5a731b3504b9325bf15f2db502c6a50820cb12d5326bfa0e2506fa65da9d1f9e | JavaScript | 822 | 27 | const { PACKET_TYPES } = require("./commons");
const encodePacket = ({ type, data }, supportsBinary, callback) => {
if (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) {
const buffer = toBuffer(data);
return callback(encodeBuffer(buffer, supportsBinary));
}
// plain string
return callback(PACK... |
a154ca976934d0c3500f7f70d7d6f5fd5cf28eee82ceb8026f9c02064816b5cc | JavaScript | 823 | 34 | 'use strict';
const Readable = require('stream').Readable;
const lowercaseKeys = require('lowercase-keys');
class Response extends Readable {
constructor(statusCode, headers, body, url) {
if (typeof statusCode !== 'number') {
throw new TypeError('Argument `statusCode` should be a number');
}
if (typeof head... |
855070c71eef83b431ea9e87f642d147880fa08eeb47eca8c2e647af3f287011 | JavaScript | 825 | 41 | var concat = require('../')
var stream = require('stream')
var test = require('tape')
test('basic', function (t) {
t.plan(2)
var s = new stream.PassThrough()
concat(s, function (err, buf) {
t.error(err)
t.deepEqual(buf, Buffer.from('abc123456789'))
})
s.write('abc')
setTimeout(function () {
s.w... |
10abe0873555228627d7a4098aa104cb94fc609fc237c2061d6c25011dab0117 | JavaScript | 826 | 30 | 'use strict'
var util = require('util')
var TrackerBase = require('./tracker-base.js')
var Tracker = module.exports = function (name, todo) {
TrackerBase.call(this, name)
this.workDone = 0
this.workTodo = todo || 0
}
util.inherits(Tracker, TrackerBase)
Tracker.prototype.completed = function () {
return this.w... |
9cda29fe56643215b87710e4d99df6a2a78101927d99047ee69dfb114017138d | JavaScript | 828 | 25 | 'use strict'
var stringWidth = require('string-width')
var stripAnsi = require('strip-ansi')
module.exports = wideTruncate
function wideTruncate (str, target) {
if (stringWidth(str) === 0) return str
if (target <= 0) return ''
if (stringWidth(str) <= target) return str
// We compute the number of bytes of an... |
b45da6bf315849660e537624b65dc6f77a4291ff95f60a270b193b85c039275a | JavaScript | 828 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:functi... |
5062a7c87599935fec99e505f3f463c3e0872455da73f8c8054ce0788c513ba2 | JavaScript | 829 | 40 | module.exports = clone;
// via http://stackoverflow.com/a/728694/22617
function clone(obj) {
// Handle the 3 simple types, and null or undefined
if (null === obj || 'object' !== typeof obj) {
return obj;
}
var copy;
// Handle Date
if (obj instanceof Date) {
copy = new Date();
copy.setTime(obj... |
dcf7549344a91d8f87fa1eb6c289b0e00cb244cba394673afe8c56f8bd56c8eb | JavaScript | 831 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:fu... |
1e38b01c1a6ae3f82ec4bd08072526b16949fbd14d541ecbeafc3c5ca1c18531 | JavaScript | 834 | 27 | 'use strict';
(function() {
const env = jasmine.getEnv();
const urls = new jasmine.HtmlReporterV2Urls();
/**
* Configures Jasmine based on the current set of query parameters. This
* supports all parameters set by the HTML reporter as well as
* spec=partialPath, which filters out specs whose paths don'... |
1ec268bb80d3fdd7f9051ef0fc78355d33fec1981ca8e54dabbd9d20bda3dfa1 | JavaScript | 841 | 51 | 'use strict';
const {PassThrough} = require('stream');
module.exports = options => {
options = Object.assign({}, options);
const {array} = options;
let {encoding} = options;
const buffer = encoding === 'buffer';
let objectMode = false;
if (array) {
objectMode = !(encoding || buffer);
} else {
encoding = e... |
0bae803be28e5cdb97116c21c1f8d80456b7806708cec3c51d0019f6a4a1dc6a | JavaScript | 844 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:functio... |
35c9539434e23455f5cb45b52e58f5d3e648a1751877bbc35eac9e509eefdc1e | JavaScript | 852 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hr",[],function(){function n(n){var e=" "+n+" znak";return n%10<5&&n%10>0&&(n%100<5||n%100>19)?n%10>1&&(e+="a")... |
48c1d12f1494b20377fcdeec9056272eff84ed8c081e1e56dc2aea395f77d19c | JavaScript | 853 | 43 | /*!
* express
* Copyright(c) 2009-2013 TJ Holowaychuk
* Copyright(c) 2013 Roman Shtylman
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict';
/**
* Module dependencies.
* @private
*/
var setPrototypeOf = require('setprototypeof')
/**
* Initialization middleware, exposing the... |
226981f6fee0d9928498f15441e5eb2fbdb75448db8845b761e9717aa1c48077 | JavaScript | 855 | 3 | /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(n){return"너무 깁니... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.