A partial port of lodash and test suit to TypeScript for the Deno JavaScript runtime.
Repository
Current version released
5 years ago
nodash
A partial port of lodash and test suit to TypeScript
for the Deno JavaScript runtime.
Project goals:
- have the most identical port of
lodashimplementation (line-by-line) - have the most identical test suite (line-by-line) of
lodash - not a complete
lodashport: only the parts needed in ECMA 6 - fully typed in TypeScript and passes
deno lint - can import individual functions (
_symbol is optional, i.e. “nodash”) - each release tag of
nodashwill reference alodashrelease tag
Changes from Lodash
- many public functions have been excluded if an equivalent ECMA 6 feature exists
get,has, etc. no longer takepath: Array<string|symbol>, onlypath: string- private function
_caseFirsthas a different signature
Usage
For the bold:
import {
isEmpty,
isNull,
isUndefined,
} from "https://deno.land/x/nodash/src/mod.ts";For the familiar:
import * as _ from "https://deno.land/x/nodash/src/mod.ts";Project status:
- Partial Lang port of all “is” functions (e.g.
isString,isEmpty, etc.) - Partial Lang port of “to” functions:
-
toFinite -
toInteger -
toNumber -
toSafeInteger -
toString
-
- Function
-
debounce -
throttle
-
- Object
-
get -
has -
set -
unset
-
- String
-
deburr -
camelCase -
capitalize -
kebabCase -
lowerCase -
snakeCase -
startCase -
upperCase -
words
-
Contributions
✨💎✨ Contributions are welcome. ✨💎✨
For additional ports, please:
- open an issue w/ proposal
- open a PR w/ code contribution (linked to issue)
- include all relevant tests from lodash (ported)
- pass
deno lintand rundeno fmt
nodash-cli
To update the mod.ts file:
# scans all ./src/**/*.ts files for exported functions w/ @export jsdoc tags
./nodash-cli --update-mod