sha256 stringlengths 64 64 | language stringclasses 25
values | size int32 1 210k | lines int32 1 9.41k | content stringlengths 1 200k |
|---|---|---|---|---|
23fc5e01ff4e422938e717e205ee139e15d78771f706ed88f9f2fd222ad0ebd5 | Java | 3,343 | 119 | package LUDOSimulator;
import java.util.Random;
import java.util.Hashtable;
public class AnIPlay implements LUDOPlayer {
LUDOBoard board;
Random rand;
int playCnter;
Hashtable moveTable = new Hashtable();
Double change = 0.05;
public AnIPlay(LUDOBoard board) {
this.board = board;
rand = new... |
b2d9aa3fac1ecb51941b585ed7c5020b5d641a63fb28d1e78afcc7e739ebd98a | Java | 4,187 | 138 | /*
* IJ BAR: https://github.com/tferr/Scripts
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation
* (http://www.gnu.org/licenses/gpl.txt).
* This program is distributed in the hope that it will... |
17964086b414cd5b181ed05f5b538e38c11f5e0a504776dc5863a3157e361764 | Java | 4,501 | 135 | /*
* IJ BAR: https://github.com/tferr/Scripts
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation
* (http://www.gnu.org/licenses/gpl.txt).
* This program is distributed in the hope that it will... |
819c2890fc0c4ca7aceebe0294cb99127f8d347b972c58a242dc9e5003d0bb51 | Java | 6,027 | 188 | package bar;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.CopyOption;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.Collection;
import net.imagej.Ima... |
d395e96ec9798edb6b35717a3c73cf3ebc265afa21ee8f6afe009ba7a3066ba9 | Java | 8,806 | 221 | /*
* IJ BAR: https://github.com/tferr/Scripts
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation
* (http://www.gnu.org/licenses/gpl.txt).
* This program is distributed in the hope that it will... |
dda036f30a275892ddfe107f5fe3feadef21ee23140889d5eadb3db92922d86b | Java | 9,852 | 314 | /*
* IJ BAR: https://github.com/tferr/Scripts
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation
* (http://www.gnu.org/licenses/gpl.txt).
* This program is distributed in the hope that it will... |
74c36a374964f6dc180d5f42f7b61d39412aacdd4ad2727f9e54f3128b48b5db | Java | 9,937 | 351 | package bar;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
import java.util.Map;
import java.util.concurrent.Future;
import net.imagej.ImageJ;
import org.scijava.Context;
import org.scijava.command.Command;
i... |
9ccda8d2f84e197b5a9a476825f12667d39f67ecaf9dfb217d2f4a8a68f73b26 | Java | 10,460 | 342 | /*
* IJ BAR: https://github.com/tferr/Scripts
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation
* (http://www.gnu.org/licenses/gpl.txt).
* This program is distributed in the hope that it will... |
173e290d2b5b1c13299deca052bdbf3641146d19dade807aac1473b41e56c0d7 | Java | 12,528 | 424 | /*
* IJ BAR: https://github.com/tferr/Scripts
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation (http://www.gnu.org/licenses/gpl.txt).
* This program is distributed in the hope that it will... |
06319989c540a5c780a3841f906a9ad093fac33bd83c09395acd6af9865fb66e | Java | 28,348 | 861 | /*
* IJ BAR: https://github.com/tferr/Scripts
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation
* (http://www.gnu.org/licenses/gpl.txt).
* This program is distributed in the hope that it will... |
7321c15409782fbe9e6e9ba1646601d5772c239ceb42cf520f83ccf0d1efeae4 | Java | 32,347 | 956 | package bar;
import java.awt.datatransfer.DataFlavor;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.io.Reader;
/**
* This class makes it easy to drag and drop files from the operating system to
* a Java program. Any <tt>java.awt.Component</tt... |
712107d4c3c1611d90f608ecc6207cbaeb05a2f557103ed933de548c7bced9b7 | Java | 38,457 | 1,211 | /*
* IJ BAR: https://github.com/tferr/Scripts
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation
* (http://www.gnu.org/licenses/gpl.txt).
* This program is distributed in the hope that it will... |
ddc42a71ca78d835ec1329320bc1b392794ec156bda3107a220f3028cca0122b | Java | 77,504 | 2,518 | /*
* IJ BAR: https://github.com/tferr/Scripts
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation
* (http://www.gnu.org/licenses/gpl.txt).
* This program is distributed in the hope that it will... |
3ece9f0f801112d4c22d18d7e97764fcfb4af067083eaf3ec1a00f86e02c087d | JavaScript | 29 | 1 | globalThis.specHelpers = {};
|
e7e63ce301372ffa4c70440ea334cc2134339272ae68096e013857344e2d14d2 | JavaScript | 30 | 3 | list_orig = [
"_orig.jpg",
];
|
e8c835f7fb286526e003e532316302235ba202603797198e85630ab1ae0545e2 | JavaScript | 30 | 3 | list_fake = [
"_fake.jpg",
];
|
1e7903927df33aadb3659ecce55266c9c851da65ce6c8b723a60a305c1c5422c | JavaScript | 36 | 1 | module.exports = require('stream');
|
95111d84575ab36b697d760e130d722daea3d322cf56612f2ae67c7b3e8cef19 | JavaScript | 38 | 1 | module.exports = require('./nodemon'); |
b575b19b26a6c95048bbb9372440d1a37178a2d4e9ea98115f27121fa804d7ce | JavaScript | 38 | 1 | module.exports = require('constants')
|
996b381f353555cb172ebb2802bb2a7323442ff67b7b530cc26834058d7f31a2 | JavaScript | 40 | 1 | module.exports = require('./src/node');
|
51c1dae166a7da3717cc50ba36118c12f5351ff07a7d23d6dd53828bd857f5b6 | JavaScript | 41 | 1 | exports.download = require('./download')
|
16475035143997e924dc3f41af6fd657cf55c5843f415f00b155c20891da8a5b | JavaScript | 46 | 1 | module.exports = require('./readable').Duplex
|
3589a8446276886aa54f8dda47d0d12be90fb167925559fab4a906ddfca6f91f | JavaScript | 47 | 1 | module.exports = require('./lib/deep-extend');
|
155f794c5c789568b7bc632cd37f28b9064890e887bfab96a4393100218d4230 | JavaScript | 49 | 1 | module.exports = require('./readable').Transform
|
72d46a15491627d8fb1489a47d03583cfe5c21902918016ab532b53e615e5a9a | JavaScript | 49 | 1 | module.exports = require('events').EventEmitter;
|
809dbc03b4c312355ff74eb14b2ccc77267ee71e04f519f437eb4b203407c4b7 | JavaScript | 51 | 1 | module.exports = require('./readable').PassThrough
|
b492b180e158a495afa7b394de1440e037c5d60524bb2fce839aeb690e6ff968 | JavaScript | 53 | 1 | module.exports = require('./lib/_stream_duplex.js');
|
5b2859ec9677f14e6499b135b2e05a083fd2a1afce18175ac0658bc9d4c49774 | JavaScript | 54 | 1 | module.exports = require('./binary-extensions.json');
|
427bae9a6a026082e46acb500da48b270234ebc2a1ded1315b49eccfa6311c61 | JavaScript | 55 | 1 | module.exports = require('./lib/_stream_writable.js');
|
c32b11511aba771a4c6765de2c73be416f205316ca9f37283170627e778e8d65 | JavaScript | 55 | 1 | console.log(require('path').relative('.', __dirname));
|
e1bf087a1d609af29278aa41f50093967bfd311163558d9c096743df50508e42 | JavaScript | 55 | 3 | 'use strict'
module.exports = require('ci-info').isCI
|
5695ff5dfcd5a338a40630bd506056f2950bcb08fe1cc068519cbbfe60add480 | JavaScript | 60 | 3 | 'use strict';
module.exports = require('./lib/picomatch');
|
0018c44a4f4577ed7e94b66d768eab3a822bc96fda9131cfb7e4dea99eb1b9b0 | JavaScript | 65 | 1 | module.exports = require('fs').constants || require('constants')
|
03b3defae5a0801f91bc78f5f3ff2b13dec13df4cef4c0a94554b2d1183da1d1 | JavaScript | 67 | 5 | 'use strict';
module.exports = {
stdout: false,
stderr: false
};
|
30d70e15175f8b39f7a63d3ebffaced210eeb41ca3085cd229542f43c58ae946 | JavaScript | 69 | 2 | var argv = require('../')(process.argv.slice(2));
console.log(argv);
|
34e06901c785d3220c276f45a32603bc8b7a183815f831b0025fdf5ff8aab138 | JavaScript | 70 | 4 | #!/usr/bin/env node
'use strict'
process.exit(require('./') ? 0 : 1)
|
acddb0df1763bc79e1065659c2ea8a32a4512b46b902388946752e6e56967173 | JavaScript | 70 | 3 | module.exports = {
extends: ['@commitlint/config-conventional'],
};
|
0db9eceef5224dbc34c224c398b50eef4b99f937c80c81f660928615a248ed4f | JavaScript | 72 | 2 | exports.extract = require('./extract')
exports.pack = require('./pack')
|
ba6d0d0fc971c7ee6c83cfa566a192689c3538669a2f9ec13aefe0117bb2e7cd | JavaScript | 76 | 3 | getJasmineRequireObj().version = function() {
return '<%= version %>';
};
|
0b562b8dfe8b86a9b4c74c9fb3f311262f29e71e6b758223f5dcc332a9fc3377 | JavaScript | 80 | 4 | (function() {
'use strict';
getJasmineHtmlRequireObj().html(jasmine);
})();
|
d810ca4739cc60876ce8fe5ca755b478cf68c0400cf7fe6518169230a6a94f5e | JavaScript | 81 | 7 | 'use strict';
require('./parse');
require('./stringify');
require('./utils');
|
ae6aa905876623b7774309fa69f6fb23924760fe2fc2db63a514a468d4b8d8f8 | JavaScript | 82 | 4 | 'use strict';
module.exports = Number.isNaN || function (x) {
return x !== x;
};
|
cc16aeb163da6cc7746bf5ced2d11f1436e458c7ee803241e9a9fa1d107450fd | JavaScript | 82 | 4 | module.exports = {
run: require('./run'),
watch: require('./watch').watch,
};
|
49c7d074d71ff616a15fefad595347beabe400e8cb5f62c6fc3212a16b4942ef | JavaScript | 84 | 3 | const buildDistribution = require('./lib/buildDistribution');
buildDistribution();
|
742bd2d12a7786e595955c8a846dbefe88591df39c2659491bddadbb8ed7dae6 | JavaScript | 89 | 3 | 'use strict'
// this exists so we can replace it during testing
module.exports = process
|
30a8b51155eab7915c1b77a4f75d9c96fbdff702296c43f3275efffe33f81df3 | JavaScript | 92 | 5 | (function() {
specHelpers.callerFilenameShim = function(fn) {
return fn();
};
})();
|
d4897228fa19f8b23e353331990ade0ed9ec285e5ec051288cbc737f315cfeb6 | JavaScript | 92 | 3 | var github = require('../');
var url = github(require('./package.json'));
console.log(url);
|
19d2fa52118a39a7810efeb7bce45418f3e55ee7b445c85811d07a2f73b7bbb7 | JavaScript | 93 | 3 | 'use strict'
// this exists so we can replace it during testing
module.exports = setInterval
|
4b4404c7bd6f66a2175cb7a29c60ce4395c055775ec45eaa35af4357656f604f | JavaScript | 101 | 3 | module.exports = function () {
throw new Error('Readable.from is not available in the browser')
};
|
4ddb202944fd4e556edc68107b1a1f33dd25f1910876d2bf04eb5a58ae060c9d | JavaScript | 105 | 5 | 'use strict'
module.exports = function spin (spinstr, spun) {
return spinstr[spun % spinstr.length]
}
|
82383f5748af5f9380dbcde8f0166088614bf024e25bdbe073bb87cd385336ba | JavaScript | 109 | 4 | #! /usr/bin/env node
var rc = require('./index')
console.log(JSON.stringify(rc(process.argv[2]), false, 2))
|
47faea50fc6ac8f9d214aefde94f2df6c1772b520fb5570ec87bf5b8c476005b | JavaScript | 122 | 4 | 'use strict';
const cryptoRandomString = require('crypto-random-string');
module.exports = () => cryptoRandomString(32);
|
9a86a29fa34a99b861e707345fb1d1e2e55a6c23edb8f992bed57cc607f42d8e | JavaScript | 123 | 6 |
/**
* For Node.js, simply re-export the core `util.deprecate` function.
*/
module.exports = require('util').deprecate;
|
136d97929bca1d7168faa67d8a13c4216843a9cebc7275154fda0c73074837f5 | JavaScript | 125 | 6 | class Song {
persistFavoriteStatus(value) {
// something complicated
throw new Error('not yet implemented');
}
}
|
fea630ed4a4f17aeec4132f66db7512a6af1ff46e793df448875d5cd40439c90 | JavaScript | 130 | 8 |
module.exports = {
SerialRunner : require("./lib/SerialRunner"),
ParallelRunner : require("./lib/ParallelRunner")
}
|
0d8fec9bf904bb3d1735aec578b8aeddedf158b49d906448f7bd482e45260120 | JavaScript | 132 | 10 | 'use strict';
module.exports = [
'beforeError',
'init',
'beforeRequest',
'beforeRedirect',
'beforeRetry',
'afterResponse'
];
|
9b8c691372802da788c9c5f4e1ca2f1ed0b88ab8722176c2aea15e38ec86d249 | JavaScript | 132 | 5 | var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
|
4f7d04b4a6bc061cbd3a0abd1e0c383a7b52887e60402facfb026c22a40b05ac | JavaScript | 134 | 4 | 'use strict';
const is = require('@sindresorhus/is');
module.exports = body => is.nodeStream(body) && is.function(body.getBoundary);
|
0f78062e714965d168fb51f1cb507aa95dd6270b563d04679adf2506245a62b3 | JavaScript | 135 | 4 | 'use strict';
module.exports = function () {
return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
};
|
a2532ace32711ae90deb4ae4654c5bc4e56f0a1e21bdd15ba26334bf723dfb09 | JavaScript | 136 | 11 | /*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* MIT Licensed
*/
/**
* Module exports.
*/
module.exports = require('./db.json')
|
6c04801604d01bcc3c9b6db980749bdbd543205af5fef979e6adfc4a835b66c5 | JavaScript | 137 | 7 |
// when this is loaded into the browser,
// just use the defaults...
module.exports = function (name, defaults) {
return defaults
}
|
90dbb2e127d9b971731b2094b2516a463243e4074367dd4129fe2849ef598514 | JavaScript | 139 | 7 | 'use strict'
var process = require('./process')
try {
module.exports = setImmediate
} catch (ex) {
module.exports = process.nextTick
}
|
0833a3eed3b0075f23e58f0107bebdedec6db53b4e7b1034d7ea7c9cfb932b0b | JavaScript | 144 | 6 | 'use strict';
module.exports = value => {
const type = typeof value;
return value !== null && (type === 'object' || type === 'function');
};
|
e425ba02d6d19e25fe9b1e293c96d5331fb82bf661bcd79c39a410623949e4fd | JavaScript | 149 | 8 | class Song {
persistFavoriteStatus(value) {
// something complicated
throw new Error('not yet implemented');
}
}
module.exports = Song;
|
f8691b2f01b77334e33bb6898d69c80dc05b18e4be66760c476331a388f9cd27 | JavaScript | 149 | 8 | #!/usr/bin/env node
var mime = require('./mime.js');
var file = process.argv[2];
var type = mime.lookup(file);
process.stdout.write(type + '\n');
|
c841502a9cbac7dda28d2c6b1bad456b50debdbc106540657fad13ba635826df | JavaScript | 150 | 4 | 'use strict';
const ansiRegex = require('ansi-regex');
module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
|
bf37cd692bf030c2ec270945bc26aa8b19ad379fa5916f12304758f709ab0978 | JavaScript | 154 | 4 | 'use strict';
const ansiRegex = require('ansi-regex');
module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
|
2954bb915ae26ba911fc8ebc2c6264e9a2f1dc644c066777bd2a12bd81dbb309 | JavaScript | 160 | 11 | 'use strict';
const {Readable} = require('stream');
module.exports = input => (
new Readable({
read() {
this.push(input);
this.push(null);
}
})
);
|
02abcd70c31523c8c34ffaa7222629ae14b12ccd425e49ffa964a5051614691c | JavaScript | 161 | 6 | 'use strict';
var ansiRegex = require('ansi-regex')();
module.exports = function (str) {
return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
};
|
7a427679a9b245f02d66bb09aeaa5337bdff29375d05f3f34e7133b61001bb69 | JavaScript | 163 | 4 | 'use strict'
exports.TrackerGroup = require('./tracker-group.js')
exports.Tracker = require('./tracker.js')
exports.TrackerStream = require('./tracker-stream.js')
|
c0e356f0851fd141a0e2c1848e44e80ea3d8aea4adbf44c4c6efaeb55f7a52bd | JavaScript | 167 | 6 | 'use strict';
const cliBoxes = require('./boxes.json');
module.exports = cliBoxes;
// TODO: Remove this for the next major release
module.exports.default = cliBoxes;
|
ffd5fbdaf966b799cd9d046624be96b48e206920e58ad52d2ed1f2bdd10e93d0 | JavaScript | 171 | 6 | var concatMap = require('../');
var xs = [ 1, 2, 3, 4, 5, 6 ];
var ys = concatMap(xs, function (x) {
return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
});
console.dir(ys);
|
010da44addea1d88b2b732540c3f1fd0cbcb28926b96623d4c64222e0ead2d0e | JavaScript | 176 | 8 | 'use strict';
module.exports = function () {
throw new Error(
'ws does not work in the browser. Browser clients must use the native ' +
'WebSocket object'
);
};
|
a7b40f46216d06cbe2b183e35a666e8932758d7cd70c66aa403e48dd0b750ee7 | JavaScript | 178 | 10 | 'use strict';
module.exports = object => {
const result = {};
for (const [key, value] of Object.entries(object)) {
result[key.toLowerCase()] = value;
}
return result;
};
|
c3e3e14aa9030c203ad41030596ed6a1958bc85515608668bc80cfb796c1498c | JavaScript | 191 | 8 | var parse = require('../');
var test = require('tape');
test('whitespace should be whitespace' , function (t) {
t.plan(1);
var x = parse([ '-x', '\t' ]).x;
t.equal(x, '\t');
});
|
7af9a5f76c00f72bed44b83824a8acd67febcfd3d34fd293c20c35aa7e6657f6 | JavaScript | 192 | 7 | try {
var util = require('util');
if (typeof util.inherits !== 'function') throw '';
module.exports = util.inherits;
} catch (e) {
module.exports = require('./inherits_browser.js');
}
|
809060c18ca8dce6235bc25e71b467e9b9bcf8e8cc3b4ad3a9acad56c21293a4 | JavaScript | 208 | 8 | describe('nothing', function() {
it('should pass', function() {
const matcher = privateUnderTest.matchers.nothing();
const result = matcher.compare();
expect(result.pass).toBe(true);
});
});
|
cb3197cc93dea8c87f95def58797c8b544ba1d780ec8591133147b224e1e8a34 | JavaScript | 208 | 11 | 'use strict';
module.exports = function (obj) {
var ret = {};
var keys = Object.keys(Object(obj));
for (var i = 0; i < keys.length; i++) {
ret[keys[i].toLowerCase()] = obj[keys[i]];
}
return ret;
};
|
8f4e02eef6ccc43f2b7448c18ae209281c8e9af9807cad491df67450e3817a95 | JavaScript | 211 | 11 | 'use strict';
var stringify = require('./stringify');
var parse = require('./parse');
var formats = require('./formats');
module.exports = {
formats: formats,
parse: parse,
stringify: stringify
};
|
586d0220463526ec46abd9a458e4c946124f9df915b97817fc2f49cdf6cd5101 | JavaScript | 220 | 7 | 'use strict';
const ansiRegex = require('ansi-regex');
const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
module.exports = stripAnsi;
module.exports.default = stripAnsi;
|
4d2f5afc192178c5b0dc418d2da5826d52a8b6998771b011aede7fdba9118140 | JavaScript | 224 | 11 | /*!
* express
* Copyright(c) 2009-2013 TJ Holowaychuk
* Copyright(c) 2013 Roman Shtylman
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict';
module.exports = require('./lib/express');
|
74cbbdc5d60e1ee6560d2850515b68c3d6b39d9b2f32346aac1386b031c2a661 | JavaScript | 229 | 8 | var Stream = require("stream")
var Writable = require("./lib/_stream_writable.js")
if (process.env.READABLE_STREAM === 'disable') {
module.exports = Stream && Stream.Writable || Writable
} else {
module.exports = Writable
}
|
5a8bf7ca559a96af942fd4e621b66926c5fdd2ed71b6f6dc9a8238101593b60c | JavaScript | 230 | 10 | describe('performance', function() {
for (let i = 0; i < 10000; i++) {
it('should pass', function() {
expect(true).toBe(true);
});
it('should fail', function() {
expect(true).toBe(false);
});
}
});
|
9302a7612bfe5080d8830dc61ba0b23a768ef35ead8dd64dac02c39b0eb2c255 | JavaScript | 230 | 8 | const SerialPort = require('@serialport/stream')
const Binding = require('@serialport/binding-mock')
const parsers = require('./lib/parsers')
SerialPort.Binding = Binding
SerialPort.parsers = parsers
module.exports = SerialPort
|
cf2ea929f2d84fb429946a95362ec674fd7774fc8cdae0f83092eedc3ec1c772 | JavaScript | 231 | 5 | module.exports = function (scope, npmrc) {
var rc = npmrc || require('rc')('npm', { registry: 'https://registry.npmjs.org/' })
var url = rc[scope + ':registry'] || rc.registry
return url.slice(-1) === '/' ? url : url + '/'
}
|
0c24eb30ec9493bba5707894519c8eefac8d48406913d65dd7034dc69925c41a | JavaScript | 238 | 9 | var parse = require('../');
var test = require('tape');
test('parse with modifier functions' , function (t) {
t.plan(1);
var argv = parse([ '-b', '123' ], { boolean: 'b' });
t.deepEqual(argv, { b: true, _: [123] });
});
|
afac5b9e0f7ba381af21a403254299e075a714948d144c6f6b8dccee9c9188c0 | JavaScript | 239 | 7 | 'use strict';
const path = require('path');
const binaryExtensions = require('binary-extensions');
const extensions = new Set(binaryExtensions);
module.exports = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase());
|
4bae318ed00ef240ceae9155175aded6833e6470669cde424a59dcb756f65d43 | JavaScript | 245 | 14 | var undefsafe = require('undefsafe');
var object = {
a: {
b: {
c: 1,
d: [1, 2, 3],
e: 'remy'
}
}
};
console.log(undefsafe(object, 'a.b.e')); // "remy"
console.log(undefsafe(object, 'a.b.not.found')); // undefined
|
bb380f32bef5feb18678f0f45f88073fed5d7a0069a309132cb2080cd553d5c7 | JavaScript | 250 | 9 | try {
var util = require('util');
/* istanbul ignore next */
if (typeof util.inherits !== 'function') throw '';
module.exports = util.inherits;
} catch (e) {
/* istanbul ignore next */
module.exports = require('./inherits_browser.js');
}
|
8b238f1de62bb2a7b35a9e6b0364a64ce0f357cb63251580ff5a25429712e1d1 | JavaScript | 252 | 7 | module.exports = function (blocking) {
[process.stdout, process.stderr].forEach(function (stream) {
if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') {
stream._handle.setBlocking(blocking)
}
})
}
|
4f5fa14015175c39bd0f89222c316be12dc7851c0d55d625b1e3835d73a5f1a7 | JavaScript | 253 | 10 | 'use strict';
module.exports = () => {
const pattern = [
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
].join('|');
return new RegExp(pattern, 'g');
};
|
a6778e0372666eaef21bafabd2ea59c90fc76c3225599d3d372ae1c2f2bc6a2c | JavaScript | 253 | 10 | 'use strict';
const crypto = require('crypto');
module.exports = length => {
if (!Number.isFinite(length)) {
throw new TypeError('Expected a finite number');
}
return crypto.randomBytes(Math.ceil(length / 2)).toString('hex').slice(0, length);
};
|
79e9407fdf956a709aeb3cdb06e3a3253f899e01f0e4a266298a2ab735098c2e | JavaScript | 259 | 25 |
/**
* Methods.
*/
var methods = [
'debug',
'info',
'warn',
'error',
'critical',
'alert',
'emergency',
'notice',
'verbose',
'fatal'
];
/**
* Expose methods.
*/
methods.forEach(function(method){
exports[method] = function(){};
});
|
5e814ca196ff403a42fe5ab90c7555325496841f410ae6a35b1f0aa6415364e7 | JavaScript | 263 | 14 | const PARSERS = [/USB\\(?:.+)\\(.+)/, /FTDIBUS\\(?:.+)\+(.+?)A?\\.+/]
module.exports = pnpId => {
if (!pnpId) {
return null
}
for (const parser of PARSERS) {
const sn = pnpId.match(parser)
if (sn) {
return sn[1]
}
}
return null
}
|
70bfbbfcb3ecef93303f8adcde7e2108418cb2c2abca85c13863a3611715281c | JavaScript | 263 | 13 | getJasmineRequireObj().NullDiffBuilder = function(j$, private$) {
'use strict';
return function() {
return {
withPath: function(_, block) {
block();
},
setRoots: function() {},
recordMismatch: function() {}
};
};
};
|
9a34fedeb2d269c46ed94e6f13039eb0d16d866dd460ec66fa3acd78122fa9fe | JavaScript | 263 | 10 | /**
* Detect Electron renderer process, which is node, but we should
* treat as a browser.
*/
if (typeof process !== 'undefined' && process.type === 'renderer') {
module.exports = require('./browser.js');
} else {
module.exports = require('./node.js');
}
|
b757374f888588cd633d084932ba144ab714da8930ef49d9cfc3c33858286120 | JavaScript | 264 | 8 | beforeEach(function() {
// env is stateful. Ensure that it, and its global error event listeners,
// do not leak between tests.
if (privateUnderTest.currentEnv_) {
privateUnderTest.currentEnv_.cleanup_();
privateUnderTest.currentEnv_ = null;
}
});
|
e6337ddf852bd8654a5c135592f1c13e9a324d87340006f0d393f47b0bca14c9 | JavaScript | 264 | 12 | function decodeBase64 (base64) {
return Buffer.from(base64, 'base64').toString('utf8')
}
function encodeBase64 (string) {
return Buffer.from(string, 'utf8').toString('base64')
}
module.exports = {
decodeBase64: decodeBase64,
encodeBase64: encodeBase64
}
|
2c2e8f6abbb7c2314d5736ef0a8d11f04ddc3cf4faf1c710df5d75c4170e937e | JavaScript | 268 | 10 | 'use strict';
module.exports = {
BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'],
GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',
kStatusCode: Symbol('status-code'),
kWebSocket: Symbol('websocket'),
EMPTY_BUFFER: Buffer.alloc(0),
NOOP: () => {}
};
|
8940b0038f94bef08447f26905d09c505f406eacd8af636c8041653cef436959 | JavaScript | 268 | 7 | describe('Version number', function() {
it('is consistent between package.json and build output', function() {
specHelpers.requiresNode();
const packageJson = require('../../package.json');
expect(jasmine.version).toEqual(packageJson.version);
});
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.