Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor createMathOperation method to use convertToNumberOrString utility#5919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
saddamhr wants to merge435 commits intolodash:main
base:main
Choose a base branch
Loading
fromsaddamhr:refactor/createmathoperation-method-with-utility-converter
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
435 commits
Select commitHold shift + click to select a range
3e03cbf
Use const and let for var declaration in `baseEach` and `baseEachRight`.
falsyvaluesMar 12, 2017
9896964
Say goodbye to jscs.
falsyvaluesMar 12, 2017
ad3236a
Remove `countHolders`.
jdaltonMar 13, 2017
c89637e
Use more destructuring.
jdaltonMar 13, 2017
2f281c6
Remove `baseNth`.
jdaltonMar 13, 2017
bb7c959
Remove coercion method use.
jdaltonMar 14, 2017
f983ff2
Prefere ES6 templates.
falsyvaluesMar 14, 2017
351e44a
Fixin some leftovers bb7c959.
falsyvaluesMar 14, 2017
b8a3a42
Remove `toString` coercion method use.
jdaltonMar 15, 2017
9d11b48
Remove `toUpper` and `toLower`.
jdaltonMar 15, 2017
164bc71
Remove `toString` from `createCompounder`.
jdaltonMar 16, 2017
929a996
Remove `arrayReduce` from `createCompounder`.
jdaltonMar 16, 2017
76ab9cd
Adjust styling of array checks in `head`, `uniq`, `uniqBy` and `uniqW…
falsyvaluesMar 16, 2017
3c324a7
Remove `toString` use from `createCaseFirst`.
jdaltonMar 17, 2017
0acb284
Remove `toString` use from `castPath`.
jdaltonMar 18, 2017
f3e0cbe
Use more `Array#map`.
jdaltonMar 21, 2017
f7a6cdd
Remove `nativeKeys` and `nativeKeysIn`.
jdaltonMar 22, 2017
a8abced
Fixin `keysIn` import in `getAllKeysIn` by switching to `baseKeysIn`.
falsyvaluesMar 22, 2017
8db488b
Remove `getRawTag` and `objectToString`.
jdaltonMar 23, 2017
ecb3c10
Simplify `flip`.
jdaltonMar 24, 2017
4b80666
Simplify `tail`.
jdaltonMar 24, 2017
d7bdf0a
Remove `createCompounder`.
jdaltonMar 27, 2017
8be26ac
Implement `baseEach` and `baseEachRight` since `createBaseFor` is gone.
falsyvaluesMar 27, 2017
6d19563
Simplify `words`.
jdaltonMar 27, 2017
dad1fcc
Remove unused internal `createCtor`.
jdaltonMar 27, 2017
64d92dd
Remove stubTrue from cond example (#3085)
102Mar 30, 2017
43a520c
Remove constant function from examples (#3086)
102Mar 30, 2017
b679e9c
Update _.pad* examples to show pad length < string. (#3088)
merriamMar 30, 2017
1bdda20
Reimplement find.
jdaltonApr 1, 2017
6543d32
Add `someObj`.
jdaltonApr 3, 2017
6dc0383
Add `semi` option to eslint config.
falsyvaluesApr 3, 2017
53cac4e
ESify `find` implementation.
falsyvaluesApr 3, 2017
ca2fd5c
Remove semicolons.
falsyvaluesApr 3, 2017
571e752
Rename `someObj` to `someValues`.
jdaltonApr 3, 2017
f3957ac
Remove `replaceHolders`.
jdaltonApr 3, 2017
3e2b0bb
Use more for-of
jdaltonApr 3, 2017
402ca89
Fixin declaration in `baseSum` (3e2b0bb).
falsyvaluesApr 4, 2017
645acd4
Fixin declaration in `someValues` (571e752).
falsyvaluesApr 4, 2017
96ebd44
Fixin missing references in `repeat`.
falsyvaluesApr 4, 2017
7c92111
Fixin scope range for var declarations in `hasPath` and `hasPathIn`.
falsyvaluesApr 4, 2017
bbd59f8
Catch undeclared vars with eslint.
falsyvaluesApr 4, 2017
2538a56
Math them all.
falsyvaluesApr 4, 2017
b506174
Use more for-of
falsyvaluesApr 5, 2017
99fb4c8
Fixin scope range for var declarations in internal version of `hasPath`.
falsyvaluesApr 6, 2017
3390d93
Remove internal `hasPath`.
jdaltonApr 7, 2017
303502e
Remove `toSource`.
jdaltonApr 9, 2017
d10b44b
Adjust spacing in template string expressions.
jdaltonApr 9, 2017
23ae2c5
Split out `every` into `everyValue`.
jdaltonApr 10, 2017
b898547
Rename `someValues` to `someValue`.
jdaltonApr 10, 2017
f888dfe
Adjust eslint settings to new requirements (d10b44b).
falsyvaluesApr 10, 2017
aafd66d
Last spacing in template string expressions.
falsyvaluesApr 10, 2017
b79b715
Enable no-unexpected-multiline (#3103)
captbaritoneApr 12, 2017
e02db41
Proper `style` npm script execution (#3103).
falsyvaluesApr 14, 2017
8a51574
Rename `mapKeys` and `mapValues` to `mapKey` and `mapValue`.
jdaltonApr 16, 2017
73ce606
Fix jsdoc for `every` and `some`.
jdaltonApr 16, 2017
0bdc731
Split `map` out.
jdaltonApr 16, 2017
8b74809
Simplify `mapKey` and `mapValue`.
jdaltonApr 16, 2017
64a9975
Split `filter` out.
jdaltonApr 16, 2017
e2941dd
Fix typos.
jdaltonApr 16, 2017
aa5e1b2
Fix object coercion.
jdaltonApr 16, 2017
58e484f
Remove `baseKeys` and `baseKeysIn`.
jdaltonApr 16, 2017
a023f92
Fix typo in `find`.
jdaltonApr 16, 2017
e5e8f35
Remove `baseSlice`.
jdaltonApr 18, 2017
bb059c0
Fixin new `map` imports.
falsyvaluesApr 18, 2017
4092747
Fixin `some` and `every` imports.
falsyvaluesApr 18, 2017
65b148a
Remove `mergeData`.
jdaltonApr 19, 2017
08a3f53
Use `Array#splice` directly.
jdaltonApr 19, 2017
ae4e45d
Fixin `filter` imports.
falsyvaluesApr 20, 2017
a6019d5
Fixin `repeat` import.
falsyvaluesApr 23, 2017
f03b3ed
Update object checks.
jdaltonApr 24, 2017
67a3fb9
Fix cloneDeep with circularly dependent Sets/Maps (#3123)
greenbergaApr 24, 2017
5dce119
Cleanup baseClone.
jdaltonApr 30, 2017
f6827f4
Fix CoC link in REAMDE (#3138)
prtksxnaMay 3, 2017
0b31164
Complete wrapper modules removal for `setToString` (c6854fa).
falsyvaluesMay 9, 2017
f659da7
Fix CoC link in .github/CONTRIBUTING.md (#3156)
hargasinskiMay 13, 2017
0274d3d
Always use parentheses in arrow functions (fixin 67a3fb9).
falsyvaluesMay 18, 2017
8620733
Fixin tag scope in `baseClone`.
falsyvaluesMay 18, 2017
b107653
A better fix for `tag` scope in `baseClone`.
falsyvaluesMay 18, 2017
bacaaae
Support symbols in property paths of `set`. [closes #3189]
jdaltonJun 6, 2017
61acdd0
default prefix to empty string (#3214)
jisaacksJun 20, 2017
e908519
stringToPath: avoid shadowing variable (#3226)
aretecodeJun 27, 2017
534296b
Update dropRight.js (#3241)
MingYinLvJul 3, 2017
01148a1
Avoid using the values toString method in _.invert if it’s not a func…
jdaltonJul 12, 2017
536f09b
Fixin loop args order regression from 3c2795b in `invert`.
falsyvaluesJul 14, 2017
bcd13b2
Fixin loop args order regression from 3c2795b in `invertBy`.
falsyvaluesJul 14, 2017
527b167
_.update() docs grammar fix (#3264)
nullvariableJul 17, 2017
76c1ed2
avoid shadowing result (#3280)
aretecodeJul 25, 2017
c2616dd
Remove useless return in setToPairs. (#3286)
aretecodeJul 31, 2017
a0a3a6a
Fix typo in findKey.
jdaltonAug 7, 2017
03e23ec
clarify documentation about sortedUniq (#3310)
Aug 9, 2017
8e631df
Faster testing against first char in `stringToPath` (to close #3308).
falsyvaluesAug 14, 2017
f5ea579
Fixes param definition (#3368)
rssteffeySep 13, 2017
6ad829f
Add pending() function to debounce and throttle to fix #3387 (#3388)
chriscaloSep 27, 2017
1b1bb79
Commit and whitespace nits in debounce.
jdaltonOct 2, 2017
3ab9906
Verbiage change (#3408)
Oct 3, 2017
270ca71
Add missing keysIn import for baseClone.js (#3413)
drabinowitzOct 5, 2017
00705af
Add jsDelivr hits badge (#3418)
LukasDrgonOct 9, 2017
bf5d086
Remove semicolons from `dropRight`.
falsyvaluesOct 16, 2017
413a38c
Remove trailing space in `sortedUniq`.
falsyvaluesOct 16, 2017
bcd2c35
Fix typo in `parseInt` (#3433)
younesfkihiOct 18, 2017
e8c87cf
Ignore log files that end with random numbers (#3445)
matthewdordalOct 23, 2017
102d9e3
Fix typo in `escapeRegExp` (#3448)
younesfkihiOct 25, 2017
7c006f7
Fix #3466 (#3467)
yuxinoNov 2, 2017
30d305d
Modify the logic to make the code more intuitive (#3472)
yuxinoNov 4, 2017
424d9fc
Fix typo in `inRange` (#3478)
younesfkihiNov 6, 2017
e23c874
Tiny performance improvement by not compiling regular expression each…
nazar-pcNov 7, 2017
b36f21c
Faster/simpler isPlainObject check (#3483)
timdorrNov 8, 2017
76c2e0a
Revert "Fix typo in `escapeRegExp` (#3448)"
falsyvaluesNov 8, 2017
c3b3c71
Tiny style correction in `createMathOperation`.
falsyvaluesNov 8, 2017
8464b18
Remove `map` examples from `parseInt` and `trim` (#3487)
younesfkihiNov 10, 2017
40e096b
Fix operator in `createMathOperation`. (#3499)
kybetterNov 17, 2017
462bc9b
Update license file with MIT title (#3498)
GCHQDeveloper500Nov 18, 2017
3a330e0
feat(sideEffects): Set sideEffects false for opt. (#3533)
TheLarkInnDec 5, 2017
b2ea6b1
Remove duplicated "by which" words from the doc (#3534)
AlexanderLukinDec 6, 2017
fa73d46
Enable _.words to detect ordinals in compound words. [closes #3561]
jdaltonDec 29, 2017
d985dbf
rAF as default for debounce/throtte (#3560) (#3567)
mattlubnerJan 1, 2018
e9562a6
Update argument count for `cloneWith` customizer. [closes #3582]
jdaltonJan 9, 2018
7569024
Add the accepted customizer arguments to cloneDeepWith docs.
jdaltonJan 14, 2018
77c128f
Changed to function as documented. (#3596)
CrysinyanJan 20, 2018
803c05d
Support locales in sorting methods (#3602)
JoosAIJan 26, 2018
47a6d53
Cleanup compareAscending and remove hardcoded locale.
jdaltonJan 26, 2018
54f05aa
Update documentation in slice.js (#3631)
jnfingerleFeb 6, 2018
7f24cab
add uniq Map for generated ID (#3644)
PxyUpFeb 13, 2018
678eb00
Add string example to isEmpty docs (#3647)
Dean177Feb 17, 2018
c1f805f
use isObjectLike module instead of (typeof value == 'object' && value…
alirezavalizadeFeb 19, 2018
f73b35b
Implement `defaultToAny` method (#3615)
eran-nussbaumMar 8, 2018
6e4cdc0
Fix npm link in README.md (#3700)
pahomovMar 22, 2018
363fef0
internal: use util.types to migrate DEP0103 in Node.js (#3704)
joyeecheungMar 23, 2018
da0fad3
Fix inclusion of litteral "+" in rsMisc (#3736)
misoglApr 6, 2018
224a256
Update _.union documentation (#3758)
Apr 17, 2018
a9d3ca8
Updates version on README header (#3767)
ecbrodieApr 24, 2018
fe14140
Drop version number from readme.
jdaltonApr 24, 2018
04a66a0
Update countBy doc example to be more at a glance friendly. [closes #…
jdaltonMay 1, 2018
79dc90d
Allow compareMultiple to accept compare functions in addition to orde…
ryanhomerMay 1, 2018
50860fd
Added short circuit for typed arrays (#3786)
twolfsonMay 13, 2018
1859802
Remove trailing space in `slice`
falsyvaluesMay 15, 2018
0d361bc
Remove semicolons from `sampleSize` and `baseClone`
falsyvaluesMay 15, 2018
aff1928
Tiny style correction in `uniqueId` and `compareMultiple`
falsyvaluesMay 15, 2018
92a6575
Avoid skipping set of -0 when an existing +0 exists. [closes #3798]
jdaltonMay 18, 2018
b8dfb7c
Create fromEntries.js (#3809)
ycmjasonJun 1, 2018
51c5622
Add example of Array slice (#3823)
renjithspaceJun 12, 2018
4ba0f8b
Remove more methods.
jdaltonJun 15, 2018
4ea8c2e
Remove unused var from tail().
jdaltonJun 15, 2018
ab960bd
Clarify doc for `range` usage with single arg (#3854)
doug-a-brunnerJun 28, 2018
4851183
Update `filterObject` docs to reference `pickBy` (#3861)
cooperkaJul 10, 2018
6018350
Add extended and supplement combining marks ranges (#3932)
dracosSep 2, 2018
715aae6
add snakeCase example with digit (#3993)
abdullahtariq1171Oct 8, 2018
6bdb8a2
Add missing space in uniqWith docblock (#3995)
j3bb9zOct 9, 2018
d9c5082
add round up description on ceil documentation (#4027)
alireza-mhOct 28, 2018
c4075c1
Update deps (eslint-plugin-import@2.14.0)
falsyvaluesOct 29, 2018
1e93991
converted to fat arrow function (#4059)
saravyasNov 13, 2018
f822dd8
Add lodash-es description for ES6 scripts (#4035)
alireza-mhNov 15, 2018
580cd4c
Remove n_ note for unsupported Node.
jdaltonNov 15, 2018
136d525
Added arrow function in below files (#4061)
saravyasNov 18, 2018
3b96b91
Call upperFirst directly, instead of capitalize, in camelCase (#4075)…
blikblumNov 25, 2018
4cae8fb
Remove support for node v0.10 in arrayLikeKeys (#4079)
blikblumNov 25, 2018
7885483
Remove support for PhantomJS in arrayLikeKeys (#4081)
blikblumNov 25, 2018
c3740e0
Remove unnecessary null check in arrayEach (#4082)
blikblumNov 25, 2018
377e2d8
fix: limit the precision when the precision is negative (#4085)
asilinweiNov 28, 2018
3b199c3
Remove checks for the Map existence (#4091)
blikblumNov 30, 2018
508d46a
Replace MapCache by Map in memoize (#4094) (#4095)
blikblumDec 1, 2018
8eccdd0
Restore createAssigner (fixes compilation of merge and mergeWith) (#4…
blikblumDec 5, 2018
151e316
Remove check for existence of getOwnPropertySymbols (#4102)
blikblumDec 5, 2018
c33df31
Re-add keysIn module fixing baseClone and baseMerge (#4099) (#4100)
blikblumDec 6, 2018
daf1f1b
Fix findLast missing dependency (#4103)
blikblumDec 6, 2018
2130eac
Fix baseClone missing dependency (#4104)
blikblumDec 6, 2018
7f2ee90
Fix baseOrderBy missing dependency (#4105)
blikblumDec 6, 2018
4c55ea7
Use baseGetTag instead of getTag where possible (#4112)
blikblumDec 11, 2018
6cb1f71
Assume Symbol is always defined (#4111)
blikblumDec 11, 2018
c77650a
Remove check for Symbol.toStringTag field mutations in baseGetTag (#4…
blikblumDec 11, 2018
aa1d7d8
Replace getTag implementation by the one from baseGetTag (remove work…
blikblumDec 11, 2018
238e763
Use native filter instead of custom one where possible (#4116)
blikblumDec 11, 2018
a7e0428
Add .github/.lock.yml config for lock bot.
jdaltonDec 26, 2018
afab656
Change type check and the way of sending params. (#4145)
moonformeliJan 11, 2019
f4ca396
Use 3 equal signs (#4153)
moonformeliJan 16, 2019
6248f8a
use extension resolution (#4163)
43081jJan 20, 2019
3ae8f23
Locally scope key in keysIn (#4173)
carburetedJan 27, 2019
fe7da41
Cancel old timer, editing pr #4139 (#4187)
moonformeliFeb 12, 2019
7606ea3
Update package.json version.
jdaltonFeb 12, 2019
d5ef319
Add initial test files from lodash v4. (#4172)
bnjmnt4nFeb 12, 2019
e7221b9
Remove --save option as it isn't required anymore (#4199)
stevemoserFeb 20, 2019
c541e4c
Fix _.maxBy and _.minBy (#4233)
gu-xionghongMar 12, 2019
750067f
tweak _.clone/_.cloneDeep docs (#4239)
dwelleMar 18, 2019
c68170b
Fix findLast missing dependency (#4259)
gu-xionghongApr 14, 2019
6b1d83c
Fix typo in toPlainObject().
jdaltonApr 15, 2019
8fdf0ed
Minor doc format (#4285)
Apr 28, 2019
488e62b
Fix stringToPath bug for consecutive [] (#4319)
futuristJun 7, 2019
abde931
Fix typo in merge test (#4334)
tkruggJun 24, 2019
4df3272
fix reTypedTag error (#4342)
lvzhenbangJun 26, 2019
8bc17fe
Add support for globalThis when detecting global object (#4347)
Jack-WorksJul 2, 2019
dce7fcc
Add back accidentally removed semicolons to escape.js.
jdaltonJul 2, 2019
becd982
docs(security): add responsible disclosure policy (#4374)
lirantalJul 23, 2019
f8c7064
Cleanup security.md document.
jdaltonJul 23, 2019
e2ae5b8
Add missing isTypedArray import to baseClone (#4404)
blikblumAug 15, 2019
142cee0
Do not use property shorthand in countBy documentation (#4405)
blikblumAug 15, 2019
4f68e93
Add missing isObject import to isIterateeCall (#4409)
blikblumAug 16, 2019
ff4949b
Coerce indexOf fromIndex parameter to integer (#4410)
blikblumAug 16, 2019
a965836
Enable indexOf tests (#4411)
blikblumAug 16, 2019
37cd5dc
Coerce drop and dropRight n param using toInteger (#4412)
blikblumAug 16, 2019
5b4dc54
Coerce to integer and set default value for chunk size parameter (#4413)
blikblumAug 17, 2019
15e1557
lint files (#4416)
phapdinhAug 17, 2019
e2555a4
Implement asciiWords and unicodeWords using String.match instead of b…
blikblumAug 18, 2019
f90d0ae
Update `eslint` and `eslint-plugin-import`
falsyvaluesAug 20, 2019
8b441a5
Align indentations
falsyvaluesAug 20, 2019
2cf08be
Ensure after n parameter is coerced from NaN to 0 (#4430)
blikblumAug 22, 2019
1011cfd
merge: copy function values independent of source index (#4429)
blikblumAug 22, 2019
e5f8407
Flatten at paths parameter (#4431)
blikblumAug 22, 2019
9971765
Enable create tests and adapt it for the new primitive prototype beha…
blikblumAug 22, 2019
91c9cb1
Ensure escapeRegExp returns an empty string when passing falsy values…
blikblumAug 22, 2019
ed4b3a2
Enable case methods tests (#4436)
blikblumAug 24, 2019
3ebb38d
Coerce findLastIndex and lastIndexOf fromIndex parameter to integer …
blikblumAug 24, 2019
abb54cc
Simplify toString (#4441)
blikblumAug 25, 2019
e51a424
Fix string methods to handle empty values (#4442)
blikblumAug 26, 2019
0e9d44e
Fix flow and flowRight parameter handling (#4445)
blikblumAug 28, 2019
ad38dc0
Prevent ReDos in words (#4450)
blikblumAug 28, 2019
5df1777
add order by behaviour with array similar to get method (#4453)
Mohit21GoJsAug 30, 2019
29eb571
Cleanup baseOrderBy.
jdaltonAug 30, 2019
898b378
perfomance fixes, eslint fixes (#4482)
anatoliisfSep 26, 2019
23286d6
Short circuit sortedIndexBy methods for empty arrays (#4496)
megawacOct 3, 2019
23b2a33
Fix vulnerabilities in npm packages (#4490)
prog1devOct 3, 2019
619ac69
Ensure `orderBy` will accept iteratee path arrays #4438 (#4513)
falsyvaluesOct 17, 2019
657f8bf
Fix parentheses placement broken in 16413cc
falsyvaluesNov 6, 2019
a6b960b
Remove extraneous conditional (#4531)
camjcNov 12, 2019
cefddab
Updated the check of isFunction method (#4555)
RajuPeddaNov 19, 2019
04ebca6
Enable escape and once tests (#4618)
blikblumJan 8, 2020
3f585df
Fix uniqueId prefix coercion (#4619)
blikblumJan 22, 2020
588bf3e
Handle leading zeros in quote html entity (#4623)
gwwarFeb 5, 2020
0541ec8
Update links in CONTRIBUTING.md (#4741)
dwesty17May 5, 2020
08110bd
fix: fix the jsdoc of SetCache#has (#4739)
Keith-CYMay 5, 2020
74b09d6
fix: fix the params of Hash#delete in in jsdoc (#4737)
Keith-CYMay 6, 2020
86a852f
Changing font-style to monospace for '--save' option in README.md (#4…
fs-projectsJun 4, 2020
e002948
Update links in CONTRIBUTING.md & README.md (#4829)
thxiamiOct 28, 2020
2f900b6
Remove outdated contributor tips (#5008)
csojinbDec 20, 2020
bcd0610
Cleanup package.json and CONTRIBUTING.md.
bnjmnt4nDec 21, 2020
5aaf898
Fix ESLint errors and tests.
bnjmnt4nDec 21, 2020
2f79053
Enable GitHub Actions CI.
bnjmnt4nDec 21, 2020
540148d
Update tests.yml (#5140)
de-arApr 23, 2021
2da024c
perf: use `===` instead of `==` (#5118)
jacob-lcsApr 23, 2021
97d4a2f
wip: migrate to bun
jdaltonSep 16, 2023
0b28b7f
wip: code formatting nits
jdaltonSep 16, 2023
b5c5931
wip: code formatting nits continued
jdaltonSep 17, 2023
5308be3
wip: code formatting nits continued
jdaltonSep 17, 2023
49683ff
ci: make it work (#5728)
tisonkunSep 19, 2023
bd518dd
test: partially fix broken tests (#5733)
tisonkunSep 21, 2023
a79c5c4
wip: unit test fixes continued
jdaltonSep 21, 2023
aa18212
test: fix cannot find root (#5741)
tisonkunSep 27, 2023
c7c70a7
test: add some cases (#5789)
jinbekimJan 11, 2024
a67a085
fix: inRange test (#5821)
ygj6Apr 16, 2024
6a2cc1d
chore: combine the if statements into one (#5785)
KEHyeonJul 10, 2024
054cf56
feat: refactor createMathOperation to use convertToNumberOrString uti…
saddamhrSep 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
PrevPrevious commit
NextNext commit
wip: code formatting nits continued
  • Loading branch information
@jdalton
jdalton committedSep 17, 2023
commitb5c59317ea541124dcd02a02551f19ded81b9fd3
5 changes: 3 additions & 2 deletions.eslintrc
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,9 +24,11 @@
"rules": {
"prettier/prettier": "error",
// Overridden
"no-eval": "off",
"camelcase": ["error", { "properties": "never", "allow": [ "W[0-9]+_"] }],
"import/extensions": "off",
"no-eval": "off",
"no-self-compare": "off",
"one-var": ["error", "never"],
// @TODO: Fix the following rules progressively.
"arrow-body-style": "warn",
"prefer-arrow-callback": "warn",
Expand All@@ -46,7 +48,6 @@
"guard-for-in": "off",
"import/prefer-default-export": "off",
"prefer-rest-params": "off",
"one-var": "off",
"prefer-spread": "off",
"no-lonely-if": "off",
"no-prototype-builtins": "off",
Expand Down
2 changes: 1 addition & 1 deletionpackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@
"sideEffects": false,
"scripts": {
"prepare": "husky install",
"lint": "eslint ./src/**/*.ts ./test/**/*.ts"
"lint": "eslint ./src/**/*.ts"
},
"devDependencies": {
"@commitlint/cli": "17.7.1",
Expand Down
2 changes: 1 addition & 1 deletionsrc/.internal/cloneBuffer.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,7 @@ function cloneBuffer(buffer, isDeep) {
return buffer.slice()
}
const length = buffer.length
const result = allocUnsafe ? allocUnsafe(length) :newbuffer.constructor(length)
const result = allocUnsafe ? allocUnsafe(length) : buffer.constructor.alloc(length)

buffer.copy(result)
return result
Expand Down
5 changes: 3 additions & 2 deletionssrc/after.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,12 +15,13 @@
* forEach(saves, type => asyncSave({ 'type': type, 'complete': done }))
* // => Logs 'done saving!' after the two async saves have completed.
*/
function after(n, func) {
function after(n, func: Function) {
if (typeof func !== 'function') {
throw new TypeError('Expected a function');
}
n = n || 0;
return function (...args) {
// eslint-disable-next-line consistent-return
return function (this: any, ...args: any[]) {
if (--n < 1) {
return func.apply(this, args);
}
Expand Down
2 changes: 1 addition & 1 deletionsrc/clamp.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,7 @@
* clamp(10, -5, 5)
* // => 5
*/
function clamp(number, lower, upper) {
function clamp(number: number, lower: number, upper: number) {
number = +number;
lower = +lower;
upper = +upper;
Expand Down
8 changes: 4 additions & 4 deletionssrc/cond.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,19 +27,19 @@ import map from './map.js';
* func({ 'a': '1', 'b': '2' })
* // => 'no match'
*/
function cond(pairs) {
function cond(pairs: any[]) {
const length = pairs == null ? 0 : pairs.length;

pairs = !length
? []
: map(pairs, (pair) => {
: map(pairs, (pair: any[]) => {
if (typeof pair[1] !== 'function') {
throw new TypeError('Expected a function');
}
return [pair[0], pair[1]];
});

return(...args) => {
// eslint-disable-next-line consistent-return
returnfunction (this: any,...args: any[]) {
for (const pair of pairs) {
if (pair[0].apply(this, args)) {
return pair[1].apply(this, args);
Expand Down
8 changes: 6 additions & 2 deletionssrc/debounce.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,8 +63,12 @@ import root from './.internal/root.js';
* const status = debounced.pending() ? "Pending..." : "Ready"
*/
function debounce(func, wait, options) {
let lastArgs, lastThis, maxWait, result, timerId, lastCallTime;

let lastArgs;
let lastThis;
let maxWait;
let result;
let timerId;
let lastCallTime;
let lastInvokeTime = 0;
let leading = false;
let maxing = false;
Expand Down
1 change: 1 addition & 0 deletionssrc/deburr.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,6 +23,7 @@ const rsCombo = `[${rsComboRange}]`;
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
*/
// eslint-disable-next-line no-misleading-character-class
const reComboMark = RegExp(rsCombo, 'g');

/**
Expand Down
3 changes: 2 additions & 1 deletionsrc/defer.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,10 +12,11 @@
* defer(text => console.log(text), 'deferred')
* // => Logs 'deferred' after one millisecond.
*/
function defer(func, ...args) {
function defer(func: Function, ...args: any[]) {
if (typeof func !== 'function') {
throw new TypeError('Expected a function');
}
// eslint-disable-next-line @typescript-eslint/no-implied-eval
return setTimeout(func, 1, ...args);
}

Expand Down
3 changes: 2 additions & 1 deletionsrc/delay.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,10 +13,11 @@
* delay(text => console.log(text), 1000, 'later')
* // => Logs 'later' after one second.
*/
function delay(func, wait, ...args) {
function delay(func: Function, wait: number, ...args: any[]) {
if (typeof func !== 'function') {
throw new TypeError('Expected a function');
}
// eslint-disable-next-line @typescript-eslint/no-implied-eval
return setTimeout(func, +wait || 0, ...args);
}

Expand Down
1 change: 1 addition & 0 deletionssrc/each.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
// eslint-disable-next-line no-restricted-exports
export { default } from './forEach.js';
1 change: 1 addition & 0 deletionssrc/eachRight.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
// eslint-disable-next-line no-restricted-exports
export { default } from './forEachRight.js';
14 changes: 7 additions & 7 deletionssrc/findKey.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,18 +21,18 @@
* // => 'barney' (iteration order is not guaranteed)
*/
function findKey(object, predicate) {
let result;
if (object == null) {
returnresult;
returnundefined;
}
Object.keys(object).some((key) => {
const keys = Object.keys(object);
for (let i = 0, { length } = keys; i < length; i += 1) {
const key = keys[i];
const value = object[key];
if (predicate(value, key, object)) {
result = key;
return true;
return key;
}
});
returnresult;
}
returnundefined;
}

export default findKey;
1 change: 1 addition & 0 deletionssrc/first.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
// eslint-disable-next-line no-restricted-exports
export { default } from './head.js';
18 changes: 9 additions & 9 deletionssrc/flow.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,19 +20,19 @@
* addSquare(1, 2)
* // => 9
*/
function flow(...funcs) {
function flow(...funcs: Function[]) {
const length = funcs.length;
letindex = length;
while (index--) {
if (typeof funcs[index] !== 'function') {
leti = length;
while (i--) {
if (typeof funcs[i] !== 'function') {
throw new TypeError('Expected a function');
}
}
return function (...args) {
letindex = 0;
let result = length ? funcs[index].apply(this, args) : args[0];
while (++index < length) {
result = funcs[index].call(this, result);
return function (this: any,...args: any[]) {
letj = 0;
let result = length ? funcs[j].apply(this, args) : args[0];
while (++j < length) {
result = funcs[j].call(this, result);
}
return result;
};
Expand Down
2 changes: 1 addition & 1 deletionsrc/isBuffer.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,7 @@ const nativeIsBuffer = root?.Buffer?.isBuffer;
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* isBuffer(newBuffer(2))
* isBuffer(Buffer.alloc(2))
* // => true
*
* isBuffer(new Uint8Array(2))
Expand Down
7 changes: 5 additions & 2 deletionssrc/keyBy.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,10 +23,13 @@ import reduce from './reduce.js';
* keyBy(array, ({ code }) => String.fromCharCode(code))
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*/
function keyBy(collection, iteratee) {
function keyBy(collection: any, iteratee: Function) {
return reduce(
collection,
(result, value, key) => (baseAssignValue(result, iteratee(value), value), result),
(result: object, value: any) => {
baseAssignValue(result, iteratee(value), value);
return result;
},
{},
);
}
Expand Down
3 changes: 2 additions & 1 deletionsrc/nth.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,12 +19,13 @@ import isIndex from './.internal/isIndex.js';
* nth(array, -2)
* // => 'c'
*/
function nth(array, n) {
function nth(array: any[], n: number) {
const length = array == null ? 0 : array.length;
if (!length) {
return;
}
n += n < 0 ? length : 0;
// eslint-disable-next-line consistent-return
return isIndex(n, length) ? array[n] : undefined;
}

Expand Down
5 changes: 4 additions & 1 deletionsrc/partition.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,10 @@ import reduce from './reduce.js';
function partition(collection, predicate) {
return reduce(
collection,
(result, value, key) => (result[predicate(value) ? 0 : 1].push(value), result),
(result, value) => {
result[predicate(value) ? 0 : 1].push(value);
return result;
},
[[], []],
);
}
Expand Down
4 changes: 2 additions & 2 deletionssrc/transform.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -48,8 +48,8 @@ function transform(object, iteratee, accumulator) {
accumulator = {};
}
}
(isArrLike ? arrayEach : baseForOwn)(object, (value, index,object) =>
iteratee(accumulator, value, index,object),
(isArrLike ? arrayEach : baseForOwn)(object, (value, index,_object) =>
iteratee(accumulator, value, index,_object),
);
return accumulator;
}
Expand Down
2 changes: 1 addition & 1 deletionsrc/trim.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ import stringToArray from './.internal/stringToArray.js';
* trim('-_-abc-_-', '_-')
* // => 'abc'
*/
function trim(string, chars) {
function trim(string: string, chars: string) {
if (string && chars === undefined) {
return string.trim();
}
Expand Down
2 changes: 1 addition & 1 deletionsrc/union.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,7 @@ import isArrayLikeObject from './isArrayLikeObject.js';
* union([2, 3], [1, 2])
* // => [2, 3, 1]
*/
function union(...arrays) {
function union(...arrays: any[]) {
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
}

Expand Down
1 change: 1 addition & 0 deletionssrc/unzip.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,6 +26,7 @@ function unzip(array) {
return [];
}
let length = 0;
// eslint-disable-next-line consistent-return
array = filter(array, (group) => {
if (isArrayLikeObject(group)) {
length = Math.max(group.length, length);
Expand Down
1 change: 1 addition & 0 deletionssrc/words.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ const hasUnicodeWord = RegExp.prototype.test.bind(
);

/** Used to match words composed of alphanumeric characters. */
// eslint-disable-next-line no-control-regex
const reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;

function asciiWords(string) {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp