mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2025-07-26 12:48:50 +00:00
apps
data analysis
website
functions
node_modules
.bin
@firebase
@google-cloud
@grpc
@mrmlnc
@nodelib
@protobufjs
@types
accepts
acorn
acorn-es7-plugin
ajv
ansi-regex
arr-diff
arr-flatten
arr-union
array-filter
array-flatten
array-union
array-uniq
array-unique
arrify
ascli
asn1
assert-plus
assign-symbols
async
asynckit
atob
aws-sign2
aws4
axios
balanced-match
base
bcrypt-pbkdf
body-parser
brace-expansion
braces
buffer-equal-constant-time
buffer-from
bun
bytebuffer
bytes
cache-base
call-me-maybe
call-signature
camelcase
capture-stack-trace
caseless
class-utils
cliui
code-point-at
collection-visit
colour
combined-stream
component-emitter
compressible
concat-map
concat-stream
configstore
content-disposition
content-type
cookie
cookie-signature
copy-descriptor
core-js
core-util-is
cors
create-error-class
crypto-random-string
dashdash
debug
decamelize
decode-uri-component
deep-equal
define-properties
define-property
delayed-stream
depd
destroy
diff-match-patch
dir-glob
dom-storage
dot-prop
duplexify
eastasianwidth
ecc-jsbn
ecdsa-sig-formatter
ee-first
empower
empower-core
encodeurl
end-of-stream
ent
escape-html
espurify
estraverse
etag
expand-brackets
express
extend
extend-shallow
extglob
extsprintf
fast-deep-equal
fast-glob
fast-json-stable-stringify
faye-websocket
fill-range
finalhandler
firebase-admin
firebase-functions
follow-redirects
for-in
forever-agent
form-data
forwarded
fragment-cache
fresh
fs.realpath
functional-red-black-tree
gcp-metadata
gcs-resumable-upload
get-value
getpass
glob
glob-parent
glob-to-regexp
globby
google-auth-library
google-auto-auth
google-gax
google-p12-pem
google-proto-files
graceful-fs
grpc
gtoken
har-schema
har-validator
has-value
has-values
hash-stream-validation
http-errors
http-parser-js
http-signature
iconv-lite
ignore
imurmurhash
indexof
inflight
inherits
invert-kv
ipaddr.js
is
is-accessor-descriptor
is-buffer
is-data-descriptor
is-descriptor
is-extendable
is-extglob
is-fullwidth-code-point
is-glob
is-number
is-obj
is-plain-object
is-stream-ended
is-typedarray
is-windows
isarray
isobject
isstream
jsbn
json-schema
json-schema-traverse
json-stringify-safe
jsonwebtoken
jsprim
jwa
jws
kind-of
lcid
lodash
lodash.camelcase
lodash.clone
lodash.includes
lodash.isboolean
lodash.isinteger
lodash.isnumber
lodash.isplainobject
lodash.isstring
lodash.merge
lodash.once
log-driver
long
lru-cache
make-dir
map-cache
map-visit
media-typer
merge-descriptors
merge2
methmeth
methods
micromatch
mime
mime-db
mime-types
minimatch
mixin-deep
modelo
ms
nan
nanomatch
negotiator
node-forge
number-is-nan
oauth-sign
object-assign
object-copy
object-keys
object-visit
object.pick
on-finished
once
optjs
os-locale
parseurl
pascalcase
path-dirname
path-is-absolute
path-to-regexp
path-type
performance-now
pify
posix-character-classes
power-assert
power-assert-context-formatter
power-assert-context-reducer-ast
power-assert-context-traversal
power-assert-formatter
power-assert-renderer-assertion
power-assert-renderer-base
power-assert-renderer-comparison
power-assert-renderer-diagram
power-assert-renderer-file
power-assert-util-string-width
process-nextick-args
protobufjs
proxy-addr
pseudomap
psl
pump
pumpify
punycode
qs
range-parser
raw-body
readable-stream
regex-not
repeat-element
repeat-string
request
resolve-url
ret
retry-axios
retry-request
safe-buffer
safe-regex
safer-buffer
send
serve-static
set-value
setprototypeof
signal-exit
slash
snakeize
snapdragon
snapdragon-node
snapdragon-util
source-map
source-map-resolve
source-map-url
split-array-stream
split-string
LICENSE
README.md
index.js
package.json
sshpk
static-extend
statuses
stream-events
stream-shift
string-format-obj
string-width
string_decoder
stringifier
strip-ansi
stubs
through2
to-object-path
to-regex
to-regex-range
tough-cookie
traverse
tslib
tunnel-agent
tweetnacl
type-is
type-name
typedarray
union-value
unique-string
universal-deep-strict-equal
unpipe
unset-value
uri-js
urix
use
util-deprecate
utils-merge
uuid
vary
verror
websocket-driver
websocket-extensions
window-size
wrap-ansi
wrappy
write-file-atomic
xdg-basedir
xmlhttprequest
xtend
y18n
yallist
yargs
index.js
package-lock.json
package.json
node_modules
public
.firebaserc
.gitignore
.runtimeconfig.json
firebase.json
firestore.indexes.json
firestore.rules
package-lock.json
.gitattributes
.gitignore
README.md
172 lines
3.6 KiB
JavaScript
172 lines
3.6 KiB
JavaScript
/*!
|
|
* split-string <https://github.com/jonschlinkert/split-string>
|
|
*
|
|
* Copyright (c) 2015-2017, Jon Schlinkert.
|
|
* Released under the MIT License.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var extend = require('extend-shallow');
|
|
|
|
module.exports = function(str, options, fn) {
|
|
if (typeof str !== 'string') {
|
|
throw new TypeError('expected a string');
|
|
}
|
|
|
|
if (typeof options === 'function') {
|
|
fn = options;
|
|
options = null;
|
|
}
|
|
|
|
// allow separator to be defined as a string
|
|
if (typeof options === 'string') {
|
|
options = { sep: options };
|
|
}
|
|
|
|
var opts = extend({sep: '.'}, options);
|
|
var quotes = opts.quotes || ['"', "'", '`'];
|
|
var brackets;
|
|
|
|
if (opts.brackets === true) {
|
|
brackets = {
|
|
'<': '>',
|
|
'(': ')',
|
|
'[': ']',
|
|
'{': '}'
|
|
};
|
|
} else if (opts.brackets) {
|
|
brackets = opts.brackets;
|
|
}
|
|
|
|
var tokens = [];
|
|
var stack = [];
|
|
var arr = [''];
|
|
var sep = opts.sep;
|
|
var len = str.length;
|
|
var idx = -1;
|
|
var closeIdx;
|
|
|
|
function expected() {
|
|
if (brackets && stack.length) {
|
|
return brackets[stack[stack.length - 1]];
|
|
}
|
|
}
|
|
|
|
while (++idx < len) {
|
|
var ch = str[idx];
|
|
var next = str[idx + 1];
|
|
var tok = { val: ch, idx: idx, arr: arr, str: str };
|
|
tokens.push(tok);
|
|
|
|
if (ch === '\\') {
|
|
tok.val = keepEscaping(opts, str, idx) === true ? (ch + next) : next;
|
|
tok.escaped = true;
|
|
if (typeof fn === 'function') {
|
|
fn(tok);
|
|
}
|
|
arr[arr.length - 1] += tok.val;
|
|
idx++;
|
|
continue;
|
|
}
|
|
|
|
if (brackets && brackets[ch]) {
|
|
stack.push(ch);
|
|
var e = expected();
|
|
var i = idx + 1;
|
|
|
|
if (str.indexOf(e, i + 1) !== -1) {
|
|
while (stack.length && i < len) {
|
|
var s = str[++i];
|
|
if (s === '\\') {
|
|
s++;
|
|
continue;
|
|
}
|
|
|
|
if (quotes.indexOf(s) !== -1) {
|
|
i = getClosingQuote(str, s, i + 1);
|
|
continue;
|
|
}
|
|
|
|
e = expected();
|
|
if (stack.length && str.indexOf(e, i + 1) === -1) {
|
|
break;
|
|
}
|
|
|
|
if (brackets[s]) {
|
|
stack.push(s);
|
|
continue;
|
|
}
|
|
|
|
if (e === s) {
|
|
stack.pop();
|
|
}
|
|
}
|
|
}
|
|
|
|
closeIdx = i;
|
|
if (closeIdx === -1) {
|
|
arr[arr.length - 1] += ch;
|
|
continue;
|
|
}
|
|
|
|
ch = str.slice(idx, closeIdx + 1);
|
|
tok.val = ch;
|
|
tok.idx = idx = closeIdx;
|
|
}
|
|
|
|
if (quotes.indexOf(ch) !== -1) {
|
|
closeIdx = getClosingQuote(str, ch, idx + 1);
|
|
if (closeIdx === -1) {
|
|
arr[arr.length - 1] += ch;
|
|
continue;
|
|
}
|
|
|
|
if (keepQuotes(ch, opts) === true) {
|
|
ch = str.slice(idx, closeIdx + 1);
|
|
} else {
|
|
ch = str.slice(idx + 1, closeIdx);
|
|
}
|
|
|
|
tok.val = ch;
|
|
tok.idx = idx = closeIdx;
|
|
}
|
|
|
|
if (typeof fn === 'function') {
|
|
fn(tok, tokens);
|
|
ch = tok.val;
|
|
idx = tok.idx;
|
|
}
|
|
|
|
if (tok.val === sep && tok.split !== false) {
|
|
arr.push('');
|
|
continue;
|
|
}
|
|
|
|
arr[arr.length - 1] += tok.val;
|
|
}
|
|
|
|
return arr;
|
|
};
|
|
|
|
function getClosingQuote(str, ch, i, brackets) {
|
|
var idx = str.indexOf(ch, i);
|
|
if (str.charAt(idx - 1) === '\\') {
|
|
return getClosingQuote(str, ch, idx + 1);
|
|
}
|
|
return idx;
|
|
}
|
|
|
|
function keepQuotes(ch, opts) {
|
|
if (opts.keepDoubleQuotes === true && ch === '"') return true;
|
|
if (opts.keepSingleQuotes === true && ch === "'") return true;
|
|
return opts.keepQuotes;
|
|
}
|
|
|
|
function keepEscaping(opts, str, idx) {
|
|
if (typeof opts.keepEscaping === 'function') {
|
|
return opts.keepEscaping(str, idx);
|
|
}
|
|
return opts.keepEscaping === true || str[idx + 1] === '\\';
|
|
}
|