sha256 stringlengths 64 64 | language stringclasses 25
values | size int32 1 210k | lines int32 1 9.41k | content stringlengths 1 200k |
|---|---|---|---|---|
c230d25d8e7fbb50960c634b636b71327c409e9a77e67fe9446b566bdcea362d | JavaScript | 1,109 | 52 | "use strict";
var BOMChar = '\uFEFF';
exports.PrependBOM = PrependBOMWrapper
function PrependBOMWrapper(encoder, options) {
this.encoder = encoder;
this.addBOM = true;
}
PrependBOMWrapper.prototype.write = function(str) {
if (this.addBOM) {
str = BOMChar + str;
this.addBOM = false;
}
... |
69cd57b5cdd08c42410ebc0d92235e334f1fb985e6eb2dcfb1c692db674411bd | JavaScript | 1,118 | 69 | /*!
* unpipe
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module exports.
* @public
*/
module.exports = unpipe
/**
* Determine if there are Node.js pipe-like data listeners.
* @private
*/
function hasPipeDataListeners(stream) {
var listeners = stream.listeners('da... |
ea89bc865e3420aedb855efafcd6556fad7d33fd01878ed701e4d3dbc9e9c5ba | JavaScript | 1,127 | 47 | getJasmineRequireObj().MapContaining = function(j$, private$) {
'use strict';
function MapContaining(sample) {
if (!private$.isMap(sample)) {
throw new Error(
'You must provide a map to `mapContaining`, not ' +
private$.basicPrettyPrinter(sample)
);
}
this.sample = sample... |
a108a934216c340f920b6bf014a8f6c9243ab0512c01a70199d235a5e598047b | JavaScript | 1,130 | 45 | getJasmineRequireObj().SetContaining = function(j$, private$) {
'use strict';
function SetContaining(sample) {
if (!private$.isSet(sample)) {
throw new Error(
'You must provide a set to `setContaining`, not ' +
private$.basicPrettyPrinter(sample)
);
}
this.sample = sample... |
b1f7614c14cd406a2409dfd59628ce5ea06666d017b65a7df12f83b62613c897 | JavaScript | 1,153 | 48 | /*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
var isExtglob = require('is-extglob');
var chars = { '{': '}', '(': ')', '[': ']'};
var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|... |
322c61143bdd45d6bec23f938eb374d7cb3b47b137e1a421463cf86dac6b74ac | JavaScript | 1,156 | 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/uk",[],function(){function n(n,e,u,r){return n%100>10&&n%100<15?r:n%10==1?e:n%10>1&&n%10<5?u:r}return{errorLoad... |
6d5e9e995084f656342f36d537ced628000014b513de42aa1339fae35a49dbda | JavaScript | 1,171 | 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/ru",[],function(){function n(n,e,r,u){return n%10<5&&n%10>0&&n%100<5||n%100>20?n%10>1?r:e:u}return{errorLoading... |
cc9f33a45159b065abad138733f069855f9991ad95aa3cfef8584c1e0da50465 | JavaScript | 1,171 | 53 | const spawn = require('child_process').spawn;
module.exports = { tree, pidsForTree, getStat };
function getStat() {
return new Promise((resolve) => {
const command = `ls /proc | grep -E '^[0-9]+$' | xargs -I{} cat /proc/{}/stat`;
const spawned = spawn('sh', ['-c', command], {
stdio: ['pipe', 'pipe', '... |
bfdd31d421d9975519122715df56e81662abf283e386bda1d7141ef277f70191 | JavaScript | 1,172 | 66 | var stream = require('stream')
var pump = require('./index')
var rs = new stream.Readable()
var ws = new stream.Writable()
rs._read = function (size) {
this.push(Buffer(size).fill('abc'))
}
ws._write = function (chunk, encoding, cb) {
setTimeout(function () {
cb()
}, 100)
}
var toHex = function () {
var... |
5c3415fe87961cffc503e9a1d74fe2cd4c0c2ec57b7ea4fef0a4b663f53e52b4 | JavaScript | 1,174 | 59 | 'use strict';
module.exports = balanced;
function balanced(a, b, str) {
if (a instanceof RegExp) a = maybeMatch(a, str);
if (b instanceof RegExp) b = maybeMatch(b, str);
var r = range(a, b, str);
return r && {
start: r[0],
end: r[1],
pre: str.slice(0, r[0]),
body: str.slice(r[0] + a.length, r[... |
9ba66a88a67f8f3c33545802f2f9188b0cb8947e5f244315f8b4cf54ed96bb8d | JavaScript | 1,175 | 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/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:functi... |
1e277a1cdda596747a7d3d7d7995b43eb104901ce9f0ecf234dc6e625e2ebe6b | JavaScript | 1,176 | 59 |
var n = 'rc'+Math.random()
var assert = require('assert')
process.env[n+'_envOption'] = 42
var config = require('../')(n, {
option: true
})
console.log(config)
assert.equal(config.option, true)
assert.equal(config.envOption, 42)
var customArgv = require('../')(n, {
option: true
}, { // nopt-like argv
option... |
21dbc3f1e63f2a95fd7dd1ef95ddce32f41f62c9daa098c37959206c87a67e7f | JavaScript | 1,182 | 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/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLo... |
185dda61f471c408be5f20f8da26a72a98a2b927d8be22aa21f9e398cffae6ba | JavaScript | 1,184 | 47 | describe('toBeFalsy', function() {
it("passes for 'falsy' values", function() {
const matcher = privateUnderTest.matchers.toBeFalsy();
let result;
result = matcher.compare(false);
expect(result.pass).toBe(true);
result = matcher.compare(0);
expect(result.pass).toBe(true);
result = match... |
c4598a00e91b93b7964bb874e8ceed6d614436335a7fd81aff7f504499e210dd | JavaScript | 1,186 | 47 | var clone = require('./clone');
module.exports = merge;
function typesMatch(a, b) {
return (typeof a === typeof b) && (Array.isArray(a) === Array.isArray(b));
}
/**
* A deep merge of the source based on the target.
* @param {Object} source [description]
* @param {Object} target [description]
* @return {O... |
224a6fd49ae789afa566bf1b4be051d118cf383d05c9340d6c1a23b5dcc1083b | JavaScript | 1,187 | 47 | describe('toBeTruthy', function() {
it("passes for 'truthy' values", function() {
const matcher = privateUnderTest.matchers.toBeTruthy();
let result;
result = matcher.compare(true);
expect(result.pass).toBe(true);
result = matcher.compare(1);
expect(result.pass).toBe(true);
result = mat... |
1e65ceff565db5417e2c7bedbbef68e3810e8825e582a2192ce79ee11ad7baf1 | JavaScript | 1,189 | 38 | var url = require('url')
var tunnel = require('tunnel-agent')
var noop = Object.assign({
http: function () {},
silly: function () {}
}, require('noop-logger'))
function applyProxy (reqOpts, opts) {
var log = opts.log || noop
var proxy = opts['https-proxy'] || opts.proxy
if (proxy) {
// eslint-disable-n... |
5f9353a28ab6edfa765d3f3c7c06b8e11e5f41c713e304bf18274ea76fcd24c3 | JavaScript | 1,193 | 66 | var expect = require('expect.js');
var port = require('../');
describe('Port Flags', function(){
it('should accept array (deprecated) and object for flags', function(done){
expect(
port.prototype.parseFlags(['-noprefs', '-nogui', '-path', __dirname, '-open', 'test-loadbang.pd'])
).to.eql(
port.prototyp... |
0c7e95ae755d47c497ea4b28dadcea9c9aacdf6b82a41372bcff4ac6cdecb232 | JavaScript | 1,195 | 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/ka",[],function(){return{errorLoading:function(){return"მონაცემების ჩატვირთვა შეუძლებელია."},inputTooLong:funct... |
766ca145b6d25e3d60f352a716e8fa1876bcdf362c0767c360cf24f335bc281e | JavaScript | 1,195 | 64 | 'use strict'
/**
* Expose `arrayFlatten`.
*/
module.exports = arrayFlatten
/**
* Recursive flatten function with depth.
*
* @param {Array} array
* @param {Array} result
* @param {Number} depth
* @return {Array}
*/
function flattenWithDepth (array, result, depth) {
for (var i = 0; i < array.length; i++... |
eaf588f4fbc5113f0c6fdf0ebb1c4639aac8006a61edfb786ef9623c0910dfab | JavaScript | 1,199 | 48 | var get = require('simple-get')
var util = require('./util')
var proxy = require('./proxy')
var noop = Object.assign({
http: function () {},
silly: function () {}
}, require('noop-logger'))
function findAssetId (opts, cb) {
var downloadUrl = util.getDownloadUrl(opts)
var apiUrl = util.getApiUrl(opts)
var log... |
bd7c66772e6357300aa5bb06913d52c360aac8eea0a6ae1d8f71c27d94257691 | JavaScript | 1,201 | 37 | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ParentNamespace = void 0;
const namespace_1 = require("./namespace");
class ParentNamespace extends namespace_1.Namespace {
constructor(server) {
super(server, "/_" + ParentNamespace.count++);
this.children = new Se... |
49e370bc8cba973eda93f68e7072f75bd826105a923722f4b97639d4941449b8 | JavaScript | 1,208 | 37 | describe('toMatch', function() {
it('passes when RegExps are equivalent', function() {
const matcher = privateUnderTest.matchers.toMatch();
const result = matcher.compare(/foo/, /foo/);
expect(result.pass).toBe(true);
});
it('fails when RegExps are not equivalent', function() {
const matcher = p... |
9777845f2cb234d1d8790d2e6173805512855a73fd9eab8cd207abffaaab1197 | JavaScript | 1,208 | 52 | getJasmineHtmlRequireObj().htmlReporterUtils = function(j$, private$) {
'use strict';
function createDom(type, attrs, childrenArrayOrVarArgs) {
const el = document.createElement(type);
let children;
if (Array.isArray(childrenArrayOrVarArgs)) {
children = childrenArrayOrVarArgs;
} else {
... |
3a0e65d854dca250e295732c04a9be05051586e558b5f83fa2d5523aa6e7cad6 | JavaScript | 1,211 | 38 | describe('Falsy', function() {
it('is true for an empty string', function() {
const falsy = new privateUnderTest.Falsy();
expect(falsy.asymmetricMatch('')).toBe(true);
expect(falsy.asymmetricMatch('')).toBe(true);
expect(falsy.asymmetricMatch('asdasdad')).toBe(false);
});
it('is false for a numb... |
d51e0c4e6265fa3f70303c44094d0a2c08541096d5087fb885648d55ea6999d8 | JavaScript | 1,211 | 42 | const encodePacket = require("./encodePacket");
const decodePacket = require("./decodePacket");
const SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text
const encodePayload = (packets, callback) => {
// some packets may be added to the array while encoding, so t... |
88564234b9eeb2f0fe2cc5d03f617a97eb4802f126bdd21aa223c3c87c02531c | JavaScript | 1,215 | 60 | /*!
* merge-descriptors
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module exports.
* @public
*/
module.exports = merge
/**
* Module variables.
* @private
*/
var hasOwnProperty = Object.prototype.hasOwnProperty
/**
* Merge the pr... |
6cc1e51fc16105de346fc48f26a663e5d4754955fe84d6cea9630099b944c443 | JavaScript | 1,222 | 45 | getJasmineRequireObj().Order = function() {
'use strict';
function Order(options) {
this.random = 'random' in options ? options.random : true;
const seed = (this.seed = options.seed || generateSeed());
this.sort = this.random ? randomOrder : naturalOrder;
function naturalOrder(items) {
retur... |
df8a4109190c18536003eab1192365fa88d50f184970c687193e003b73937aa0 | JavaScript | 1,226 | 44 | var parse = require('../');
var test = require('tape');
test('proto pollution', function (t) {
var argv = parse(['--__proto__.x','123']);
t.equal({}.x, undefined);
t.equal(argv.__proto__.x, undefined);
t.equal(argv.x, undefined);
t.end();
});
test('proto pollution (array)', function (t) {
var ... |
8d762862020064468b4af17e561ee1ee29d9d55311a1c19d958c4ff2be912963 | JavaScript | 1,230 | 51 | /**
* Module dependencies.
*/
var crypto = require('crypto');
/**
* Sign the given `val` with `secret`.
*
* @param {String} val
* @param {String} secret
* @return {String}
* @api private
*/
exports.sign = function(val, secret){
if ('string' != typeof val) throw new TypeError("Cookie value must be provided... |
2e04accc895647a5b7b8e0de3eb6df971b8c1d734b522cc753eb4934c5fb03ca | JavaScript | 1,236 | 55 | const utils = require('./utils');
const merge = utils.merge;
const bus = utils.bus;
const spawn = require('child_process').spawn;
module.exports = function spawnCommand(command, config, eventArgs) {
var stdio = ['pipe', 'pipe', 'pipe'];
if (config.options.stdout) {
stdio = ['pipe', process.stdout, process.std... |
4f1a5c2e61df86e63d9116daa45ca7da1e050d6829661dae53ad7740bafbe079 | JavaScript | 1,246 | 63 |
var test = require('tape')
var _JSON = require('../')
function clone (o) {
return JSON.parse(JSON.stringify(o))
}
var examples = {
simple: { foo: [], bar: {}, baz: new Buffer('some binary data') },
just_buffer: new Buffer('JUST A BUFFER'),
all_types: {
string:'hello',
number: 3145,
null: null,
... |
a3ceca5e4a5dfd2d406464c3c58138d39c9c3f5648cb997900f7b3f1f0c94e89 | JavaScript | 1,247 | 35 | describe('toBeRejected', function() {
it('passes if the actual is rejected', function() {
const matchersUtil = new privateUnderTest.MatchersUtil();
const matcher = privateUnderTest.asyncMatchers.toBeRejected(matchersUtil);
const actual = Promise.reject('AsyncExpectationSpec rejection');
return matche... |
50f10478098f06b77a58b351a93bb8fe7a7572bfbfb3e6f0bf668460865da3a7 | JavaScript | 1,249 | 43 | module.exports = command;
/**
* command constructs the executable command to run in a shell including the
* user script, the command arguments.
*
* @param {Object} settings Object as:
* { execOptions: {
* exec: String,
* [scr... |
720e68406fdebaf70ca93c6cf2af2f3a33f7e6ec03988831c9eaaa2a4bb94224 | JavaScript | 1,251 | 50 | 'use strict';
const pump = require('pump');
const bufferStream = require('./buffer-stream');
class MaxBufferError extends Error {
constructor() {
super('maxBuffer exceeded');
this.name = 'MaxBufferError';
}
}
function getStream(inputStream, options) {
if (!inputStream) {
return Promise.reject(new Error('Expe... |
3e64a2a35a97e41ff8c073299f07c3754d99b0a6e7d42faef7dc02d61d67757f | JavaScript | 1,260 | 53 | 'use strict';
var utils = require('../utils');
var add = require('./add');
var parse = require('./parse');
// exported
var rules = { ignore: [], watch: [] };
/**
* Loads a nodemon config file and populates the ignore
* and watch rules with it's contents, and calls callback
* with the new rules
*
* @param {Strin... |
0db8c804e8d5b02a1f7eff072d3d7701f2cc5db341074bbe1e4bdd6ca8e3aa95 | JavaScript | 1,269 | 48 | 'use strict'
var consoleControl = require('console-control-strings')
var renderTemplate = require('./render-template.js')
var validate = require('aproba')
var Plumbing = module.exports = function (theme, template, width) {
if (!width) width = 80
validate('OAN', [theme, template, width])
this.showing = false
th... |
4f67edd227c07ef2b913c6279c0e5feceeba67bd3d79c8b8def1000dc574bdbb | JavaScript | 1,277 | 44 | #!/usr/bin/env node
var nopt = require("../lib/nopt")
, types = { num: Number
, bool: Boolean
, help: Boolean
, list: Array
, "num-list": [Number, Array]
, "str-list": [String, Array]
, "bool-list": [Boolean, Array]
, str: String }
... |
c1d41b81ac59e3b4f21a5c2fb28ec63a3a664d750a696cef554affa0245e9841 | JavaScript | 1,291 | 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/bn",[],function(){return{errorLoading:function(){return"ফলাফলগুলি লোড করা যায়নি।"},inputTooLong:function(n){va... |
b7ff0e5958ba632dbd29a6eab3f975b0cd924ab8d4020653c1b4d7fe6d0c08bf | JavaScript | 1,292 | 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/cs",[],function(){function e(e,n){switch(e){case 2:return n?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"... |
a6bc1fbcd18c607f6c676a65477c159da95717e75a50588e5c9210aa6dc093ca | JavaScript | 1,295 | 51 | const { PACKET_TYPES_REVERSE, ERROR_PACKET } = require("./commons");
const decodePacket = (encodedPacket, binaryType) => {
if (typeof encodedPacket !== "string") {
return {
type: "message",
data: mapBinary(encodedPacket, binaryType)
};
}
const type = encodedPacket.charAt(0);
if (type === "b... |
ae538fdae683d6fa2e14579da06df10fb7a66378cfa50971956fb68c2c86c727 | JavaScript | 1,295 | 53 | // This is not the set of all possible signals.
//
// It IS, however, the set of all signals that trigger
// an exit on either Linux or BSD systems. Linux is a
// superset of the signal names supported on BSD, and
// the unknown signals just fail to register, so we can
// catch that easily enough.
//
// Don't bother w... |
f1ca6352fcd40a6a2b0779b310a6501d8118e43511ffed26b872f8ae4be8679b | JavaScript | 1,304 | 47 | getJasmineRequireObj().Any = function(j$, private$) {
'use strict';
function Any(expectedObject) {
if (typeof expectedObject === 'undefined') {
throw new TypeError(
'jasmine.any() expects to be passed a constructor function. ' +
'Please pass one or use jasmine.anything() to match any ob... |
3276d470fea9227b81cd35bf2ffc265d8f203cb18239c2b2cd01ed845908999a | JavaScript | 1,306 | 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/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyr... |
d2c6b99ce162fea0b36b83d69fa8ac7892b655b4662932a4f647e8f8f7bd386f | JavaScript | 1,310 | 51 | getJasmineRequireObj().toHaveBeenCalled = function(j$, private$) {
'use strict';
const getErrorMsg = private$.formatErrorMsg(
'<toHaveBeenCalled>',
'expect(<spyObj>).toHaveBeenCalled()'
);
/**
* {@link expect} the actual (a {@link Spy}) to have been called.
* @function
* @name matchers#toHave... |
e64a7b76050bb467485a4f3035b026c2ccd07cfc6242c86165d65f521384228b | JavaScript | 1,310 | 40 | getJasmineRequireObj().SkipAfterBeforeAllErrorPolicy = function(j$, private$) {
'use strict';
function SkipAfterBeforeAllErrorPolicy(queueableFns) {
this.queueableFns_ = queueableFns;
this.skipping_ = false;
}
SkipAfterBeforeAllErrorPolicy.prototype.skipTo = function(lastRanFnIx) {
if (this.skippi... |
9a47dd33a0b2f4b4973e808c85754635d79ead9b798566cde54dbef9110410b3 | JavaScript | 1,320 | 51 | getJasmineRequireObj().ExpectationFilterChain = function() {
'use strict';
function ExpectationFilterChain(maybeFilter, prev) {
this.filter_ = maybeFilter;
this.prev_ = prev;
}
ExpectationFilterChain.prototype.addFilter = function(filter) {
return new ExpectationFilterChain(filter, this);
};
... |
d629e417627fd3267eaa704f528225aa13b85ec318683cf49a1104c3173f20ac | JavaScript | 1,322 | 48 | const jasmineCore = require('jasmine-core');
jasmineCore.installGlobals();
const oldEnv = jasmine.getEnv();
jasmineCore.reset();
const newEnv = jasmine.getEnv();
if (!newEnv) {
throw new Error('no env after reset');
} else if (newEnv === oldEnv) {
throw new Error('got old env after reset');
}
// Verify that at ... |
e1ffb95e6ca3897434f540205a0cef48e01ceafb5940eed06df816bd8e4b483d | JavaScript | 1,322 | 53 | const { Transform } = require('stream')
/**
* A transform stream that uses a regular expression to split the incoming text upon.
*
* To use the `Regex` parser provide a regular expression to split the incoming text upon. Data is emitted as string controllable by the `encoding` option (defaults to `utf8`).
* @exten... |
7ae5f0bc4adc2af51c13aacd17e28ef6bfdd276721c08e3b5c16e32f893df01b | JavaScript | 1,334 | 61 | 'use strict'
const stringWidth = require('string-width')
function ansiAlign (text, opts) {
if (!text) return text
opts = opts || {}
const align = opts.align || 'center'
// short-circuit `align: 'left'` as no-op
if (align === 'left') return text
const split = opts.split || '\n'
const pad = opts.pad ||... |
7d326081e808ff4bd321e6982aaab2d1d2c2c9f148c6d7cc0038cd572b94f5aa | JavaScript | 1,340 | 53 | // the client script
var canvas = document.getElementById('osci'),
context = canvas.getContext('2d');
context.fillStyle = '#000';
context.fillRect(0, 0, canvas.width, canvas.height);
var socket = io.connect();
var blockWidth = canvas.width / 128,
touching = false;
function change(e){
if (touching && socket.sock... |
1b41cf245be7d3dd36b47870ae4a99ee6e32c312a3909af15285e44faa08a0a4 | JavaScript | 1,343 | 39 | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ParentNamespace = void 0;
const namespace_1 = require("./namespace");
class ParentNamespace extends namespace_1.Namespace {
constructor(server) {
super(server, "/_" + ParentNamespace.count++);
this.children = new Se... |
facaa3974bfa27c832a629735077528b59cbc088fcfd2c22bbacba152c76ef2a | JavaScript | 1,351 | 53 | #!/usr/bin/env node
'use strict';
const fs = require('fs');
const path = require('path');
const mimeScore = require('mime-score');
let db = require('mime-db');
let chalk = require('chalk');
const STANDARD_FACET_SCORE = 900;
const byExtension = {};
// Clear out any conflict extensions in mime-db
for (let type in d... |
4108c33d013a1832974b9731ab62518e4dcc183be38372337b1ef5661a276e3f | JavaScript | 1,357 | 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/ne",[],function(){return{errorLoading:function(){return"नतिजाहरु देखाउन सकिएन।"},inputTooLong:function(n){var e... |
5203e4492061b88ed3770601e05e060b9cc321e80d812b3f92f0e4bce49829c1 | JavaScript | 1,359 | 41 | // eslint-disable-next-line no-unused-vars
const getJasmineHtmlRequireObj = (function() {
'use strict';
const htmlRequire = {};
function getJasmineHtmlRequire() {
return htmlRequire;
}
htmlRequire.html = function(j$, private$) {
if (!private$) {
private$ = {};
}
private$.ResultsNode =... |
fa9e9b3f81a6de8848e446678ad4f86218e3c683d8086a285b9d8a9f0963f2c3 | JavaScript | 1,360 | 76 | /*!
* forwarded
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module exports.
* @public
*/
module.exports = forwarded
/**
* Get all addresses in the request, using the `X-Forwarded-For` header.
*
* @param {object} req
* @return {array}
* @public
*/
function f... |
42a7f91883d0c5ce9292dda4e017e1f8664d34b09276d89fb6f3859c29d1ca9b | JavaScript | 1,362 | 78 | /*!
* escape-html
* Copyright(c) 2012-2013 TJ Holowaychuk
* Copyright(c) 2015 Andreas Lubbe
* Copyright(c) 2015 Tiancheng "Timothy" Gu
* MIT Licensed
*/
'use strict';
/**
* Module variables.
* @private
*/
var matchHtmlRegExp = /["'&<>]/;
/**
* Module exports.
* @public
*/
module.exports = escapeHtml;
... |
7bed43418982b3a0cb58eaaa28bf2a93936cdc51a5701e6d716dc25a943cb62e | JavaScript | 1,369 | 46 | const { PACKET_TYPES } = require("./commons");
const withNativeBlob =
typeof Blob === "function" ||
(typeof Blob !== "undefined" &&
Object.prototype.toString.call(Blob) === "[object BlobConstructor]");
const withNativeArrayBuffer = typeof ArrayBuffer === "function";
// ArrayBuffer.isView method is not defined... |
35fb82a5b66049215b1b7ed1a081e9e43f9740017fdb7110f28d75327a328c8b | JavaScript | 1,387 | 53 | getJasmineRequireObj().CompleteOnFirstErrorSkipPolicy = function(j$, private$) {
'use strict';
function CompleteOnFirstErrorSkipPolicy(queueableFns) {
this.queueableFns_ = queueableFns;
this.erroredFnIx_ = null;
}
CompleteOnFirstErrorSkipPolicy.prototype.skipTo = function(lastRanFnIx) {
let i;
... |
a1a0af2439ed982d1efd8f854de2ab55199c3a6b15913254b3fb62720e777e88 | JavaScript | 1,387 | 51 | const tap = require('tap');
const test = tap.test;
const readFile = require('fs').readFileSync;
const spawn = require('child_process').spawn;
const pstree = require('../');
const { tree, pidsForTree, getStat } = require('../lib/utils');
if (process.platform !== 'darwin') {
test('reads from /proc', async (t) => {
... |
35f5b429ad69e5cd771687404e1df8ec958619292b7b1e47c5b884163ecd10e8 | JavaScript | 1,390 | 51 | describe('Exceptions:', function() {
let env;
beforeEach(function() {
env = new privateUnderTest.Env();
});
afterEach(function() {
env.cleanup_();
});
it('should handle exceptions thrown, but continue', async function() {
const secondTest = jasmine.createSpy('second test');
env.describe('... |
5b00a5b450b52b4c5d4432093665c20e62ad39126aed8da24cddc3e6c7871919 | JavaScript | 1,392 | 50 |
var seed = Math.random();
var n = 'rc'+ seed;
var N = 'RC'+ seed;
var assert = require('assert')
// Basic usage
process.env[n+'_someOpt__a'] = 42
process.env[n+'_someOpt__x__'] = 99
process.env[n+'_someOpt__a__b'] = 186
process.env[n+'_someOpt__a__b__c'] = 243
process.env[n+'_someOpt__x__y'] = 1862
process.env[n+'_s... |
bc9e2fb309b067655b6abbb764941ac48014366a3662db209cf0e9d0a4db54dd | JavaScript | 1,393 | 46 | 'use strict';
/* eslint-disable yoda */
module.exports = x => {
if (Number.isNaN(x)) {
return false;
}
// code points are derived from:
// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
if (
x >= 0x1100 && (
x <= 0x115f || // Hangul Jamo
x === 0x2329 || // LEFT-POINTING ANGLE BRACKET
x === 0x... |
5cb0a758da38434f1740a83530e0629c4ab20aac48a8c37dddc415b1439132ca | JavaScript | 1,398 | 53 | /*---------------Designed by Younes Valibeigi-------------*/
/*
for more info contact younes.valibeigi@mail.mcgill.ca
*/
console.log("Designed by Younes Valibeigi");
const t0 = performance.now();
define(['jquery',
'Abubu/Abubu.js'
],
function($,
Abubu,
) {
"use s... |
e9c8a5e11a677f59e1bbb8513f519eea22b443a88f9d33f71772be783311fed7 | JavaScript | 1,400 | 49 | module.exports = {
srcDir: 'src',
srcFiles: [
'core/requireCore.js',
'core/base.js',
'core/util.js',
'core/Spec.js',
'core/Env.js',
'core/PrettyPrinter.js',
'core/Suite.js',
'core/**/*.js',
'html/**/*.js',
'**/*.js',
'!boot/**.js',
'!core/requireSuffix.js',
'!html... |
d72147b24cf6b14dd8964d96e58977a5c965cd8f970fdb9a9d6260493e58b17a | JavaScript | 1,415 | 57 | 'use strict';
const fill = require('fill-range');
const utils = require('./utils');
const compile = (ast, options = {}) => {
let walk = (node, parent = {}) => {
let invalidBlock = utils.isInvalidBrace(parent);
let invalidNode = node.invalid === true && options.escapeInvalid === true;
let invalid = inval... |
76baf83317ac81045cefb9fcc8ec0d8e47dd0cfcbadd592f480349412e161861 | JavaScript | 1,421 | 79 | /*!
* depd
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module dependencies.
* @private
*/
var EventEmitter = require('events').EventEmitter
/**
* Module exports.
* @public
*/
lazyProperty(module.exports, 'callSiteToString', function callSiteToString () {
var... |
6d29d75e7e7bc9b9dddf7111a024db41410a0a7d36f90bf06e6be77d1366c03e | JavaScript | 1,428 | 65 | 'use strict'
var stringWidth = require('string-width')
exports.center = alignCenter
exports.left = alignLeft
exports.right = alignRight
// lodash's way of generating pad characters.
function createPadding (width) {
var result = ''
var string = ' '
var n = width
do {
if (n % 2) {
result += string;
... |
7be91bec803ce03bb8605c409818d91e25f740c136d13f2d1eef08b2be4b1333 | JavaScript | 1,444 | 57 | const { PACKET_TYPES_REVERSE, ERROR_PACKET } = require("./commons");
const withNativeArrayBuffer = typeof ArrayBuffer === "function";
let base64decoder;
if (withNativeArrayBuffer) {
base64decoder = require("base64-arraybuffer");
}
const decodePacket = (encodedPacket, binaryType) => {
if (typeof encodedPacket !==... |
80626386e94017e8950ab75791da258c1165867e49187ebf8c9f77b3e1da4478 | JavaScript | 1,444 | 60 | 'use strict';
const {constants: BufferConstants} = require('buffer');
const pump = require('pump');
const bufferStream = require('./buffer-stream');
class MaxBufferError extends Error {
constructor() {
super('maxBuffer exceeded');
this.name = 'MaxBufferError';
}
}
async function getStream(inputStream, options) ... |
5bf521d965cf0db72ee97f19cff36ce6cffc085fe25236ecda23d9b48eaf0917 | JavaScript | 1,445 | 42 | describe('toBeResolved', function() {
it('passes if the actual is resolved', function() {
const matchersUtil = new privateUnderTest.MatchersUtil();
const matcher = privateUnderTest.asyncMatchers.toBeResolved(matchersUtil);
const actual = Promise.resolve();
return matcher.compare(actual).then(function... |
6701d64b4ad395f30b07f8685c04c6d61ca9c98094d75d0b2e06687e2386910f | JavaScript | 1,463 | 46 | 'use strict';
var numberIsNan = require('number-is-nan');
module.exports = function (x) {
if (numberIsNan(x)) {
return false;
}
// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369
// code points are derived from:
// http://www.unix.org/Public/UNIDATA/EastAsia... |
9229620f1a04026cdf15928468012ae8f681124c1128048f75e499164252dc25 | JavaScript | 1,470 | 45 | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tls_1 = require("tls");
const deferToConnect = (socket, fn) => {
let listeners;
if (typeof fn === 'function') {
const connect = fn;
listeners = { connect };
}
else {
listeners = fn;
}
const... |
d4d363d8693e378d205426155b0e9f024215d828d13d15725c1728d87ea6975a | JavaScript | 1,470 | 52 | getJasmineRequireObj().toBeCloseTo = function() {
'use strict';
/**
* {@link expect} the actual value to be within a specified precision of the expected value.
* @function
* @name matchers#toBeCloseTo
* @since 1.3.0
* @param {Object} expected - The expected value to compare against.
* @param {Num... |
1dc2900bcc8ffc375af0d2fc99a03ecad2dcbb85d278fbf26982e87707bea53f | JavaScript | 1,483 | 58 | /* eslint-disable node/no-deprecated-api */
'use strict'
var buffer = require('buffer')
var Buffer = buffer.Buffer
var safer = require('./safer.js')
var Safer = safer.Buffer
var dangerous = {}
var key
for (key in safer) {
if (!safer.hasOwnProperty(key)) continue
dangerous[key] = safer[key]
}
var Dangereous = ... |
97cb576302f206d32ed834bc8bfc77b4cee0a2a6920229ac8b36307cba0b2dd5 | JavaScript | 1,489 | 100 |
function ParallelRunner() {
var self = this
var chainItems = []
var stopOnError = false
this.add = function() {
var func = arguments[0]
var args = []
for(var i=1; i < arguments.length ; i++) {
args.push(arguments[i])
}
chainItems.push(new ChainItem(func, args))
return t... |
295775bb53642fc852c8b3bbc83b623f522df9acebab944261e2804b6814c205 | JavaScript | 1,494 | 48 | describe('Empty', function() {
it('matches an empty object', function() {
const empty = new privateUnderTest.Empty();
expect(empty.asymmetricMatch({})).toBe(true);
expect(empty.asymmetricMatch({ undefined: false })).toBe(false);
});
it('matches an empty array', function() {
const empty = new pri... |
1aade4bd35df47ade393dad25d7aa3d70e381116f0fafbc7a378ebd971949262 | JavaScript | 1,503 | 58 | //TODO: handle reviver/dehydrate function like normal
//and handle indentation, like normal.
//if anyone needs this... please send pull request.
exports.stringify = function stringify (o) {
if('undefined' == typeof o) return o
if(o && Buffer.isBuffer(o))
return JSON.stringify(':base64:' + o.toString('base64')... |
7a4c19d1025d2669723dd2a939ced7d556d815eedfff62bf288970365b8b26dc | JavaScript | 1,503 | 53 | var cc = require('./lib/utils')
var join = require('path').join
var deepExtend = require('deep-extend')
var etc = '/etc'
var win = process.platform === "win32"
var home = win
? process.env.USERPROFILE
: process.env.HOME
module.exports = function (name, defaults, argv, parse) {
if('string' !==... |
be25b5d4bf26dc0049d109f7853a4f1166e74c5aa376fa739021f426a1a5351a | JavaScript | 1,508 | 58 | const Polling = require("./polling");
const qs = require("querystring");
const rDoubleSlashes = /\\\\n/g;
const rSlashes = /(\\)?\\n/g;
class JSONP extends Polling {
/**
* JSON-P polling transport.
*
* @api public
*/
constructor(req) {
super(req);
this.head = "___eio[" + (req._query.j || "").r... |
10b4d4a4e9d14e9e6a5ab7ced64405ef90e6bec94d479a8e223cbba88828ad79 | JavaScript | 1,512 | 77 | /*!
* depd
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module exports.
* @public
*/
module.exports = depd
/**
* Create deprecate for namespace in caller.
*/
function depd (namespace) {
if (!namespace) {
throw new TypeError('argument namespace is required')
}... |
b0ab8a51d18901499cd20c663b956b2e0938efb995da41ddb85a0b0ca8516b83 | JavaScript | 1,529 | 58 | describe('Player', function() {
let player;
let song;
beforeEach(function() {
player = new Player();
song = new Song();
});
it('should be able to play a Song', function() {
player.play(song);
expect(player.currentlyPlayingSong).toEqual(song);
// demonstrates use of custom matcher
ex... |
d58af21cb0518864d0c505742d1af71e5b5e1f142f4c0f27353aa0f431a616d4 | JavaScript | 1,529 | 62 | /* eslint-disable node/no-deprecated-api */
var buffer = require('buffer')
var Buffer = buffer.Buffer
// alternative to using Object.keys for old browsers
function copyProps (src, dst) {
for (var key in src) {
dst[key] = src[key]
}
}
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSl... |
518916ac734ad7e396a756b921665d834b9d7e8fdd711fa32929f9025c71aa05 | JavaScript | 1,531 | 43 | /*global URLify*/
'use strict';
{
const $ = django.jQuery;
$.fn.prepopulate = function(dependencies, maxLength, allowUnicode) {
/*
Depends on urlify.js
Populates a selected field with the values of the dependent fields,
URLifies and shortens the string.
de... |
e45d312347f020d99c6166b254bb22c278627bc651224257525bbe3bce86680e | JavaScript | 1,533 | 49 | const { Transform } = require('stream')
/**
* A transform stream that emits data each time a byte sequence is received.
* @extends Transform
* @summary To use the `Delimiter` parser, provide a delimiter as a string, buffer, or array of bytes. Runs in O(n) time.
* @example
const SerialPort = require('serialport')
c... |
aa4a4755d792048d9bffc19f24c8be89f89338e9fba52a580df8bdea18e243a5 | JavaScript | 1,543 | 54 | 'use strict'
var consoleControl = require('console-control-strings')
var ThemeSet = require('./theme-set.js')
var themes = module.exports = new ThemeSet()
themes.addTheme('ASCII', {
preProgressbar: '[',
postProgressbar: ']',
progressbarTheme: {
complete: '#',
remaining: '.'
},
activityIndicatorTheme... |
aa1abbd2d1f8f96922fe20b7f46a0209fd8a34f7f78b22380dbbbd89f5d02c5c | JavaScript | 1,553 | 55 | const { Transform } = require('stream')
/**
* Emit data every number of bytes
* @extends Transform
* @param {Object} options parser options object
* @param {Number} options.length the number of bytes on each data event
* @summary A transform stream that emits data as a buffer after a specific number of bytes are ... |
7b1262b1e2a04e55c5a8d14fcba1acdc65ef282997b9955e7d4e5213eeaef3a9 | JavaScript | 1,575 | 62 | describe('ResultsNode', function() {
it('wraps a result', function() {
const fakeResult = {
id: 123,
message: 'foo'
};
const node = new privateUnderTest.ResultsNode(fakeResult, 'suite', null);
expect(node.result).toBe(fakeResult);
expect(node.type).toEqual('suite');
});
it('can a... |
5bcc54acfb4aba65d50e2740f8db2888f1734de526659df491d564e731adb31b | JavaScript | 1,576 | 58 | getJasmineRequireObj().MismatchTree = function(j$, private$) {
'use strict';
/*
To be able to apply custom object formatters at all possible levels of an
object graph, DiffBuilder needs to be able to know not just where the
mismatch occurred but also all ancestors of the mismatched value in both
th... |
e28aba5e31302ac9a2d76beae4fc69009a3c431d40bb22a661af517df7e5b469 | JavaScript | 1,584 | 69 | 'use strict';
const path = require('path');
const fs = require('fs');
const {
globals,
installGlobals,
reset,
version
} = require('./jasmine-core/jasmine.js');
const rootPath = path.join(__dirname, 'jasmine-core');
const bootFiles = ['boot.js'];
const cssFiles = [];
const jsFiles = [];
const jsFilesToSkip = [... |
1d0a4e941c1504dcd9bc6cfbb77f7b44d93e56a29cba6f2ccebd78d501a51c16 | JavaScript | 1,586 | 60 | /*!
* encodeurl
* Copyright(c) 2016 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module exports.
* @public
*/
module.exports = encodeUrl
/**
* RegExp to match non-URL code points, *after* encoding (i.e. not including "%")
* and including invalid escape sequences.
* @private
*/
var ENC... |
0115a2da3c26754dbdcb9919faf27f6d96144aa529c7b5182ae39ae3babde2cd | JavaScript | 1,593 | 57 | 'use strict';
module.exports = {
MAX_LENGTH: 1024 * 64,
// Digits
CHAR_0: '0', /* 0 */
CHAR_9: '9', /* 9 */
// Alphabet chars.
CHAR_UPPERCASE_A: 'A', /* A */
CHAR_LOWERCASE_A: 'a', /* a */
CHAR_UPPERCASE_Z: 'Z', /* Z */
CHAR_LOWERCASE_Z: 'z', /* z */
CHAR_LEFT_PARENTHESES: '(', /* ( */
CHAR_RI... |
b59d67ec44ca74fcaa8ade736ec9ae5f62848a5c208cedf81da51eb818a30b21 | JavaScript | 1,593 | 67 | var parse = require('../');
var test = require('tape');
test('numeric short args', function (t) {
t.plan(2);
t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] });
t.deepEqual(
parse([ '-123', '456' ]),
{ 1: true, 2: true, 3: 456, _: [] }
);
});
test('short', function (t) {
t.deepEqua... |
abaef53ebcdc98f3655331f834986a2d11b6a824f58d670369669246d1b7b69b | JavaScript | 1,614 | 67 |
/**
* Module exports.
*/
module.exports = deprecate;
/**
* Mark that a method should not be used.
* Returns a modified function which warns once by default.
*
* If `localStorage.noDeprecation = true` is set, then it is a no-op.
*
* If `localStorage.throwDeprecation = true` is set, then deprecated functions
... |
6f1bacc8b7264ac68f2c323f1b3207113739cacb0b1ad583c7ceb75c98bd5f25 | JavaScript | 1,616 | 52 | const { Transform } = require('stream')
/**
* Parse the CCTalk protocol
* @extends Transform
* @summary A transform stream that emits CCTalk packets as they are received.
* @example
const SerialPort = require('serialport')
const CCTalk = require('@serialport/parser-cctalk')
const port = new SerialPort('/dev/ttyUSB... |
92eb2f6b68ea7eb9ea1459e86149e7f0b5d32f0ef0e19964d8a8e32e1e7c2291 | JavaScript | 1,625 | 50 | var test = require('tape')
var toBuffer = require('../')
test('convert to buffer from Uint8Array', function (t) {
if (typeof Uint8Array !== 'undefined') {
var arr = new Uint8Array([1, 2, 3])
arr = toBuffer(arr)
t.deepEqual(arr, Buffer.from([1, 2, 3]), 'contents equal')
t.ok(Buffer.isBuffer(arr), 'is... |
14475641ec1d85dcbf95e2555fedb04bf02f8482e08822a5a09b01ddc6389f5f | JavaScript | 1,630 | 39 | // Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modi... |
93232ac2c7227e78fc4c9692abc205eb63083c2f56cb6fed1631287dd192a9a0 | JavaScript | 1,648 | 61 | const Player = require('../../lib/jasmine_examples/Player');
const Song = require('../../lib/jasmine_examples/Song');
describe('Player', function() {
let player;
let song;
beforeEach(function() {
player = new Player();
song = new Song();
});
it('should be able to play a Song', function() {
play... |
7361c7eda3cd146c313b3690440d9e92146f674e9111fc7e3be7a6ddb5c67bc4 | JavaScript | 1,654 | 45 | describe('toBePending', function() {
it('passes if the actual promise is pending', function() {
const matchersUtil = new privateUnderTest.MatchersUtil();
const matcher = privateUnderTest.asyncMatchers.toBePending(matchersUtil);
const actual = new Promise(function() {});
return matcher.compare(actual)... |
7f80ae91b8c15b0f80240f7caa74222b79b61d1dfff68c3a4a2714809e3fecbe | JavaScript | 1,660 | 50 | describe('NotEmpty', function() {
it('matches a non empty object', function() {
const notEmpty = new privateUnderTest.NotEmpty();
expect(notEmpty.asymmetricMatch({ undefined: false })).toBe(true);
expect(notEmpty.asymmetricMatch({})).toBe(false);
});
it('matches a non empty array', function() {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.