Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.1
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
quiz1 /
node_modules /
lodash /
fp /
[ HOME SHELL ]
Name
Size
Permission
Action
F.js
41
B
-rw-rw-rw-
T.js
40
B
-rw-rw-rw-
__.js
43
B
-rw-rw-rw-
_baseConvert.js
16.03
KB
-rw-rw-rw-
_convertBrowser.js
615
B
-rw-rw-rw-
_falseOptions.js
113
B
-rw-rw-rw-
_mapping.js
9.72
KB
-rw-rw-rw-
_util.js
524
B
-rw-rw-rw-
add.js
151
B
-rw-rw-rw-
after.js
155
B
-rw-rw-rw-
all.js
37
B
-rw-rw-rw-
allPass.js
41
B
-rw-rw-rw-
always.js
40
B
-rw-rw-rw-
any.js
36
B
-rw-rw-rw-
anyPass.js
40
B
-rw-rw-rw-
apply.js
38
B
-rw-rw-rw-
array.js
83
B
-rw-rw-rw-
ary.js
151
B
-rw-rw-rw-
assign.js
157
B
-rw-rw-rw-
assignAll.js
160
B
-rw-rw-rw-
assignAllWith.js
168
B
-rw-rw-rw-
assignIn.js
161
B
-rw-rw-rw-
assignInAll.js
164
B
-rw-rw-rw-
assignInAllWith.js
172
B
-rw-rw-rw-
assignInWith.js
169
B
-rw-rw-rw-
assignWith.js
165
B
-rw-rw-rw-
assoc.js
35
B
-rw-rw-rw-
assocPath.js
35
B
-rw-rw-rw-
at.js
149
B
-rw-rw-rw-
attempt.js
159
B
-rw-rw-rw-
before.js
157
B
-rw-rw-rw-
bind.js
153
B
-rw-rw-rw-
bindAll.js
159
B
-rw-rw-rw-
bindKey.js
159
B
-rw-rw-rw-
camelCase.js
191
B
-rw-rw-rw-
capitalize.js
193
B
-rw-rw-rw-
castArray.js
163
B
-rw-rw-rw-
ceil.js
153
B
-rw-rw-rw-
chain.js
183
B
-rw-rw-rw-
chunk.js
155
B
-rw-rw-rw-
clamp.js
155
B
-rw-rw-rw-
clone.js
183
B
-rw-rw-rw-
cloneDeep.js
191
B
-rw-rw-rw-
cloneDeepWith.js
171
B
-rw-rw-rw-
cloneWith.js
163
B
-rw-rw-rw-
collection.js
88
B
-rw-rw-rw-
commit.js
185
B
-rw-rw-rw-
compact.js
187
B
-rw-rw-rw-
complement.js
38
B
-rw-rw-rw-
compose.js
41
B
-rw-rw-rw-
concat.js
157
B
-rw-rw-rw-
cond.js
181
B
-rw-rw-rw-
conforms.js
42
B
-rw-rw-rw-
conformsTo.js
165
B
-rw-rw-rw-
constant.js
189
B
-rw-rw-rw-
contains.js
40
B
-rw-rw-rw-
convert.js
657
B
-rw-rw-rw-
countBy.js
159
B
-rw-rw-rw-
create.js
157
B
-rw-rw-rw-
curry.js
155
B
-rw-rw-rw-
curryN.js
156
B
-rw-rw-rw-
curryRight.js
165
B
-rw-rw-rw-
curryRightN.js
166
B
-rw-rw-rw-
date.js
82
B
-rw-rw-rw-
debounce.js
161
B
-rw-rw-rw-
deburr.js
185
B
-rw-rw-rw-
defaultTo.js
163
B
-rw-rw-rw-
defaults.js
161
B
-rw-rw-rw-
defaultsAll.js
164
B
-rw-rw-rw-
defaultsDeep.js
169
B
-rw-rw-rw-
defaultsDeepAll.js
172
B
-rw-rw-rw-
defer.js
183
B
-rw-rw-rw-
delay.js
155
B
-rw-rw-rw-
difference.js
165
B
-rw-rw-rw-
differenceBy.js
169
B
-rw-rw-rw-
differenceWith.js
173
B
-rw-rw-rw-
dissoc.js
37
B
-rw-rw-rw-
dissocPath.js
37
B
-rw-rw-rw-
divide.js
157
B
-rw-rw-rw-
drop.js
153
B
-rw-rw-rw-
dropLast.js
41
B
-rw-rw-rw-
dropLastWhile.js
46
B
-rw-rw-rw-
dropRight.js
163
B
-rw-rw-rw-
dropRightWhile.js
173
B
-rw-rw-rw-
dropWhile.js
163
B
-rw-rw-rw-
each.js
39
B
-rw-rw-rw-
eachRight.js
44
B
-rw-rw-rw-
endsWith.js
161
B
-rw-rw-rw-
entries.js
39
B
-rw-rw-rw-
entriesIn.js
41
B
-rw-rw-rw-
eq.js
149
B
-rw-rw-rw-
equals.js
39
B
-rw-rw-rw-
escape.js
185
B
-rw-rw-rw-
escapeRegExp.js
197
B
-rw-rw-rw-
every.js
155
B
-rw-rw-rw-
extend.js
40
B
-rw-rw-rw-
extendAll.js
43
B
-rw-rw-rw-
extendAllWith.js
47
B
-rw-rw-rw-
extendWith.js
44
B
-rw-rw-rw-
fill.js
153
B
-rw-rw-rw-
filter.js
157
B
-rw-rw-rw-
find.js
153
B
-rw-rw-rw-
findFrom.js
157
B
-rw-rw-rw-
findIndex.js
163
B
-rw-rw-rw-
findIndexFrom.js
167
B
-rw-rw-rw-
findKey.js
159
B
-rw-rw-rw-
findLast.js
161
B
-rw-rw-rw-
findLastFrom.js
165
B
-rw-rw-rw-
findLastIndex.js
171
B
-rw-rw-rw-
findLastIndexFrom.js
175
B
-rw-rw-rw-
findLastKey.js
167
B
-rw-rw-rw-
first.js
36
B
-rw-rw-rw-
flatMap.js
159
B
-rw-rw-rw-
flatMapDeep.js
167
B
-rw-rw-rw-
flatMapDepth.js
169
B
-rw-rw-rw-
flatten.js
187
B
-rw-rw-rw-
flattenDeep.js
195
B
-rw-rw-rw-
flattenDepth.js
169
B
-rw-rw-rw-
flip.js
181
B
-rw-rw-rw-
floor.js
155
B
-rw-rw-rw-
flow.js
153
B
-rw-rw-rw-
flowRight.js
163
B
-rw-rw-rw-
forEach.js
159
B
-rw-rw-rw-
forEachRight.js
169
B
-rw-rw-rw-
forIn.js
155
B
-rw-rw-rw-
forInRight.js
165
B
-rw-rw-rw-
forOwn.js
157
B
-rw-rw-rw-
forOwnRight.js
167
B
-rw-rw-rw-
fromPairs.js
163
B
-rw-rw-rw-
function.js
86
B
-rw-rw-rw-
functions.js
191
B
-rw-rw-rw-
functionsIn.js
195
B
-rw-rw-rw-
get.js
151
B
-rw-rw-rw-
getOr.js
153
B
-rw-rw-rw-
groupBy.js
159
B
-rw-rw-rw-
gt.js
149
B
-rw-rw-rw-
gte.js
151
B
-rw-rw-rw-
has.js
151
B
-rw-rw-rw-
hasIn.js
155
B
-rw-rw-rw-
head.js
181
B
-rw-rw-rw-
identical.js
34
B
-rw-rw-rw-
identity.js
189
B
-rw-rw-rw-
inRange.js
159
B
-rw-rw-rw-
includes.js
161
B
-rw-rw-rw-
includesFrom.js
165
B
-rw-rw-rw-
indexBy.js
37
B
-rw-rw-rw-
indexOf.js
159
B
-rw-rw-rw-
indexOfFrom.js
163
B
-rw-rw-rw-
init.js
39
B
-rw-rw-rw-
initial.js
187
B
-rw-rw-rw-
intersection.js
169
B
-rw-rw-rw-
intersectionBy.js
173
B
-rw-rw-rw-
intersectionWith.js
177
B
-rw-rw-rw-
invert.js
157
B
-rw-rw-rw-
invertBy.js
161
B
-rw-rw-rw-
invertObj.js
38
B
-rw-rw-rw-
invoke.js
157
B
-rw-rw-rw-
invokeArgs.js
161
B
-rw-rw-rw-
invokeArgsMap.js
167
B
-rw-rw-rw-
invokeMap.js
163
B
-rw-rw-rw-
isArguments.js
195
B
-rw-rw-rw-
isArray.js
187
B
-rw-rw-rw-
isArrayBuffer.js
199
B
-rw-rw-rw-
isArrayLike.js
195
B
-rw-rw-rw-
isArrayLikeObject.js
207
B
-rw-rw-rw-
isBoolean.js
191
B
-rw-rw-rw-
isBuffer.js
189
B
-rw-rw-rw-
isDate.js
185
B
-rw-rw-rw-
isElement.js
191
B
-rw-rw-rw-
isEmpty.js
187
B
-rw-rw-rw-
isEqual.js
159
B
-rw-rw-rw-
isEqualWith.js
167
B
-rw-rw-rw-
isError.js
187
B
-rw-rw-rw-
isFinite.js
189
B
-rw-rw-rw-
isFunction.js
193
B
-rw-rw-rw-
isInteger.js
191
B
-rw-rw-rw-
isLength.js
189
B
-rw-rw-rw-
isMap.js
183
B
-rw-rw-rw-
isMatch.js
159
B
-rw-rw-rw-
isMatchWith.js
167
B
-rw-rw-rw-
isNaN.js
183
B
-rw-rw-rw-
isNative.js
189
B
-rw-rw-rw-
isNil.js
183
B
-rw-rw-rw-
isNull.js
185
B
-rw-rw-rw-
isNumber.js
189
B
-rw-rw-rw-
isObject.js
189
B
-rw-rw-rw-
isObjectLike.js
197
B
-rw-rw-rw-
isPlainObject.js
199
B
-rw-rw-rw-
isRegExp.js
189
B
-rw-rw-rw-
isSafeInteger.js
199
B
-rw-rw-rw-
isSet.js
183
B
-rw-rw-rw-
isString.js
189
B
-rw-rw-rw-
isSymbol.js
189
B
-rw-rw-rw-
isTypedArray.js
197
B
-rw-rw-rw-
isUndefined.js
195
B
-rw-rw-rw-
isWeakMap.js
191
B
-rw-rw-rw-
isWeakSet.js
191
B
-rw-rw-rw-
iteratee.js
161
B
-rw-rw-rw-
join.js
153
B
-rw-rw-rw-
juxt.js
36
B
-rw-rw-rw-
kebabCase.js
191
B
-rw-rw-rw-
keyBy.js
155
B
-rw-rw-rw-
keys.js
181
B
-rw-rw-rw-
keysIn.js
185
B
-rw-rw-rw-
lang.js
82
B
-rw-rw-rw-
last.js
181
B
-rw-rw-rw-
lastIndexOf.js
167
B
-rw-rw-rw-
lastIndexOfFrom.js
171
B
-rw-rw-rw-
lowerCase.js
191
B
-rw-rw-rw-
lowerFirst.js
193
B
-rw-rw-rw-
lt.js
149
B
-rw-rw-rw-
lte.js
151
B
-rw-rw-rw-
map.js
151
B
-rw-rw-rw-
mapKeys.js
159
B
-rw-rw-rw-
mapValues.js
163
B
-rw-rw-rw-
matches.js
39
B
-rw-rw-rw-
matchesProperty.js
175
B
-rw-rw-rw-
math.js
82
B
-rw-rw-rw-
max.js
179
B
-rw-rw-rw-
maxBy.js
155
B
-rw-rw-rw-
mean.js
181
B
-rw-rw-rw-
meanBy.js
157
B
-rw-rw-rw-
memoize.js
159
B
-rw-rw-rw-
merge.js
155
B
-rw-rw-rw-
mergeAll.js
158
B
-rw-rw-rw-
mergeAllWith.js
166
B
-rw-rw-rw-
mergeWith.js
163
B
-rw-rw-rw-
method.js
157
B
-rw-rw-rw-
methodOf.js
161
B
-rw-rw-rw-
min.js
179
B
-rw-rw-rw-
minBy.js
155
B
-rw-rw-rw-
mixin.js
155
B
-rw-rw-rw-
multiply.js
161
B
-rw-rw-rw-
nAry.js
35
B
-rw-rw-rw-
negate.js
185
B
-rw-rw-rw-
next.js
181
B
-rw-rw-rw-
noop.js
181
B
-rw-rw-rw-
now.js
179
B
-rw-rw-rw-
nth.js
151
B
-rw-rw-rw-
nthArg.js
157
B
-rw-rw-rw-
number.js
84
B
-rw-rw-rw-
object.js
84
B
-rw-rw-rw-
omit.js
153
B
-rw-rw-rw-
omitAll.js
36
B
-rw-rw-rw-
omitBy.js
157
B
-rw-rw-rw-
once.js
181
B
-rw-rw-rw-
orderBy.js
159
B
-rw-rw-rw-
over.js
153
B
-rw-rw-rw-
overArgs.js
161
B
-rw-rw-rw-
overEvery.js
163
B
-rw-rw-rw-
overSome.js
161
B
-rw-rw-rw-
pad.js
151
B
-rw-rw-rw-
padChars.js
156
B
-rw-rw-rw-
padCharsEnd.js
162
B
-rw-rw-rw-
padCharsStart.js
166
B
-rw-rw-rw-
padEnd.js
157
B
-rw-rw-rw-
padStart.js
161
B
-rw-rw-rw-
parseInt.js
161
B
-rw-rw-rw-
partial.js
159
B
-rw-rw-rw-
partialRight.js
169
B
-rw-rw-rw-
partition.js
163
B
-rw-rw-rw-
path.js
35
B
-rw-rw-rw-
pathEq.js
47
B
-rw-rw-rw-
pathOr.js
37
B
-rw-rw-rw-
paths.js
34
B
-rw-rw-rw-
pick.js
153
B
-rw-rw-rw-
pickAll.js
36
B
-rw-rw-rw-
pickBy.js
157
B
-rw-rw-rw-
pipe.js
36
B
-rw-rw-rw-
placeholder.js
105
B
-rw-rw-rw-
plant.js
183
B
-rw-rw-rw-
pluck.js
35
B
-rw-rw-rw-
prop.js
35
B
-rw-rw-rw-
propEq.js
47
B
-rw-rw-rw-
propOr.js
37
B
-rw-rw-rw-
property.js
35
B
-rw-rw-rw-
propertyOf.js
158
B
-rw-rw-rw-
props.js
34
B
-rw-rw-rw-
pull.js
153
B
-rw-rw-rw-
pullAll.js
159
B
-rw-rw-rw-
pullAllBy.js
163
B
-rw-rw-rw-
pullAllWith.js
167
B
-rw-rw-rw-
pullAt.js
157
B
-rw-rw-rw-
random.js
157
B
-rw-rw-rw-
range.js
155
B
-rw-rw-rw-
rangeRight.js
165
B
-rw-rw-rw-
rangeStep.js
159
B
-rw-rw-rw-
rangeStepRight.js
169
B
-rw-rw-rw-
rearg.js
155
B
-rw-rw-rw-
reduce.js
157
B
-rw-rw-rw-
reduceRight.js
167
B
-rw-rw-rw-
reject.js
157
B
-rw-rw-rw-
remove.js
157
B
-rw-rw-rw-
repeat.js
157
B
-rw-rw-rw-
replace.js
159
B
-rw-rw-rw-
rest.js
153
B
-rw-rw-rw-
restFrom.js
157
B
-rw-rw-rw-
result.js
157
B
-rw-rw-rw-
reverse.js
159
B
-rw-rw-rw-
round.js
155
B
-rw-rw-rw-
sample.js
185
B
-rw-rw-rw-
sampleSize.js
165
B
-rw-rw-rw-
seq.js
81
B
-rw-rw-rw-
set.js
151
B
-rw-rw-rw-
setWith.js
159
B
-rw-rw-rw-
shuffle.js
187
B
-rw-rw-rw-
size.js
181
B
-rw-rw-rw-
slice.js
155
B
-rw-rw-rw-
snakeCase.js
191
B
-rw-rw-rw-
some.js
153
B
-rw-rw-rw-
sortBy.js
157
B
-rw-rw-rw-
sortedIndex.js
167
B
-rw-rw-rw-
sortedIndexBy.js
171
B
-rw-rw-rw-
sortedIndexOf.js
171
B
-rw-rw-rw-
sortedLastIndex.js
175
B
-rw-rw-rw-
sortedLastIndexBy.js
179
B
-rw-rw-rw-
sortedLastIndexOf.js
179
B
-rw-rw-rw-
sortedUniq.js
193
B
-rw-rw-rw-
sortedUniqBy.js
169
B
-rw-rw-rw-
split.js
155
B
-rw-rw-rw-
spread.js
157
B
-rw-rw-rw-
spreadFrom.js
161
B
-rw-rw-rw-
startCase.js
191
B
-rw-rw-rw-
startsWith.js
165
B
-rw-rw-rw-
string.js
84
B
-rw-rw-rw-
stubArray.js
191
B
-rw-rw-rw-
stubFalse.js
191
B
-rw-rw-rw-
stubObject.js
193
B
-rw-rw-rw-
stubString.js
193
B
-rw-rw-rw-
stubTrue.js
189
B
-rw-rw-rw-
subtract.js
161
B
-rw-rw-rw-
sum.js
179
B
-rw-rw-rw-
sumBy.js
155
B
-rw-rw-rw-
symmetricDifference.js
35
B
-rw-rw-rw-
symmetricDifferenceBy.js
37
B
-rw-rw-rw-
symmetricDifferenceWith.js
39
B
-rw-rw-rw-
tail.js
181
B
-rw-rw-rw-
take.js
153
B
-rw-rw-rw-
takeLast.js
41
B
-rw-rw-rw-
takeLastWhile.js
46
B
-rw-rw-rw-
takeRight.js
163
B
-rw-rw-rw-
takeRightWhile.js
173
B
-rw-rw-rw-
takeWhile.js
163
B
-rw-rw-rw-
tap.js
151
B
-rw-rw-rw-
template.js
161
B
-rw-rw-rw-
templateSettings.js
205
B
-rw-rw-rw-
throttle.js
161
B
-rw-rw-rw-
thru.js
153
B
-rw-rw-rw-
times.js
155
B
-rw-rw-rw-
toArray.js
187
B
-rw-rw-rw-
toFinite.js
189
B
-rw-rw-rw-
toInteger.js
191
B
-rw-rw-rw-
toIterator.js
193
B
-rw-rw-rw-
toJSON.js
185
B
-rw-rw-rw-
toLength.js
189
B
-rw-rw-rw-
toLower.js
187
B
-rw-rw-rw-
toNumber.js
189
B
-rw-rw-rw-
toPairs.js
187
B
-rw-rw-rw-
toPairsIn.js
191
B
-rw-rw-rw-
toPath.js
185
B
-rw-rw-rw-
toPlainObject.js
199
B
-rw-rw-rw-
toSafeInteger.js
199
B
-rw-rw-rw-
toString.js
189
B
-rw-rw-rw-
toUpper.js
187
B
-rw-rw-rw-
transform.js
163
B
-rw-rw-rw-
trim.js
153
B
-rw-rw-rw-
trimChars.js
158
B
-rw-rw-rw-
trimCharsEnd.js
164
B
-rw-rw-rw-
trimCharsStart.js
168
B
-rw-rw-rw-
trimEnd.js
159
B
-rw-rw-rw-
trimStart.js
163
B
-rw-rw-rw-
truncate.js
161
B
-rw-rw-rw-
unapply.js
36
B
-rw-rw-rw-
unary.js
183
B
-rw-rw-rw-
unescape.js
189
B
-rw-rw-rw-
union.js
155
B
-rw-rw-rw-
unionBy.js
159
B
-rw-rw-rw-
unionWith.js
163
B
-rw-rw-rw-
uniq.js
181
B
-rw-rw-rw-
uniqBy.js
157
B
-rw-rw-rw-
uniqWith.js
161
B
-rw-rw-rw-
uniqueId.js
161
B
-rw-rw-rw-
unnest.js
39
B
-rw-rw-rw-
unset.js
155
B
-rw-rw-rw-
unzip.js
183
B
-rw-rw-rw-
unzipWith.js
163
B
-rw-rw-rw-
update.js
157
B
-rw-rw-rw-
updateWith.js
165
B
-rw-rw-rw-
upperCase.js
191
B
-rw-rw-rw-
upperFirst.js
193
B
-rw-rw-rw-
useWith.js
40
B
-rw-rw-rw-
util.js
82
B
-rw-rw-rw-
value.js
183
B
-rw-rw-rw-
valueOf.js
187
B
-rw-rw-rw-
values.js
185
B
-rw-rw-rw-
valuesIn.js
189
B
-rw-rw-rw-
where.js
42
B
-rw-rw-rw-
whereEq.js
39
B
-rw-rw-rw-
without.js
159
B
-rw-rw-rw-
words.js
155
B
-rw-rw-rw-
wrap.js
153
B
-rw-rw-rw-
wrapperAt.js
191
B
-rw-rw-rw-
wrapperChain.js
197
B
-rw-rw-rw-
wrapperLodash.js
199
B
-rw-rw-rw-
wrapperReverse.js
201
B
-rw-rw-rw-
wrapperValue.js
197
B
-rw-rw-rw-
xor.js
151
B
-rw-rw-rw-
xorBy.js
155
B
-rw-rw-rw-
xorWith.js
159
B
-rw-rw-rw-
zip.js
151
B
-rw-rw-rw-
zipAll.js
154
B
-rw-rw-rw-
zipObj.js
41
B
-rw-rw-rw-
zipObject.js
163
B
-rw-rw-rw-
zipObjectDeep.js
171
B
-rw-rw-rw-
zipWith.js
159
B
-rw-rw-rw-
Delete
Unzip
Zip
${this.title}
Close
Code Editor : _baseConvert.js
var mapping = require('./_mapping'), fallbackHolder = require('./placeholder'); /** Built-in value reference. */ var push = Array.prototype.push; /** * Creates a function, with an arity of `n`, that invokes `func` with the * arguments it receives. * * @private * @param {Function} func The function to wrap. * @param {number} n The arity of the new function. * @returns {Function} Returns the new function. */ function baseArity(func, n) { return n == 2 ? function(a, b) { return func.apply(undefined, arguments); } : function(a) { return func.apply(undefined, arguments); }; } /** * Creates a function that invokes `func`, with up to `n` arguments, ignoring * any additional arguments. * * @private * @param {Function} func The function to cap arguments for. * @param {number} n The arity cap. * @returns {Function} Returns the new function. */ function baseAry(func, n) { return n == 2 ? function(a, b) { return func(a, b); } : function(a) { return func(a); }; } /** * Creates a clone of `array`. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the cloned array. */ function cloneArray(array) { var length = array ? array.length : 0, result = Array(length); while (length--) { result[length] = array[length]; } return result; } /** * Creates a function that clones a given object using the assignment `func`. * * @private * @param {Function} func The assignment function. * @returns {Function} Returns the new cloner function. */ function createCloner(func) { return function(object) { return func({}, object); }; } /** * A specialized version of `_.spread` which flattens the spread array into * the arguments of the invoked `func`. * * @private * @param {Function} func The function to spread arguments over. * @param {number} start The start position of the spread. * @returns {Function} Returns the new function. */ function flatSpread(func, start) { return function() { var length = arguments.length, lastIndex = length - 1, args = Array(length); while (length--) { args[length] = arguments[length]; } var array = args[start], otherArgs = args.slice(0, start); if (array) { push.apply(otherArgs, array); } if (start != lastIndex) { push.apply(otherArgs, args.slice(start + 1)); } return func.apply(this, otherArgs); }; } /** * Creates a function that wraps `func` and uses `cloner` to clone the first * argument it receives. * * @private * @param {Function} func The function to wrap. * @param {Function} cloner The function to clone arguments. * @returns {Function} Returns the new immutable function. */ function wrapImmutable(func, cloner) { return function() { var length = arguments.length; if (!length) { return; } var args = Array(length); while (length--) { args[length] = arguments[length]; } var result = args[0] = cloner.apply(undefined, args); func.apply(undefined, args); return result; }; } /** * The base implementation of `convert` which accepts a `util` object of methods * required to perform conversions. * * @param {Object} util The util object. * @param {string} name The name of the function to convert. * @param {Function} func The function to convert. * @param {Object} [options] The options object. * @param {boolean} [options.cap=true] Specify capping iteratee arguments. * @param {boolean} [options.curry=true] Specify currying. * @param {boolean} [options.fixed=true] Specify fixed arity. * @param {boolean} [options.immutable=true] Specify immutable operations. * @param {boolean} [options.rearg=true] Specify rearranging arguments. * @returns {Function|Object} Returns the converted function or object. */ function baseConvert(util, name, func, options) { var isLib = typeof name == 'function', isObj = name === Object(name); if (isObj) { options = func; func = name; name = undefined; } if (func == null) { throw new TypeError; } options || (options = {}); var config = { 'cap': 'cap' in options ? options.cap : true, 'curry': 'curry' in options ? options.curry : true, 'fixed': 'fixed' in options ? options.fixed : true, 'immutable': 'immutable' in options ? options.immutable : true, 'rearg': 'rearg' in options ? options.rearg : true }; var defaultHolder = isLib ? func : fallbackHolder, forceCurry = ('curry' in options) && options.curry, forceFixed = ('fixed' in options) && options.fixed, forceRearg = ('rearg' in options) && options.rearg, pristine = isLib ? func.runInContext() : undefined; var helpers = isLib ? func : { 'ary': util.ary, 'assign': util.assign, 'clone': util.clone, 'curry': util.curry, 'forEach': util.forEach, 'isArray': util.isArray, 'isError': util.isError, 'isFunction': util.isFunction, 'isWeakMap': util.isWeakMap, 'iteratee': util.iteratee, 'keys': util.keys, 'rearg': util.rearg, 'toInteger': util.toInteger, 'toPath': util.toPath }; var ary = helpers.ary, assign = helpers.assign, clone = helpers.clone, curry = helpers.curry, each = helpers.forEach, isArray = helpers.isArray, isError = helpers.isError, isFunction = helpers.isFunction, isWeakMap = helpers.isWeakMap, keys = helpers.keys, rearg = helpers.rearg, toInteger = helpers.toInteger, toPath = helpers.toPath; var aryMethodKeys = keys(mapping.aryMethod); var wrappers = { 'castArray': function(castArray) { return function() { var value = arguments[0]; return isArray(value) ? castArray(cloneArray(value)) : castArray.apply(undefined, arguments); }; }, 'iteratee': function(iteratee) { return function() { var func = arguments[0], arity = arguments[1], result = iteratee(func, arity), length = result.length; if (config.cap && typeof arity == 'number') { arity = arity > 2 ? (arity - 2) : 1; return (length && length <= arity) ? result : baseAry(result, arity); } return result; }; }, 'mixin': function(mixin) { return function(source) { var func = this; if (!isFunction(func)) { return mixin(func, Object(source)); } var pairs = []; each(keys(source), function(key) { if (isFunction(source[key])) { pairs.push([key, func.prototype[key]]); } }); mixin(func, Object(source)); each(pairs, function(pair) { var value = pair[1]; if (isFunction(value)) { func.prototype[pair[0]] = value; } else { delete func.prototype[pair[0]]; } }); return func; }; }, 'nthArg': function(nthArg) { return function(n) { var arity = n < 0 ? 1 : (toInteger(n) + 1); return curry(nthArg(n), arity); }; }, 'rearg': function(rearg) { return function(func, indexes) { var arity = indexes ? indexes.length : 0; return curry(rearg(func, indexes), arity); }; }, 'runInContext': function(runInContext) { return function(context) { return baseConvert(util, runInContext(context), options); }; } }; /*--------------------------------------------------------------------------*/ /** * Casts `func` to a function with an arity capped iteratee if needed. * * @private * @param {string} name The name of the function to inspect. * @param {Function} func The function to inspect. * @returns {Function} Returns the cast function. */ function castCap(name, func) { if (config.cap) { var indexes = mapping.iterateeRearg[name]; if (indexes) { return iterateeRearg(func, indexes); } var n = !isLib && mapping.iterateeAry[name]; if (n) { return iterateeAry(func, n); } } return func; } /** * Casts `func` to a curried function if needed. * * @private * @param {string} name The name of the function to inspect. * @param {Function} func The function to inspect. * @param {number} n The arity of `func`. * @returns {Function} Returns the cast function. */ function castCurry(name, func, n) { return (forceCurry || (config.curry && n > 1)) ? curry(func, n) : func; } /** * Casts `func` to a fixed arity function if needed. * * @private * @param {string} name The name of the function to inspect. * @param {Function} func The function to inspect. * @param {number} n The arity cap. * @returns {Function} Returns the cast function. */ function castFixed(name, func, n) { if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { var data = mapping.methodSpread[name], start = data && data.start; return start === undefined ? ary(func, n) : flatSpread(func, start); } return func; } /** * Casts `func` to an rearged function if needed. * * @private * @param {string} name The name of the function to inspect. * @param {Function} func The function to inspect. * @param {number} n The arity of `func`. * @returns {Function} Returns the cast function. */ function castRearg(name, func, n) { return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name])) ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) : func; } /** * Creates a clone of `object` by `path`. * * @private * @param {Object} object The object to clone. * @param {Array|string} path The path to clone by. * @returns {Object} Returns the cloned object. */ function cloneByPath(object, path) { path = toPath(path); var index = -1, length = path.length, lastIndex = length - 1, result = clone(Object(object)), nested = result; while (nested != null && ++index < length) { var key = path[index], value = nested[key]; if (value != null && !(isFunction(value) || isError(value) || isWeakMap(value))) { nested[key] = clone(index == lastIndex ? value : Object(value)); } nested = nested[key]; } return result; } /** * Converts `lodash` to an immutable auto-curried iteratee-first data-last * version with conversion `options` applied. * * @param {Object} [options] The options object. See `baseConvert` for more details. * @returns {Function} Returns the converted `lodash`. */ function convertLib(options) { return _.runInContext.convert(options)(undefined); } /** * Create a converter function for `func` of `name`. * * @param {string} name The name of the function to convert. * @param {Function} func The function to convert. * @returns {Function} Returns the new converter function. */ function createConverter(name, func) { var realName = mapping.aliasToReal[name] || name, methodName = mapping.remap[realName] || realName, oldOptions = options; return function(options) { var newUtil = isLib ? pristine : helpers, newFunc = isLib ? pristine[methodName] : func, newOptions = assign(assign({}, oldOptions), options); return baseConvert(newUtil, realName, newFunc, newOptions); }; } /** * Creates a function that wraps `func` to invoke its iteratee, with up to `n` * arguments, ignoring any additional arguments. * * @private * @param {Function} func The function to cap iteratee arguments for. * @param {number} n The arity cap. * @returns {Function} Returns the new function. */ function iterateeAry(func, n) { return overArg(func, function(func) { return typeof func == 'function' ? baseAry(func, n) : func; }); } /** * Creates a function that wraps `func` to invoke its iteratee with arguments * arranged according to the specified `indexes` where the argument value at * the first index is provided as the first argument, the argument value at * the second index is provided as the second argument, and so on. * * @private * @param {Function} func The function to rearrange iteratee arguments for. * @param {number[]} indexes The arranged argument indexes. * @returns {Function} Returns the new function. */ function iterateeRearg(func, indexes) { return overArg(func, function(func) { var n = indexes.length; return baseArity(rearg(baseAry(func, n), indexes), n); }); } /** * Creates a function that invokes `func` with its first argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function() { var length = arguments.length; if (!length) { return func(); } var args = Array(length); while (length--) { args[length] = arguments[length]; } var index = config.rearg ? 0 : (length - 1); args[index] = transform(args[index]); return func.apply(undefined, args); }; } /** * Creates a function that wraps `func` and applys the conversions * rules by `name`. * * @private * @param {string} name The name of the function to wrap. * @param {Function} func The function to wrap. * @returns {Function} Returns the converted function. */ function wrap(name, func, placeholder) { var result, realName = mapping.aliasToReal[name] || name, wrapped = func, wrapper = wrappers[realName]; if (wrapper) { wrapped = wrapper(func); } else if (config.immutable) { if (mapping.mutate.array[realName]) { wrapped = wrapImmutable(func, cloneArray); } else if (mapping.mutate.object[realName]) { wrapped = wrapImmutable(func, createCloner(func)); } else if (mapping.mutate.set[realName]) { wrapped = wrapImmutable(func, cloneByPath); } } each(aryMethodKeys, function(aryKey) { each(mapping.aryMethod[aryKey], function(otherName) { if (realName == otherName) { var data = mapping.methodSpread[realName], afterRearg = data && data.afterRearg; result = afterRearg ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey); result = castCap(realName, result); result = castCurry(realName, result, aryKey); return false; } }); return !result; }); result || (result = wrapped); if (result == func) { result = forceCurry ? curry(result, 1) : function() { return func.apply(this, arguments); }; } result.convert = createConverter(realName, func); result.placeholder = func.placeholder = placeholder; return result; } /*--------------------------------------------------------------------------*/ if (!isObj) { return wrap(name, func, defaultHolder); } var _ = func; // Convert methods by ary cap. var pairs = []; each(aryMethodKeys, function(aryKey) { each(mapping.aryMethod[aryKey], function(key) { var func = _[mapping.remap[key] || key]; if (func) { pairs.push([key, wrap(key, func, _)]); } }); }); // Convert remaining methods. each(keys(_), function(key) { var func = _[key]; if (typeof func == 'function') { var length = pairs.length; while (length--) { if (pairs[length][0] == key) { return; } } func.convert = createConverter(key, func); pairs.push([key, func]); } }); // Assign to `_` leaving `_.prototype` unchanged to allow chaining. each(pairs, function(pair) { _[pair[0]] = pair[1]; }); _.convert = convertLib; _.placeholder = _; // Assign aliases. each(keys(_), function(key) { each(mapping.realToAlias[key] || [], function(alias) { _[alias] = _[key]; }); }); return _; } module.exports = baseConvert;
Close