Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Commit

Permalink
fix: remove lodash.cloneDeep
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Jun 1, 2018
1 parent 56b569b commit 0a9cc04
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"@bahmutov/is-my-json-valid": "2.17.3",
"json-stable-stringify": "1.0.1",
"lodash.camelcase": "4.3.0",
"lodash.clonedeep": "4.5.0",
"lodash.get": "4.4.2",
"lodash.set": "4.3.2",
"ramda": "0.25.0",
Expand Down
6 changes: 3 additions & 3 deletions src/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cloneDeep from 'lodash.clonedeep'
import { clone } from 'ramda'
import { JsonPropertyTypes, ObjectSchema } from './objects'

//
Expand All @@ -22,7 +22,7 @@ type AddPropertyOptions = {
* Adds a property to another schema, creating a new schema.
*/
export const addProperty = (options: AddPropertyOptions) => {
const newSchema: ObjectSchema = cloneDeep(options.schema)
const newSchema: ObjectSchema = clone(options.schema)
newSchema.schema.description = options.description
if (options.title) {
newSchema.schema.title = options.title
Expand Down Expand Up @@ -63,6 +63,6 @@ export const addProperty = (options: AddPropertyOptions) => {
newProp.see = options.see
}

newSchema.example[options.property] = cloneDeep(options.exampleValue)
newSchema.example[options.property] = clone(options.exampleValue)
return newSchema
}
4 changes: 2 additions & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import validator from '@bahmutov/is-my-json-valid'
import debugApi from 'debug'
import stringify from 'json-stable-stringify'
import cloneDeep from 'lodash.clonedeep'
import get from 'lodash.get'
import set from 'lodash.set'
import {
clone,
difference,
filter,
find,
Expand Down Expand Up @@ -308,7 +308,7 @@ export const assertBySchema = (
)

const replace = () => {
const cloned = cloneDeep(object)
const cloned = clone(object)
allOptions.substitutions.forEach(property => {
const value = get(example, property)
set(cloned, property, value)
Expand Down

0 comments on commit 0a9cc04

Please sign in to comment.