pax_global_header00006660000000000000000000000064134617437200014521gustar00rootroot0000000000000052 comment=628be98fd3b9a1e19baca3ea6f2f8a1266342399 lowercase-keys-2.0.0/000077500000000000000000000000001346174372000144555ustar00rootroot00000000000000lowercase-keys-2.0.0/.editorconfig000066400000000000000000000002571346174372000171360ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.yml] indent_style = space indent_size = 2 lowercase-keys-2.0.0/.gitattributes000066400000000000000000000000231346174372000173430ustar00rootroot00000000000000* text=auto eol=lf lowercase-keys-2.0.0/.gitignore000066400000000000000000000000271346174372000164440ustar00rootroot00000000000000node_modules yarn.lock lowercase-keys-2.0.0/.npmrc000066400000000000000000000000231346174372000155700ustar00rootroot00000000000000package-lock=false lowercase-keys-2.0.0/.travis.yml000066400000000000000000000000651346174372000165670ustar00rootroot00000000000000language: node_js node_js: - '12' - '10' - '8' lowercase-keys-2.0.0/index.d.ts000066400000000000000000000005371346174372000163630ustar00rootroot00000000000000/** Lowercase the keys of an object. @returns A new object with the keys lowercased. @example ``` import lowercaseKeys = require('lowercase-keys'); lowercaseKeys({FOO: true, bAr: false}); //=> {foo: true, bar: false} ``` */ declare function lowercaseKeys(object: {[key: string]: T}): {[key: string]: T}; export = lowercaseKeys; lowercase-keys-2.0.0/index.js000066400000000000000000000002621346174372000161220ustar00rootroot00000000000000'use strict'; module.exports = object => { const result = {}; for (const [key, value] of Object.entries(object)) { result[key.toLowerCase()] = value; } return result; }; lowercase-keys-2.0.0/index.test-d.ts000066400000000000000000000003471346174372000173370ustar00rootroot00000000000000import {expectType} from 'tsd'; import lowercaseKeys = require('.'); expectType<{[key: string]: boolean}>(lowercaseKeys({FOO: true, bAr: false})); expectType<{[key: string]: string | number}>(lowercaseKeys({foo: 'bar', baz: 1})); lowercase-keys-2.0.0/license000066400000000000000000000021251346174372000160220ustar00rootroot00000000000000MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. lowercase-keys-2.0.0/package.json000066400000000000000000000011461346174372000167450ustar00rootroot00000000000000{ "name": "lowercase-keys", "version": "2.0.0", "description": "Lowercase the keys of an object", "license": "MIT", "repository": "sindresorhus/lowercase-keys", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "object", "assign", "extend", "properties", "lowercase", "lower-case", "case", "keys", "key" ], "devDependencies": { "ava": "^1.4.1", "tsd": "^0.7.2", "xo": "^0.24.0" } } lowercase-keys-2.0.0/readme.md000066400000000000000000000010211346174372000162260ustar00rootroot00000000000000# lowercase-keys [![Build Status](https://travis-ci.org/sindresorhus/lowercase-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/lowercase-keys) > Lowercase the keys of an object ## Install ``` $ npm install lowercase-keys ``` ## Usage ```js const lowercaseKeys = require('lowercase-keys'); lowercaseKeys({FOO: true, bAr: false}); //=> {foo: true, bar: false} ``` ## API ### lowercaseKeys(object) Returns a new object with the keys lowercased. ## License MIT © [Sindre Sorhus](https://sindresorhus.com) lowercase-keys-2.0.0/test.js000066400000000000000000000002551346174372000157740ustar00rootroot00000000000000import test from 'ava'; import lowercaseKeys from '.'; test('main', t => { t.true(lowercaseKeys({FOO: true}).foo); t.true(lowercaseKeys({FOO: true, bAr: true}).bar); });