UNPKG

closest-property

Version:

When given an object and a string, will return the value corresponding to the key that is the closest (according to the levenshtein distance, where case is ignored) to the given string.

48 lines (47 loc) 1.2 kB
{ "name": "closest-property", "version": "1.0.1", "description": "", "main": "lib/index.js", "types": "lib/index.d.ts", "files": [ "lib/**/*" ], "scripts": { "build": "tsc", "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", "lint": "tslint -p tsconfig.json", "test": "jest --config jestconfig.json", "prepare": "npm run build", "prepublishOnly": "npm test && npm run lint", "preversion": "npm run lint", "version": "npm run format && git add -A src", "postversion": "git push && git push --tags" }, "repository": { "type": "git", "url": "git+https://github.com/chrismilson/closest-property.git" }, "keywords": [ "closest", "key", "property", "member", "object" ], "author": "Chris Milson", "license": "MIT", "bugs": { "url": "https://github.com/chrismilson/closest-property/issues" }, "homepage": "https://github.com/chrismilson/closest-property#readme", "devDependencies": { "@types/jest": "^25.1.2", "jest": "^25.1.0", "prettier": "^1.19.1", "ts-jest": "^25.2.0", "tslint": "^6.0.0", "tslint-config-prettier": "^1.18.0", "typescript": "^3.7.5" } }