| Current Path : /home/emeraadmin/www/4d695/ |
| Current File : /home/emeraadmin/www/4d695/@react-dnd.zip |
PK [�\��N<� � invariant/src/index.tsnu �[��� /**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
export function invariant(condition: any, format: string, ...args: any[]) {
if (process.env.NODE_ENV !== 'production') {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
}
if (!condition) {
let error;
if (format === undefined) {
error = new Error(
'Minified exception occurred; use the non-minified dev environment ' +
'for the full error message and additional helpful warnings.'
);
} else {
let argIndex = 0;
error = new Error(
format.replace(/%s/g, function() {
return args[argIndex++];
})
);
error.name = 'Invariant Violation';
}
(error as any).framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
}
PK [�\��]@� � invariant/package.jsonnu �[��� {
"_from": "@react-dnd/invariant@^2.0.0",
"_id": "@react-dnd/invariant@2.0.0",
"_inBundle": false,
"_integrity": "sha512-xL4RCQBCBDJ+GRwKTFhGUW8GXa4yoDfJrPbLblc3U09ciS+9ZJXJ3Qrcs/x2IODOdIE5kQxvMmE2UKyqUictUw==",
"_location": "/@react-dnd/invariant",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@react-dnd/invariant@^2.0.0",
"name": "@react-dnd/invariant",
"escapedName": "@react-dnd%2finvariant",
"scope": "@react-dnd",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/dnd-core"
],
"_resolved": "https://registry.npmjs.org/@react-dnd/invariant/-/invariant-2.0.0.tgz",
"_shasum": "09d2e81cd39e0e767d7da62df9325860f24e517e",
"_spec": "@react-dnd/invariant@^2.0.0",
"_where": "C:\\xampp\\htdocs\\emeraltd\\node_modules\\dnd-core",
"author": {
"name": "Andres Suarez",
"email": "zertosh@gmail.com"
},
"bugs": {
"url": "https://github.com/react-dnd/invariant/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "invariantx",
"devDependencies": {
"@types/jest": "^24.0.23",
"husky": "^3.1.0",
"tsdx": "^0.11.0",
"tslib": "^1.10.0",
"typescript": "^3.7.2"
},
"homepage": "https://github.com/react-dnd/invariant#readme",
"husky": {
"hooks": {
"pre-commit": "tsdx lint"
}
},
"keywords": [
"test",
"invariant"
],
"license": "MIT",
"main": "dist/index.js",
"module": "dist/invariant.esm.js",
"name": "@react-dnd/invariant",
"peerDependencies": {},
"prettier": {
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
},
"private": false,
"repository": {
"type": "git",
"url": "git+https://github.com/react-dnd/invariant.git"
},
"scripts": {
"build": "tsdx build",
"lint": "tsdx lint",
"start": "tsdx watch",
"test": "tsdx test"
},
"typings": "dist/index.d.ts",
"version": "2.0.0"
}
PK [�\�<�� ! invariant/test/production.spec.tsnu �[��� import invariant from '../src';
describe('production mode', () => {
const OLD_ENV = process.env;
beforeEach(() => {
jest.resetModules(); // this is important - it clears the cache
process.env = { ...OLD_ENV };
delete process.env.NODE_ENV;
});
afterEach(() => {
process.env = OLD_ENV;
});
it('works', () => {
process.env.NODE_ENV = 'production';
expect(function() {
invariant(true, 'invariant message');
}).not.toThrow();
expect(function() {
invariant(false, 'invariant message');
}).toThrow(/invariant message/);
expect(function() {
(invariant as any)(true);
}).not.toThrow();
expect(function() {
(invariant as any)(false);
}).toThrow(/minified exception occurred/i);
});
});
PK [�\� "