Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dhis2/prop-types

Package Overview
Dependencies
Maintainers
15
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dhis2/prop-types - npm Package Compare versions

Comparing version 1.6.4 to 2.0.0

15

build/cjs/__tests__/index.test.js
import fs from 'fs'
import path from 'path'
import originalPropTypes from 'prop-types'
import dhis2PropTypes, * as namedDhis2PropTypes from '../index.js'

@@ -39,8 +38,2 @@

})
it('should not overwrite existing prop-types in the prop-types package', () => {
Object.keys(originalPropTypes).forEach(propType => {
expect(dhis2PropTypes[propType]).toBe(originalPropTypes[propType])
})
})
})

@@ -66,10 +59,2 @@

})
it('should not overwrite existing prop-types in the prop-types package', () => {
Object.keys(originalPropTypes).forEach(propType => {
expect(namedDhis2PropTypes[propType]).toBe(
originalPropTypes[propType]
)
})
})
})

46

build/cjs/index.js

@@ -6,18 +6,15 @@ "use strict";

});
var _exportNames = {};
var _exportNames = {
PropTypes: true
};
Object.defineProperty(exports, "PropTypes", {
enumerable: true,
get: function get() {
return _propTypes.default;
}
});
exports.default = void 0;
var _propTypes = _interopRequireWildcard(require("prop-types"));
var _propTypes = _interopRequireDefault(require("prop-types"));
Object.keys(_propTypes).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _propTypes[key];
}
});
});
var customPropTypes = _interopRequireWildcard(require("./propTypes"));

@@ -40,12 +37,21 @@

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/*
* Export our own prop-types as named exports, this allows this import style:
* import { arrayWithLength } from '@dhis2/prop-types'
*/
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
/*
* Reexport the prop-types lib under a namespace, as is our convention. The
* name is Pascalcased, this allows for this import style:
* import { PropTypes } from '@dhis2/prop-types'
*/
// Export all prop-types as a default export as well
const allPropTypes = _objectSpread({}, _propTypes.default, {}, customPropTypes);
var _default = allPropTypes;
/*
* Export custom prop-types as the default export. This only contains our
* own prop-types. Import style is (naming is up to the user of course):
* import dhis2PropTypes from '@dhis2/prop-types'
*/
var _default = customPropTypes;
exports.default = _default;
import fs from 'fs'
import path from 'path'
import originalPropTypes from 'prop-types'
import dhis2PropTypes, * as namedDhis2PropTypes from '../index.js'

@@ -39,8 +38,2 @@

})
it('should not overwrite existing prop-types in the prop-types package', () => {
Object.keys(originalPropTypes).forEach(propType => {
expect(dhis2PropTypes[propType]).toBe(originalPropTypes[propType])
})
})
})

@@ -66,10 +59,2 @@

})
it('should not overwrite existing prop-types in the prop-types package', () => {
Object.keys(originalPropTypes).forEach(propType => {
expect(namedDhis2PropTypes[propType]).toBe(
originalPropTypes[propType]
)
})
})
})

@@ -1,10 +0,22 @@

import propTypes from 'prop-types';
import * as customPropTypes from './propTypes'; // Export all prop-types as named exports
import PropTypes from 'prop-types';
import * as customPropTypes from './propTypes';
/*
* Export our own prop-types as named exports, this allows this import style:
* import { arrayWithLength } from '@dhis2/prop-types'
*/
export * from './propTypes';
export * from 'prop-types'; // Export all prop-types as a default export as well
/*
* Reexport the prop-types lib under a namespace, as is our convention. The
* name is Pascalcased, this allows for this import style:
* import { PropTypes } from '@dhis2/prop-types'
*/
const allPropTypes = { ...propTypes,
...customPropTypes
};
export default allPropTypes;
export { PropTypes };
/*
* Export custom prop-types as the default export. This only contains our
* own prop-types. Import style is (naming is up to the user of course):
* import dhis2PropTypes from '@dhis2/prop-types'
*/
export default customPropTypes;

@@ -0,1 +1,13 @@

# [2.0.0](https://github.com/dhis2/prop-types/compare/v1.6.4...v2.0.0) (2020-04-28)
### Features
* update the export style ([decd522](https://github.com/dhis2/prop-types/commit/decd5227cdc3f7ccce1571ded890f636bd984332))
### BREAKING CHANGES
* this changes the re-export style for the prop-types lib. Instead of mixing our custom and the upstream prop-types, now the upstream lib is namespaced under the 'PropTypes' named export.
## [1.6.4](https://github.com/dhis2/prop-types/compare/v1.6.3...v1.6.4) (2020-04-02)

@@ -2,0 +14,0 @@

{
"name": "@dhis2/prop-types",
"version": "1.6.4",
"version": "2.0.0",
"main": "./build/cjs/index.js",

@@ -5,0 +5,0 @@ "module": "./build/es/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc