├── example ├── webpack-project │ ├── .gitignore │ ├── babel.config.js │ ├── src │ │ ├── index.css │ │ ├── index.html │ │ ├── index.js │ │ └── sampledata.js │ ├── package.json │ └── webpack.config.js └── create-react-app-project │ ├── src │ ├── index.css │ ├── index.js │ ├── sampledata.js │ ├── logo.svg │ └── registerServiceWorker.js │ ├── public │ ├── favicon.ico │ ├── manifest.json │ └── index.html │ ├── .gitignore │ └── package.json ├── .gitignore ├── test ├── jest.transform.js ├── logic │ ├── index.js │ ├── locale.js │ ├── testSyntaxLogic.js │ └── syntax.js ├── test.js ├── jest.setup.js ├── sampleData.js ├── change │ └── index.js ├── render │ └── index.js └── err.js ├── .travis.yml ├── ISSUE_TEMPLATE.md ├── src ├── locale │ ├── index.js │ ├── zh-cn.js │ ├── pt.js │ ├── es.js │ ├── jpn.js │ ├── fr.js │ ├── de.js │ ├── en.js │ ├── id.js │ ├── ru.js │ ├── hin.js │ └── ta.js ├── themes.js ├── err.js └── mitsuketa │ └── index.js ├── LICENSE.md ├── babel.config.js ├── scripts └── copy-files.js ├── CODE_OF_CONDUCT.md ├── CHANGELOG.md ├── package.json ├── .all-contributorsrc ├── CONTRIBUTING.md └── README.md /example/webpack-project/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | public/ -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /dist/ 3 | /test/__snapshots__/ 4 | /example/node_modules/ 5 | /example/dist/ 6 | *.tgz -------------------------------------------------------------------------------- /example/create-react-app-project/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /example/webpack-project/babel.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require("../../babel.config"); 2 | 3 | module.exports = baseConfig; 4 | -------------------------------------------------------------------------------- /test/jest.transform.js: -------------------------------------------------------------------------------- 1 | let babel = require('../babel.config'); 2 | 3 | module.exports = require('babel-jest').createTransformer(babel); -------------------------------------------------------------------------------- /example/create-react-app-project/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewRedican/react-json-editor-ajrm/HEAD/example/create-react-app-project/public/favicon.ico -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | cache: 4 | directories: 5 | - node_modules 6 | node_js: 12 7 | branches: 8 | only: 9 | - master 10 | notifications: 11 | email: false 12 | script: 13 | - npm run test -------------------------------------------------------------------------------- /test/logic/index.js: -------------------------------------------------------------------------------- 1 | import syntaxTest from "./syntax"; 2 | import localeTest from "./locale"; 3 | 4 | function run() { 5 | syntaxTest(); 6 | localeTest(); 7 | // ... Add more logic specifc tests once we need them in different files ... 8 | } 9 | 10 | export default run; 11 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 1. What version of RJEA are you using (react-json-editor-ajrm version)? *REQUIRED 2 | 2. What operating system and processor architecture are you using? *REQUIRED 3 | 3. What did you do? *REQUIRED 4 | 4. What did you expect to see? *REQUIRED 5 | 5. What did you see instead? *REQUIRED 6 | -------------------------------------------------------------------------------- /test/test.js: -------------------------------------------------------------------------------- 1 | import renderTest from './render'; 2 | import logicTest from './logic'; 3 | import changeTest from './change'; 4 | 5 | beforeAll(() => { 6 | const div = document.createElement('div'); 7 | window.domNode = div; 8 | document.body.appendChild(div); 9 | }); 10 | 11 | renderTest(); 12 | logicTest(); 13 | changeTest(); -------------------------------------------------------------------------------- /example/create-react-app-project/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /example/create-react-app-project/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /example/webpack-project/src/index.css: -------------------------------------------------------------------------------- 1 | /* ========================================== */ 2 | /* Scroll Bar 3 | */ 4 | ::-webkit-scrollbar { 5 | width: 4px; 6 | } 7 | 8 | ::-webkit-scrollbar-track { 9 | border-radius: 10px; 10 | background: #eee; 11 | } 12 | 13 | ::-webkit-scrollbar-thumb { 14 | border-radius: 10px; 15 | background: #888; 16 | } 17 | ::-webkit-scrollbar-thumb:window-inactive { 18 | background: rgba(100,100,100,0.4); 19 | } -------------------------------------------------------------------------------- /example/create-react-app-project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-react-app-project", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "react": "^16.4.2", 7 | "react-dom": "^16.4.2", 8 | "react-json-editor-ajrm": "2.5.13", 9 | "react-scripts": "1.1.5" 10 | }, 11 | "scripts": { 12 | "start": "react-scripts start", 13 | "build": "react-scripts build", 14 | "test": "react-scripts test --env=jsdom", 15 | "eject": "react-scripts eject" 16 | } 17 | } -------------------------------------------------------------------------------- /src/locale/index.js: -------------------------------------------------------------------------------- 1 | // Allows us to pass arrays and numbers instead of just strings to the format function. 2 | const stringify = (arg) => Array.isArray(arg) ? arg.join(", ") : typeof arg === "string" ? arg : "" + arg; 3 | 4 | // Replaces a string with the values of an object. Google "format unicorn" on an explanation of how to use. 5 | const format = (str, args) => args ? Object.keys(args).reduce((str, arg) => str.replace(new RegExp(`\\{${arg}\\}`, 'gi'), stringify(args[arg])), str) : str; 6 | 7 | export { 8 | format 9 | }; -------------------------------------------------------------------------------- /test/jest.setup.js: -------------------------------------------------------------------------------- 1 | import Enzyme, { shallow, render, mount } from 'enzyme'; 2 | import Adapter from 'enzyme-adapter-react-16'; 3 | import { JSDOM } from 'jsdom'; 4 | 5 | 6 | Enzyme.configure({ adapter: new Adapter() }); 7 | 8 | const { window } = new JSDOM('
'); 9 | 10 | global.shallow = shallow; 11 | global.render = render; 12 | global.mount = mount; 13 | global.window = window; 14 | global.document = window.document; -------------------------------------------------------------------------------- /example/webpack-project/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |<> ><
165 | * 166 | * 6. Provide invalid information, validate warnings 167 | **/ 168 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **Warning:** 2 | 3 | As you may already know, the react-json-editor-ajrm's orignal project is not actively maintained and that 4 | it will eventually be deprecated. So I've decided to set an official date for deprecation. The tentative date for this is June 15, 2023. 5 | 6 | ### What does deprecation mean? 7 | - It means the Github project will be archived as read only. 8 | - It means the npm packages will appear deprecated, but it **WILL NOT be deleted**. 9 | - It means the new project will be available officially on that date. 10 | 11 | I would like to thank those who used it in their projects and those who have contributed in some way to the project. I simply no longer wish to maintain this project. It was made in the early days of my software engineer career, and it has not caught up to today's standards nor mine. 12 | 13 | But don't fret. I intend to breathe new life into this project rewriting it from the ground up. 14 | 15 | I would like to take the learnings of the past, and avoid some of the issues react-json-editor-ajrm currently has. I would also like to highlight the things done well, and I wish to carry on. 16 | 17 | I've setup home for this new project here [enio](https://github.com/enio-ireland/enio). 18 | I've also set up a [discussion here](https://github.com/enio-ireland/enio/discussions/62) if you have any questions or comments. 19 | 20 |
21 | 22 | # react-json-editor-ajrm 23 | 24 |    [](https://snyk.io/test/github/{username}/{repo}) [](#contributors) 25 | 26 |27 | 28 | ## Installing Dependency 29 | 30 | - Using node package manager: 31 | 32 | ``` 33 | $ npm i --save react-json-editor-ajrm 34 | ``` 35 | 36 | ## How to Use 37 | 38 | ``` 39 | import JSONInput from 'react-json-editor-ajrm'; 40 | import locale from 'react-json-editor-ajrm/locale/en'; 41 | 42 |
A stylish, editor-like, modular, react component for viewing, editing, and debugging javascript object syntax!49 | ``` 50 | 51 | *Hint*: There are two different root paths: `react-json-editor-ajrm` and `react-json-editor-ajrm/es`. The first contains polyfilled ES5 code, the second unpolyfilled ES6. The `react-json-editor-ajrm/es` version is **not compatible** with [`create-react-app`](https://github.com/facebook/create-react-app). If you are unsure of which one you need/want, pick the first - it has the best compatibility with tools and browsers. 52 | 53 | ## Examples 54 | 55 | The `./examples` folder contains two examples: 56 | 57 | 1. webpack-project - A basic example without much overload 58 | 2. create-react-app-project - A small example using the create-react-app template 59 | 60 | ## Testing right away! 61 | 62 | 1. Fork and/or clone this Github repository 63 | 2. Go to an example project under [react-json-editor-ajrm/example](https://github.com/AndrewRedican/react-json-editor-ajrm/tree/master/example): 64 | 65 | ``` 66 | $ cd path/to/repo/react-json-editor-ajrm/example/webpack-project 67 | ``` 68 | 69 | 3. Install example project dependencies: 70 | 71 | ``` 72 | $ npm i 73 | ``` 74 | 75 | 4. Serve sample website to port 8080: 76 | 77 | ``` 78 | $ npm start 79 | ``` 80 | 81 | 5. Open `http://localhost:8080` in the web browser 82 | 83 | ## Latest Spotlight Release Notes [v2.5.12] - October 15, 2020 84 | 85 | 1. Fixed [import issue](https://github.com/AndrewRedican/react-json-editor-ajrm/issues/140). 86 | 87 | ## Upcoming Features 88 | 89 | 1. Bug fixes. 90 | 91 | ## Features 92 | 93 | 1. Write as if you are in a text editor. 94 | 2. Checks for syntax mistakes and provides feedback; Custom errors can also be overlaid on the editor. 95 | 3. You can customize color palette as you please. 96 | 4. Accepts a javascript object in `placeholder` property to display after component mounts. 97 | 5. For any valid textContent, calculates and makes available in this.state as plain text, markup text, and javascript object. 98 | 6. Locale support for `English`, `German`, `Spanish`, `Chinese`, `French`, `Indonesian`, `Russian`, `Hindi`, `Japanese` and `Tamil`. 99 | 100 | ## Component Properties 101 | 102 | | Name | Description | Type | Required | 103 | | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: | :-------: | 104 | | [locale]() | The locale of your editor. Import locales like this: `import locale from 'react-json-editor-ajrm/locale/en'`. [Learn More](https://github.com/AndrewRedican/react-json-editor-ajrm/wiki/Locale-Support) | object | Mandatory | 105 | | [id]() | An optional `id` to assign to the actual text input DOM node. Asides the from the text input, the following nodes will also receive an id: `{id}-outer-box`, `{id}-container`, `{id}-warning-box`, `{id}-labels` | string | Optional | 106 | | [placeholder]() | Send a valid javascript object to be shown once the component is mounted. Assign a different value to have the component's initial content re-rendered. | object | Optional | 107 | | [reset]() | Send `true` to have component always re-render or 'reset' to the value provided on the `placeholder` property. | boolean | Optional | 108 | | [viewOnly]() | Send `true` if you would like for content shown not to be editable. | boolean | Optional | 109 | | [onChange]() | Whenever `onKeyPress` event take place, it will return content values. | object | Optional | 110 | | [onBlur]() | Whenever `onBlur` event take place, it will return content values. | object | Optional | 111 | | [confirmGood]() | Send `false` if you would like for the checkmark to confirm good syntax to be hidden. | boolean | Optional | 112 | | [height]() | A shorthand property to set a specific height for the entire component. | string | Optional | 113 | | [width]() | A shorthand property to set a specific width for the entire component. | string | Optional | 114 | | [onKeyPressUpdate]() | Send `false` if you would like for component not to automatically update on key press. | boolean | Optional | 115 | | [waitAfterKeyPress]() | Amount of milliseconds to wait before re-rendering content after keypress. Value defaults to `1000` when not specified. In other words, component will update if there is no additional keystroke after the last one within 1 second. Less than `100` milliseconds does not makes a difference. | number | Optional | 116 | | [modifyErrorText]() | A custom function to modify the component's original warning text. This function will receive a single parameter of type `string` and must equally return a `string`. | function | Optional | 117 | | [error]() | **Contains the following properties:** | object | Optional | 118 | | error.[reason]() | A string containing a custom error messsage | string | Optional | 119 | | error.[line]() | A number indicating the line number related to the custom error message | number | Optional | 120 | | [theme]() | Specify which [built-in theme](https://github.com/AndrewRedican/react-json-editor-ajrm/wiki/Built-In-Themes) to use. | string | Optional | 121 | | [colors]() | **Contains the following properties:** | object | Optional | 122 | | colors.[default]() | Hex color code for any symbols, like curly `braces`, and `comma`. | string | Optional | 123 | | colors.[string]() | Hex color code for tokens identified as `string` values. | string | Optional | 124 | | colors.[number]() | Hex color code for tokens identified as `integeter`, `double`, or `float` values. | string | Optional | 125 | | colors.[colon]() | Hex color code for tokens identified as `colon`. | string | Optional | 126 | | colors.[keys]() | Hex color code for tokens identified as `keys` or property names. | string | Optional | 127 | | colors.[keys_whiteSpace]() | Hex color code for tokens identified as `keys` wrapped in quotes. | string | Optional | 128 | | colors.[primitive]() | Hex color code for tokens identified as `boolean` values and null. | string | Optional | 129 | | colors.[error]() | Hex color code for tokens marked with an `error` tag. | string | Optional | 130 | | colors.[background]() | Hex color code for component's background. | string | Optional | 131 | | colors.[background_warning]() | Hex color code for warning message displaying at the top in component. | string | Optional | 132 | | [style]() | **Contains the following properties:** | object | Optional | 133 | | style.[outerBox]() | Property to modify the default style of the outside container div of component. | object | Optional | 134 | | style.[container]() | Property to modify the default style of the `container` of component. | object | Optional | 135 | | style.[warningBox]() | Property to modify the default style of the container div of the warning message. | object | Optional | 136 | | style.[errorMessage]() | Property to modify the default style of the warning message. | object | Optional | 137 | | style.[body]() | Property to modify the default style of the container div of row labels and code. | object | Optional | 138 | | style.[labelColumn]() | Property to modify the default style of the container div of row labels. | object | Optional | 139 | | style.[labels]() | Property to modify the default style of each row label. | object | Optional | 140 | | style.[contentBox]() | Property to modify the default style of the container div of the code. | object | Optional | 141 | 142 | ## Component Sections 143 | 144 | ``` 145 | outerBox 146 | +-- container 147 | +--- warningBox 148 | +---- errorMessage 149 | +--- body 150 | +---- labelColumn 151 | +----- labels 152 | +---- contentBox 153 | +----- auto generated markup 154 | ``` 155 | 156 | ## Content Values 157 | 158 | Whenever RJEA re-renders its content, any function passed onto `onChange` property will receive a single object parameter with the following keys and values: 159 | 160 | | Key | Description | 161 | | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 162 | | plainText | A string representation of then content which includes linebreaks and indentation. Great to console.log() | 163 | | markupText | A string representation of the auto-generated markup used to render content. | 164 | | json | A JSON.stringify version of content. | 165 | | jsObject | A `javascript object` version of content. Will return `undefined` if the content's syntax is incorrect. | 166 | | lines | Number of lines rendered for content to be displayed. | 167 | | error | Returns `false` unless the content's syntax is incorrect, in which case returns an object with a `token` and a `line` number which corresponds to the location at which error occurred and a `reason` | 168 | 169 | ## Built-In Themes 170 | 171 | RJEA supports built-in theme. Here is the [list](https://github.com/AndrewRedican/react-json-editor-ajrm/wiki/Built-In-Themes). 172 | 173 | ## Built With 174 | 175 | - [**React.js**](https://reactjs.org/) 176 | - [**Babel.js**](https://babeljs.io/) for transpiling. 177 | - [**Enzyme**](http://airbnb.io/enzyme/) for react-specific testing utilities. 178 | - [**Jest**](https://jestjs.io/docs/en/tutorial-react) for unit testing, also react-specific tests. 179 | - [**Travis CI**](https://travis-ci.org/) for continuous integration. 180 | 181 | ## License 182 | 183 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details. 184 | 185 | ## Contributors 186 | 187 | Thanks goes to these wonderful people :smile:: 188 | 189 | 190 | 191 | 192 | 193 |
218 | 219 | 220 | 221 | 222 | 223 | This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! 224 | -------------------------------------------------------------------------------- /src/mitsuketa/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Andrew Redican194 | 202 |195 |
Andrew Redican
📢 💻 🌍 ⚠️196 |
Patrick Sachs
💻 🌍 ⚠️197 |
Allan Kehl
🌍198 |
esbenvb
📖199 |
Markus Petrykowski
💡200 |
Rick Brunstedt
💻201 |
ADirtyCat
🌍203 | 211 |204 |
Cédric
🌍205 |
Radit
🌍206 |
asketes
🌍207 |
C.G.Vedant
🤔208 |
Shehbaz Jafri
🌍209 |
Vasantha Kumar R B
🌍210 |
Aditya Periwal
🌍212 | 217 |213 |
Alexey Lyakhov
💻214 |
Terence Huynh
💻215 |
Richard Hull
💻216 |
tonynguyenit18
💻3 | */ 4 | 5 | /** 6 | * Performs deep search on object tree, removes all properties with matching key, returns a new identity without the specified property 7 | * @param {Any} identity 8 | * @param {string} keyName 9 | * @param {Optional Number} maxDepth 10 | * @return {Any} identity 11 | */ 12 | function deepRemoveAll_Key(identity,keyName,maxDepth){ 13 | if(getType(keyName)!=='string') return undefined; 14 | if(keyName==='') return undefined; 15 | let clonedIdentity = deepClone(identity); 16 | var paths = locateAll_Key(clonedIdentity,keyName,maxDepth); 17 | if(paths===[]||paths===false) return clonedIdentity; 18 | paths.forEach( path => { 19 | if(path === '') path = keyName; else path += ('.' + keyName); 20 | path = path.split('.'); 21 | var ref = clonedIdentity; 22 | if(!Array.isArray(path)) delete ref[path]; 23 | for(var i = 0; i < path.length; i++){ 24 | var key = path[i]; 25 | if(key in ref){ 26 | if(i { if(i { _deepClone(identity[key],maxDepth,startDepth,currentDepth + 1); }); 168 | } 169 | return; 170 | } 171 | if( startDepth !== null ? currentDepth == startDepth : false){ 172 | if(startDepth==0){ R = _deepClone(identity,maxDepth,null,currentDepth); return; } 173 | if(isIterable(identity)) R.push(_deepClone(identity,maxDepth,startDepth,currentDepth + 1)); 174 | return; 175 | } 176 | switch(getType(identity)){ 177 | case 'array': 178 | var Arr = []; 179 | keys = Object.keys(identity); 180 | if( maxDepth !== null ? currentDepth < maxDepth : true) 181 | for(var i = 0, l = keys.length; i < l; i++){ 182 | const 183 | key = keys[i], 184 | subIdentity = identity[key]; 185 | Arr[key] = _deepClone(subIdentity,maxDepth,startDepth,currentDepth + 1); 186 | } 187 | return Arr; 188 | case 'object': 189 | var Obj = {}; 190 | keys = Object.keys(identity); 191 | if( maxDepth !== null ? currentDepth < maxDepth : true) 192 | for(var i = 0, l = keys.length; i < l; i++){ 193 | const 194 | key = keys[i], 195 | subIdentity = identity[key]; 196 | Obj[key] = _deepClone(subIdentity,maxDepth,startDepth,currentDepth + 1); 197 | } 198 | return Obj; 199 | case 'string': return '' + identity; 200 | case 'number': return 0 + identity; 201 | case 'boolean': if(identity) return true; return false; 202 | case 'null': return null; 203 | case 'undefined': return undefined; 204 | } 205 | } 206 | if(startDepth === null) return _deepClone(identity,maxDepth,startDepth,0); 207 | _deepClone(identity,maxDepth,startDepth,0); return R; 208 | } 209 | 210 | /** 211 | * Performs deep search on collection to find all matches to the key name, and returns a list of identities containing the matched instances. If no matches found, it returns `undefined`. 212 | * @param {Any} collection 213 | * @param {Any} keyName 214 | * @param {Optional Number} maxDepth 215 | * @return {Array || undefined} Identities 216 | */ 217 | function deepFilter_Key(collection,keyName,maxDepth=null){ 218 | if(getType(keyName)!=='string') return undefined; 219 | if(keyName==='') return undefined; 220 | var paths = locateAll_Key(collection,keyName,maxDepth); 221 | if(paths === false) return undefined; 222 | const results = paths.map(path => { 223 | if(path === false) return undefined; 224 | if(path === '') path = keyName; else path += ('.' + keyName); 225 | path = path.split('.'); 226 | var result = collection; 227 | if(!Array.isArray(path)) return result[path]; 228 | path.forEach( key => { result = result[key]; }); 229 | return result; 230 | }) 231 | return results; 232 | } 233 | 234 | /** 235 | * Performs deep search on collection to find all matches to the key name, returns the location of each match in a string array. If no matches found, it returns `false`. 236 | * @param {Any} collection 237 | * @param {Any} keyName 238 | * @param {Optional Number} maxDepth 239 | * @return {Array || false} Paths 240 | */ 241 | function locateAll_Key(collection,keyName,maxDepth=null){ 242 | if(getType(keyName)!=='string') return undefined; 243 | if(keyName==='') return undefined; 244 | var R = []; 245 | function _locateAll_Key(collection,keyName,xKey='',path='',maxDepth=null,currentDepth=0){ 246 | if(xKey===keyName) R[R.length] = path; 247 | var result = false; 248 | if(maxDepth!==null)if(currentDepth>=maxDepth) return result; 249 | if(isIterable(collection)) 250 | for(var i = 0, keys = Object.keys(collection), l = keys.length; i < l; i++ ){ 251 | const key = keys[i], subcollection = collection[key]; 252 | _locateAll_Key(subcollection,keyName,key,(path === '' ? path : path + '.') + key,maxDepth,currentDepth + 1); 253 | } 254 | } 255 | _locateAll_Key(collection,keyName,'','',maxDepth); 256 | R = R.map( path => { 257 | if(getType(path)==='boolean') return path; 258 | if(path==='') return path; 259 | path = path.split('.'); 260 | path.pop(); 261 | path = path.join('.'); 262 | return path; 263 | }); 264 | return R.length === 0 ? false : R; 265 | } 266 | 267 | /** 268 | * Performs deep search on collection to find a match to the key name, and returns the first identity containing the match. If no match found, it returns `undefined`. 269 | * @param {Any} collection 270 | * @param {Any} keyName 271 | * @param {Optional number} maxDepth 272 | * @return {Identity || undefined} identity 273 | */ 274 | function deepGet_Key(collection,keyName,maxDepth=null){ 275 | if(getType(keyName)!=='string') return undefined; 276 | if(keyName==='') return undefined; 277 | var path = locate_Key(collection,keyName,maxDepth); 278 | if(path === false) return undefined; 279 | if(path === '') path = keyName; else path += ('.' + keyName); 280 | path = path.split('.'); 281 | var result = collection; 282 | if(!Array.isArray(path)) return result[path]; 283 | path.forEach( key => { result = result[key]; }); 284 | return result; 285 | } 286 | 287 | /** 288 | * Performs deep search on collection to find a match to the key name, will return the path of the first instance matched. If no match found, it returns `false`. 289 | * @param {Any} collection 290 | * @param {Any} keyName 291 | * @param {Optional number} maxDepth 292 | * @return {String || false} Path 293 | */ 294 | function locate_Key(collection,keyName,maxDepth=null){ 295 | if(getType(keyName)!=='string') return undefined; 296 | if(keyName==='') return undefined; 297 | function _locate_Key(collection,keyName,path='',maxDepth,currentDepth=0){ 298 | if(path===keyName) return path; 299 | var result = false; 300 | if(maxDepth!==null)if(currentDepth>=maxDepth) return result; 301 | if(isIterable(collection)) 302 | for(var i = 0, keys = Object.keys(collection), l = keys.length; i < l; i++ ){ 303 | const 304 | key = keys[i], subcollection = collection[key], 305 | res = _locate_Key(subcollection,keyName,key,maxDepth,currentDepth + 1); 306 | if(res) { path = path === '' ? path : path + '.'; result = path + res; break; } 307 | } 308 | return result; 309 | } 310 | var path = _locate_Key(collection,keyName,'',maxDepth,0); 311 | if(getType(path)==='boolean') return path; 312 | if(path==='') return path; 313 | path = path.split('.'); 314 | path.pop(); 315 | path = path.join('.'); 316 | return path; 317 | } 318 | 319 | /** 320 | * Performs deep search for identity on collection to return the location's depth of the first match. If no match found, it returns `false`. 321 | * @param {Any} collection 322 | * @param {Any} identity 323 | * @param {Optional Number} maxDepth 324 | * @return {boolean} 325 | */ 326 | function matchDepth(collection,identity,maxDepth=null){ 327 | var path = locate(collection, identity, maxDepth); 328 | if(path === false) return false; 329 | if(path === '') return 0; 330 | path = path.split('.'); 331 | return path.length; 332 | } 333 | 334 | /** 335 | * Walks through the entire object tree to return the maximum number of layers it contains. 336 | * @param {Any} identity 337 | * @param {Optional Number} maxDepth 338 | */ 339 | function maxDepth(identity,maxLayer=null){ 340 | let R = 0; 341 | function _maxDepth(identity,maxLayer,currentDepth=0){ 342 | if(R < currentDepth) R = currentDepth; 343 | if(maxLayer!==null) if(currentDepth >= maxLayer) return; 344 | if(isIterable(identity)){ 345 | var keys = Object.keys(identity); 346 | keys.forEach( key => { 347 | var subIdentity = identity[key]; 348 | _maxDepth(subIdentity,maxLayer,currentDepth + 1); 349 | }); 350 | } 351 | } 352 | _maxDepth(identity,maxLayer); 353 | return R; 354 | } 355 | 356 | /** 357 | * Performs deep search for identity on collection, returns the number of matches found. 358 | * @param {Any} collection 359 | * @param {Any} identity 360 | * @param {Number} nthDepth 361 | * @param {Optional Number} maxDepth 362 | * @return {Any} Returns number of matches found. 363 | */ 364 | function countMatches(collection,identity,nthDepth=null,maxDepth=null){ 365 | var 366 | depth, 367 | nthDepth_isNull = nthDepth === null, 368 | maxDepth_isNull = maxDepth === null; 369 | if(nthDepth_isNull && maxDepth_isNull) 370 | depth = null; 371 | else 372 | if(!nthDepth_isNull && !maxDepth_isNull) 373 | if(nthDepth < maxDepth) depth = nthDepth; else depth = maxDepth; 374 | else 375 | if(nthDepth) depth = nthDepth; else depth = maxDepth; 376 | var paths = locateAll(collection,identity,depth); 377 | if(paths===false) return 0; 378 | if(nthDepth===null) return paths.length; 379 | if(getType(nthDepth)==='number'){ 380 | let count = 0; 381 | paths.forEach( path => { 382 | path = path.split('.'); 383 | if(path.length===nthDepth) count++; 384 | }); 385 | return count; 386 | } 387 | return undefined; 388 | } 389 | 390 | /** 391 | * Performs deep search for each identity on collection, to shorten the identities to those that meets the match criteria 392 | * @param {Any} collection 393 | * @param {Any} identities 394 | * @param {Any} property 395 | * @param {Optional Number} maxDepth 396 | * @return {Any} Returns a collection of the same type as the 'identities' parameter provided with only the identities that matched. 397 | */ 398 | function onlyFalsy(collection,identities,property,maxDepth=null){ 399 | if(getType(identities)==='array'){ 400 | let result = []; 401 | identities.forEach( identity => { 402 | const subCollection = deepFilter(collection,identity); 403 | if(isTruthy(subCollection)) 404 | if(foundFalsy(subCollection,property,maxDepth)) result.push(identity); 405 | }); 406 | return result; 407 | } 408 | if(getType(identities)==='object'){ 409 | let result = {}; 410 | Object.keys(identities).forEach( key => { 411 | const 412 | identity = identities[key], 413 | subCollection = deepFilter(collection,identity); 414 | if(isTruthy(subCollection)) 415 | if(foundFalsy(subCollection,property,maxDepth)) result[key] = identity; 416 | }); 417 | return result; 418 | } 419 | if(foundFalsy(collection,property,maxDepth)) return identities; 420 | } 421 | 422 | /** 423 | * Performs deep search on collection to find any match to the property and evalutates if truthy 424 | * @param {Any} collection 425 | * @param {Property} identity 426 | * @param {Optional Number} maxDepth 427 | * @return {boolean} If match confirmed and truthy will return true, otherwise false 428 | */ 429 | function foundFalsy(collection,identity,maxDepth=null){ 430 | identity = singleProperty(identity); 431 | if(isFalsy(identity)) return undefined; 432 | function _foundFalsy(collection,identity,maxDepth,currentDepth=0){ 433 | if(containsKeys(collection,[identity])) return isFalsy(collection[identity]); 434 | if(maxDepth!==null) if(currentDepth >= maxDepth) return false; 435 | if(isIterable(collection)) 436 | for(var i = 0, keys = Object.keys(collection), l = keys.length; i < l; i++ ){ 437 | const 438 | key = keys[i], subcollection = collection[key], 439 | res = _foundFalsy(subcollection,identity,maxDepth,currentDepth + 1); 440 | if(res) return true; 441 | } 442 | return false; 443 | } 444 | return _foundFalsy(collection,identity,maxDepth); 445 | } 446 | 447 | /** 448 | * Performs deep search for each identity on collection, to shorten the identities to those that meets the match criteria 449 | * @param {Any} collection 450 | * @param {Any} identities 451 | * @param {Any} property 452 | * @param {Optional Number} maxDepth 453 | * @return {Any} Returns a collection of the same type as the 'identities' parameter provided with only the identities that matched. 454 | */ 455 | function onlyTruthy(collection,identities,property,maxDepth=null){ 456 | if(getType(identities)==='array'){ 457 | let result = []; 458 | identities.forEach( identity => { 459 | const subCollection = deepFilter(collection,identity); 460 | if(isTruthy(subCollection)) 461 | if(foundTruthy(subCollection,property,maxDepth)) result.push(identity); 462 | }); 463 | return result; 464 | } 465 | if(getType(identities)==='object'){ 466 | let result = {}; 467 | Object.keys(identities).forEach( key => { 468 | const 469 | identity = identities[key], 470 | subCollection = deepFilter(collection,identity); 471 | if(isTruthy(subCollection)) 472 | if(foundTruthy(subCollection,property,maxDepth)) result[key] = identity; 473 | }); 474 | return result; 475 | } 476 | if(foundTruthy(collection,property,maxDepth)) return identities; 477 | } 478 | 479 | /** 480 | * Performs deep search on collection to find any match to the property and evalutates if truthy 481 | * @param {Any} collection 482 | * @param {Property} identity 483 | * @param {Optional Number} maxDepth 484 | * @return {boolean} If match confirmed and truthy will return true, otherwise false 485 | */ 486 | function foundTruthy(collection,identity,maxDepth=null){ 487 | identity = singleProperty(identity); 488 | if(isFalsy(identity)) return undefined; 489 | function _foundTruthy(collection,identity,maxDepth,currentDepth=0){ 490 | if(containsKeys(collection,[identity])) return isTruthy(collection[identity]); 491 | if(maxDepth!==null) if(currentDepth >= maxDepth) return false; 492 | if(isIterable(collection)) 493 | for(var i = 0, keys = Object.keys(collection), l = keys.length; i < l; i++ ){ 494 | const 495 | key = keys[i], subcollection = collection[key], 496 | res = _foundTruthy(subcollection,identity,maxDepth,currentDepth + 1); 497 | if(res) return true; 498 | } 499 | return false; 500 | } 501 | return _foundTruthy(collection,identity,maxDepth,0); 502 | } 503 | 504 | /** 505 | * Validates if identity is equal to a property definition or contains a single property key. 506 | * @param {Property} identity 507 | * @return {String || boolean} If criteria matched will return property name as string, otherwise false 508 | */ 509 | function singleProperty(identity){ 510 | const propCount = length(identity); 511 | if(propCount > 1) return false; 512 | if(propCount===1) return Object.keys(identity)[0]; 513 | if(propCount===0) if(['string','number'].indexOf(getType(identity))>-1) return identity; 514 | return false; 515 | } 516 | 517 | /** 518 | * Determines if identity is non-falsy 519 | * @param {Any} identity 520 | * @return {boolean} Returns true if criteria matched, otherwise false. 521 | */ 522 | function isTruthy(identity){ return !isFalsy(identity); } 523 | 524 | /** 525 | * Determines if identity is falsy 526 | * @param {Any} identity 527 | * @return {boolean} Returns true if criteria matched, otherwise false. 528 | */ 529 | function isFalsy(identity){ 530 | if(falser(identity)===false) return true; 531 | return false; 532 | } 533 | 534 | /** 535 | * Converts false-like values into actual boolean value of false 536 | * @param {Any} identity 537 | * @return {Any || boolean} Returns false is value is falsy, otherwise returns original value. 538 | */ 539 | function falser(identity){ 540 | if(isIterable(identity)) return identity; 541 | if(['null','undefined'].indexOf(getType(identity))>-1) return false; 542 | if(['',0,false].indexOf(identity)>-1) return false; 543 | return identity; 544 | } 545 | 546 | /** 547 | * Check the length of the top-most depth of the identity 548 | * @param {Any} identity 549 | * @return {integer} Greater than or equal to 0. 550 | */ 551 | function length(identity){ 552 | if(['array','object'].indexOf(getType(identity)) === -1) return 0; 553 | return Object.keys(identity).length; 554 | } 555 | 556 | /** 557 | * Performs deep search for each identity on collection, to shorten the identities to those that does meets the match criteria 558 | * @param {Any} collection 559 | * @param {Any} identities 560 | * @param {Optional Number} maxDepth 561 | * @return {Any} Returns a collection of the same type as the 'identities' parameter provided with only the identities that were not matched. 562 | */ 563 | function onlyMissing(collection,identities,maxDepth=null){ 564 | if(getType(identities)==='array'){ 565 | let result = []; 566 | identities.forEach( identity => { 567 | if(!exists(collection,identity,maxDepth)) result.push(identity); 568 | }); 569 | return result; 570 | } 571 | if(getType(identities)==='object'){ 572 | let result = {}; 573 | Object.keys(identities).forEach( key => { 574 | let identity = identities[key]; 575 | if(!exists(collection,identity,maxDepth)) result[key] = identity; 576 | }); 577 | return result; 578 | } 579 | if(!exists(collection,identities,maxDepth)) return identities; 580 | } 581 | 582 | /** 583 | * Performs deep search for each identity on collection, to shorten the identities to those that meets the match criteria 584 | * @param {Any} collection 585 | * @param {Any} identities 586 | * @param {Optional Number} maxDepth 587 | * @return {Any} Returns a collection of the same type as the 'identities' parameter provided with only the identities that matched. 588 | */ 589 | function onlyExisting(collection,identities,maxDepth=null){ 590 | if(getType(identities)==='array'){ 591 | let result = []; 592 | identities.forEach( identity => { 593 | if(exists(collection,identity,maxDepth)) result.push(identity); 594 | }); 595 | return result; 596 | } 597 | if(getType(identities)==='object'){ 598 | let result = {}; 599 | Object.keys(identities).forEach( key => { 600 | let identity = identities[key]; 601 | if(exists(collection,identity,maxDepth)) result[key] = identity; 602 | }); 603 | return result; 604 | } 605 | if(exists(collection,identities,maxDepth)) return identities; 606 | } 607 | 608 | /** 609 | * Performs deep search on collection to find any match to the identity 610 | * @param {Any} collection 611 | * @param {Any} identity 612 | * @param {Optional Number} maxDepth 613 | * @return {boolean} If a match is confirmed will return true, otherwise false 614 | */ 615 | function exists(collection, identity, maxDepth=null, currentDepth=0){ 616 | if(identical(collection,identity)) return true; 617 | if(isIterable(identity)) 618 | if(sameType(collection,identity)) 619 | if(containsKeys(collection,Object.keys(identity))){ 620 | const trimmed = trim(collection,Object.keys(identity)); 621 | if(identical(trimmed,identity)) return true; 622 | } 623 | if(maxDepth === null ? true: (currentDepth < maxDepth)) 624 | if(isIterable(collection)) 625 | for(var i = 0, keys = Object.keys(collection), l = keys.length; i < l; i++ ){ 626 | const 627 | key = keys[i], subcollection = collection[key], 628 | res = exists(subcollection,identity,maxDepth,currentDepth + 1); 629 | if(res) return true; 630 | } 631 | return false; 632 | } 633 | 634 | /** 635 | * Performs deep search on collection to find all matches to the identity, will return a list of identities containing the match. If no matches found, it returns `undefined`. 636 | * @param {Any} collection 637 | * @param {Any} identity 638 | * @param {Optional Number} maxDepth 639 | * @return {Array || undefined} identities 640 | */ 641 | function deepFilter(collection, identity, maxDepth=null){ 642 | var paths = locateAll(collection, identity, maxDepth); 643 | if(paths === false) return undefined; 644 | const results = paths.map(path => { 645 | if(path === '') return collection; 646 | path = path.split('.'); 647 | if(['array','object'].indexOf(getType(identity)) === - 1) path.splice(-1,1); 648 | var result = collection; 649 | if(!Array.isArray(path)) return result[path]; 650 | path.forEach( key => { result = result[key]; }); 651 | return result; 652 | }) 653 | return results; 654 | } 655 | 656 | /** 657 | * Performs deep search on collection to find all matches to the identity, returns a string array containing the location of all matches. If no matches found, it returns `false`. 658 | * @param {Any} collection 659 | * @param {Any} identity 660 | * @param {Optional Number} maxDepth 661 | * @return {Array || false} Paths 662 | */ 663 | function locateAll(collection, identity, maxDepth=null){ 664 | var R = []; 665 | function _locateAll(collection, identity, path = '',maxDepth,currentDepth){ 666 | if(isIterable(identity)) 667 | if(sameType(collection,identity)) 668 | if(containsKeys(collection,Object.keys(identity))){ 669 | const trimmed = trim(collection,Object.keys(identity)); 670 | if(identical(trimmed,identity)) R[R.length] = path; 671 | } 672 | if(identical(collection,identity)) R[R.length] = path; 673 | var result = false; 674 | if(maxDepth!==null)if(currentDepth>=maxDepth) return result; 675 | if(isIterable(collection)) 676 | for(var i = 0, keys = Object.keys(collection), l = keys.length; i < l; i++ ){ 677 | const key = keys[i], subcollection = collection[key]; 678 | _locateAll(subcollection,identity,(path === '' ? path : path + '.') + key,maxDepth,currentDepth + 1); 679 | } 680 | } 681 | _locateAll(collection, identity, '', maxDepth, 0); 682 | return R.length === 0 ? false : R; 683 | } 684 | 685 | /** 686 | * Performs deep search on collection to find a match to the identity, will return the identity containing of the first instance matched. If no matches found, it returns `undefined`. 687 | * @param {Any} collection 688 | * @param {Any} identity 689 | * @param {Optional Number} maxDepth 690 | * @return {identity || undefined} identity 691 | */ 692 | function deepGet(collection, identity, maxDepth=null){ 693 | var path = locate(collection, identity, maxDepth); 694 | if(path === false) return undefined; 695 | if(path === '') return collection; 696 | path = path.split('.'); 697 | if(['array','object'].indexOf(getType(identity)) === - 1) path.splice(-1,1); 698 | var result = collection; 699 | if(!Array.isArray(path)) return result[path]; 700 | path.forEach( key => { result = result[key]; }); 701 | return result; 702 | } 703 | 704 | /** 705 | * Performs deep search on collection to find a match to the identity, will return the path of the first instance matched as string. If no matches found, returns `false`. 706 | * @param {Any} collection 707 | * @param {Any} identity 708 | * @param {Optional number} maxDepth 709 | * @return {string || false} path 710 | */ 711 | function locate(collection, identity, maxDepth=null){ 712 | function _locate(collection, identity, path = '', maxDepth,currentDepth){ 713 | if(isIterable(identity)) 714 | if(sameType(collection,identity)) 715 | if(containsKeys(collection,Object.keys(identity))){ 716 | const trimmed = trim(collection,Object.keys(identity)); 717 | if(identical(trimmed,identity)) return path; 718 | } 719 | if(identical(collection,identity)) return path; 720 | var result = false; 721 | if(maxDepth!==null)if(currentDepth>=maxDepth) return result; 722 | 723 | if(isIterable(collection)) 724 | for(var i = 0, keys = Object.keys(collection), l = keys.length; i < l; i++ ){ 725 | const 726 | key = keys[i], subcollection = collection[key], 727 | res = _locate(subcollection,identity,key,maxDepth,currentDepth + 1); 728 | if(res) { path = path === '' ? path : path + '.'; result = path + res; break; } 729 | } 730 | return result; 731 | } 732 | return _locate(collection, identity,'', maxDepth,0); 733 | } 734 | 735 | /** 736 | * Trims an identity to only contain the specified properties. 737 | * @param {Any} identity 738 | * @param {Any} keyList 739 | * @return {Object or Array} Returns , otherwise false 740 | */ 741 | function trim(identity,keyList){ 742 | const identityType = getType(identity); 743 | if(['array','object'].indexOf(identityType) === -1) return undefined; 744 | const keyCount = keyList.length; 745 | if(keyCount === 0) return undefined; 746 | var newIdentity; 747 | switch(identityType){ 748 | case 'object' : newIdentity = {}; keyList.forEach(key => { if(key in identity) newIdentity[key] = identity[key]; }); break; 749 | case 'array' : newIdentity = []; keyList.forEach(key => { if(key in identity) newIdentity.push(identity[key]); }); break; 750 | } 751 | return newIdentity; 752 | } 753 | 754 | /** 755 | * Check if identity contains all of the specified keys 756 | * @param {Any} identity 757 | * @param {Array} keyList 758 | * @return {boolean} true || false 759 | */ 760 | function containsKeys(identity,keyList){ 761 | const keyCount = keyList.length; 762 | if(keyCount === 0 || !isIterable(identity)) return false; 763 | const identitykeys = Object.keys(identity); 764 | var result = true; 765 | for(var i = 0; i < keyCount; i++){ 766 | const key = '' + keyList[i]; 767 | if(identitykeys.indexOf(key) === -1){ result = false; break; } 768 | } 769 | return result; 770 | } 771 | 772 | /** 773 | * Check if identity has one or more keys to iterate 774 | * @param {Any} identity 775 | * @return {boolean} true || false 776 | */ 777 | function isIterable(identity){ 778 | if(['array','object'].indexOf(getType(identity)) === -1) return false; 779 | if(Object.keys(identity).length === 0) return false; 780 | return true; 781 | } 782 | 783 | /** 784 | * Compares two identities, will return either true if identical, otherwise false. 785 | * @param {Any} identityA 786 | * @param {Any} identityB 787 | * @return {boolean} true || false 788 | */ 789 | function identical(identityA,identityB){ 790 | const structureMatch = sameStructure(identityA,identityB); 791 | if(structureMatch === false) return structureMatch; 792 | if(['array','object'].indexOf(structureMatch) === -1) return identityA === identityB; 793 | const Keys = Object.keys(identityA), KeyCount = Keys.length; 794 | var childMatch = true; 795 | for(var i = 0; i < KeyCount; i++) { 796 | const Key = Keys[i], identicalMatch = identical(identityA[Key],identityB[Key]); 797 | if(identicalMatch === false){ childMatch = identicalMatch; break; }; 798 | } 799 | return childMatch; 800 | } 801 | 802 | /** 803 | * Compares data structure of two identities, will return either the dataType or true/false. 804 | * @param {Any} identityA 805 | * @param {Any} identityB 806 | * @return {String || False} DataType as string for positive match, otherwise false 807 | */ 808 | function sameStructure(identityA,identityB){ 809 | const typeMatch = sameType(identityA,identityB); 810 | if(typeMatch === false) return false; 811 | if(['array','object'].indexOf(typeMatch) > -1){ 812 | const 813 | AKeys = Object.keys(identityA), 814 | BKeys = Object.keys(identityB), 815 | AKeyCount = AKeys.length, 816 | BKeyCount = BKeys.length; 817 | if(!(AKeyCount === BKeyCount)) return false; 818 | if(AKeyCount === 0) return true; 819 | for (var i = 0; i < AKeyCount; i++) { 820 | if(AKeys[i] !== BKeys[i]) return false; 821 | } 822 | } 823 | return typeMatch; 824 | } 825 | 826 | /** 827 | * Compares data type of two identities, will dataType if true. 828 | * @param {Any} identityA 829 | * @param {Any} identityB 830 | * @return {boolean} true || false 831 | */ 832 | function sameType(identityA,identityB){ 833 | const typeA = getType(identityA); return typeA === getType(identityB) ? typeA : false; 834 | } 835 | 836 | /** 837 | * Gets data type; makes distintion between object, array, and null. 838 | * @param {Any} identity 839 | * @return {String} dataType 840 | */ 841 | function getType(identity) { 842 | if(identity === null) return 'null'; 843 | const it = typeof identity; 844 | if(it === 'object') if(Array.isArray(identity)) return 'array'; 845 | return it; 846 | } 847 | 848 | var mitsuketa = { 849 | getType : function(identity) { return getType(identity); }, 850 | sameType : function(identityA,identityB) { return sameType(identityA,identityB); }, 851 | sameStructure : function(identityA,identityB) { return sameStructure(identityA,identityB); }, 852 | identical : function(identityA,identityB) { return identical(identityA,identityB); }, 853 | isIterable : function(identity) { return isIterable(identity); }, 854 | containsKeys : function(identity,keyList) { return containsKeys(identity,keyList); }, 855 | trim : function(identity,keyList) { return trim(identity,keyList); }, 856 | locate : function(collection,identity,maxDepth) { return locate(collection,identity,maxDepth); }, 857 | deepGet : function(collection,identity,maxDepth) { return deepGet(collection,identity,maxDepth); }, 858 | locateAll : function(collection,identity,maxDepth) { return locateAll(collection,identity,maxDepth); }, 859 | deepFilter : function(collection,identity,maxDepth) { return deepFilter(collection,identity,maxDepth); }, 860 | exists : function(collection,identity,maxDepth) { return exists(collection,identity,maxDepth); }, 861 | onlyExisting : function(collection,identities,maxDepth) { return onlyExisting(collection,identities,maxDepth); }, 862 | onlyMissing : function(collection,identities,maxDepth) { return onlyMissing(collection,identities,maxDepth); }, 863 | length : function(identity) { return length(identity); }, 864 | isFalsy : function(identity) { return isFalsy(identity); }, 865 | isTruthy : function(identity) { return isTruthy(identity); }, 866 | foundTruthy : function(collection,identity,maxDepth) { return foundTruthy(collection,identity,maxDepth); }, 867 | onlyTruthy : function(collection,identities,property,maxDepth) { return onlyTruthy(collection,identities,property,maxDepth); }, 868 | foundFalsy : function(collection,identity,maxDepth) { return foundFalsy(collection,identity,maxDepth); }, 869 | onlyFalsy : function(collection,identities,property,maxDepth) { return onlyFalsy(collection,identities,property,maxDepth); }, 870 | countMatches : function(collection,identity,nthDepth,maxDepth) { return countMatches(collection,identity,nthDepth,maxDepth); }, 871 | matchDepth : function(collection,identity,maxDepth) { return matchDepth(collection,identity,maxDepth); }, 872 | maxDepth : function(identity,maxLayer) { return maxDepth(identity,maxLayer); }, 873 | locate_Key : function(collection,keyName,maxDepth) { return locate_Key(collection,keyName,maxDepth); }, 874 | deepGet_Key : function(collection,keyName,maxDepth) { return deepGet_Key(collection,keyName,maxDepth); }, 875 | locateAll_Key : function(collection,keyName,maxDepth) { return locateAll_Key(collection,keyName,maxDepth); }, 876 | deepFilter_Key : function(collection,keyName,maxDepth) { return deepFilter_Key(collection,keyName,maxDepth); }, 877 | deepClone : function(identity,maxDepth,startDepth) { return deepClone(identity,maxDepth,startDepth); }, 878 | renameKey : function(identity,keyName,newKeyName,maxDepth) { return renameKey(identity,keyName,newKeyName,maxDepth); }, 879 | renameKeys : function(identity,keyName,newKeyName,maxDepth) { return renameKeys(identity,keyName,newKeyName,maxDepth); }, 880 | deepRemove_Key : function(identity,keyName,maxDepth) { return deepRemove_Key(identity,keyName,maxDepth); }, 881 | deepRemoveAll_Key : function(identity,keyName,maxDepth) { return deepRemoveAll_Key(identity,keyName,maxDepth); } 882 | } 883 | 884 | module.exports = exports = mitsuketa; --------------------------------------------------------------------------------