Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

skava / exotic   js

Repository URL to install this package:

Version: 2.0.8 

/ src / types / @omni / presets / __unused / validators

  ..
  README.md
  error.ts
  index.ts
  schemaBuilder.ts
  url.ts
  validatorBuilder.ts
 

related

https://github.com/kensho-technologies/check-more-types https://github.com/jquery-validation/jquery-validation/blob/master/src/core.js https://github.com/iarna/aproba https://github.com/gcanti/tcomb/tree/master/lib https://github.com/apollographql/graphql-anywhere/blob/master/src/utilities.ts#L60 https://github.com/apollographql/graphql-anywhere/blob/master/src/storeUtils.ts

why this folder is here as its own folder

problem:

  • naming and file count for validator + schema was becoming bad
  • too many 'factories'
  • logic for core was in deps where it should not be
  • method chain was too big
  • file size was too big
  • external configuration was not so easy solution:
  • move all domain logic related to methodchain out of deps
  • plugins for method chain

example

// @NOTE isNull & isUndefined to lowercase is no good...
//       one way to do it, but not as good
// const TYPES = ['null', 'undefined']
// const REPLACE = ['nill', 'undef']
// .replace(TYPES[0], REPLACE[0])
// .replace(TYPES[1], REPLACE[1])
//
// @NOTE: removed this in favor of escaping the key
//        plus this 2x the map size
//
// const ObjectKeys = require('chaintools/util/keys')
// const validationKeys = ObjectKeys(is)
// for (let i = 0; i < validationKeys.length; i++) {
//   const key = validationKeys[i]
//   const transformedKey = key.toLowerCase().replace('is', '')
//   is[transformedKey] = is[key]
// }

// s.charAt(0).toUpperCase()