How to use _invariant method in root

Best JavaScript code snippet using root

module$node_modules$graphql$execution$execute.js

Source:module$node_modules$graphql$execution$execute.js Github

copy

Full Screen

1shadow$provide.module$node_modules$graphql$execution$execute = function($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $_promiseForObject__promiseReduce_process$$, $require$$, $module$$, $exports$$) {2 function $_interopRequireDefault$$($exports$$) {3 return $exports$$ && $exports$$.__esModule ? $exports$$ : {default:$exports$$};4 }5 function $executeImpl$$($exports$$, $require$$, $executeImpl$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $_interopRequireDefault$$, $responsePathAsArray$$) {6 $assertValidExecutionArguments$$($exports$$, $require$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);7 $exports$$ = $buildExecutionContext$$($exports$$, $require$$, $executeImpl$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $_interopRequireDefault$$, $responsePathAsArray$$);8 if (Array.isArray($exports$$)) {9 return {errors:$exports$$};10 }11 $executeImpl$$ = $executeOperation$$($exports$$, $exports$$.operation, $executeImpl$$);12 return $buildResponse$$($exports$$, $executeImpl$$);13 }14 function $buildResponse$$($exports$$, $require$$) {15 return (0, $_isPromise2$$.default)($require$$) ? $require$$.then(function($require$$) {16 return $buildResponse$$($exports$$, $require$$);17 }) : 0 === $exports$$.errors.length ? {data:$require$$} : {errors:$exports$$.errors, data:$require$$};18 }19 function $responsePathAsArray$$($exports$$) {20 for (var $require$$ = []; $exports$$;) {21 $require$$.push($exports$$.key), $exports$$ = $exports$$.prev;22 }23 return $require$$.reverse();24 }25 function $addPath$$($exports$$, $require$$) {26 return {prev:$exports$$, key:$require$$};27 }28 function $assertValidExecutionArguments$$($exports$$, $require$$, $executeImpl$$) {29 $require$$ ? void 0 : (0, $_invariant2$$.default)(0, "Must provide document");30 (0, $_validate$$.assertValidSchema)($exports$$);31 $executeImpl$$ && "object" !== ("undefined" === typeof $executeImpl$$ ? "undefined" : $_typeof$$($executeImpl$$)) ? (0, $_invariant2$$.default)(0, "Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.") : void 0;32 }33 function $buildExecutionContext$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $_interopRequireDefault$$) {34 for (var $assertValidExecutionArguments$$ = [], $buildResponse$$ = void 0, $responsePathAsArray$$ = !1, $completeListValue$$ = Object.create(null), $completeValue$$ = 0; $completeValue$$ < $require$$.definitions.length; $completeValue$$++) {35 var $schema$$ = $require$$.definitions[$completeValue$$];36 switch($schema$$.kind) {37 case $_kinds$$.Kind.OPERATION_DEFINITION:38 if (!$_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ && $buildResponse$$) {39 $responsePathAsArray$$ = !0;40 } else {41 if (!$_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ || $schema$$.name && $schema$$.name.value === $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {42 $buildResponse$$ = $schema$$;43 }44 }45 break;46 case $_kinds$$.Kind.FRAGMENT_DEFINITION:47 $completeListValue$$[$schema$$.name.value] = $schema$$;48 }49 }50 $buildResponse$$ ? $responsePathAsArray$$ && $assertValidExecutionArguments$$.push(new $_error$$.GraphQLError("Must provide operation name if query contains multiple operations.")) : $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ ? $assertValidExecutionArguments$$.push(new $_error$$.GraphQLError('Unknown operation named "' + $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ + 51 '".')) : $assertValidExecutionArguments$$.push(new $_error$$.GraphQLError("Must provide an operation."));52 $require$$ = void 0;53 $buildResponse$$ && ($addPath$$ = (0, $_values$$.getVariableValues)($exports$$, $buildResponse$$.variableDefinitions || [], $addPath$$ || {}), $addPath$$.errors ? $assertValidExecutionArguments$$.push.apply($assertValidExecutionArguments$$, $addPath$$.errors) : $require$$ = $addPath$$.coerced);54 if (0 !== $assertValidExecutionArguments$$.length) {55 return $assertValidExecutionArguments$$;56 }57 $buildResponse$$ ? void 0 : (0, $_invariant2$$.default)(0, "Has operation if no errors.");58 $require$$ ? void 0 : (0, $_invariant2$$.default)(0, "Has variables if no errors.");59 return {schema:$exports$$, fragments:$completeListValue$$, rootValue:$executeImpl$$, contextValue:$executeOperation$$, operation:$buildResponse$$, variableValues:$require$$, fieldResolver:$_interopRequireDefault$$ || $defaultFieldResolver$$, errors:$assertValidExecutionArguments$$};60 }61 function $executeOperation$$($exports$$, $require$$, $executeImpl$$) {62 var $executeOperation$$ = $getOperationRootType$$($exports$$.schema, $require$$), $addPath$$ = $collectFields$$($exports$$, $executeOperation$$, $require$$.selectionSet, Object.create(null), Object.create(null));63 try {64 var $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ = "mutation" === $require$$.operation ? $executeFieldsSerially$$($exports$$, $executeOperation$$, $executeImpl$$, void 0, $addPath$$) : $executeFields$$($exports$$, $executeOperation$$, $executeImpl$$, void 0, $addPath$$);65 return (0, $_isPromise2$$.default)($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) ? $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$.then(void 0, function($require$$) {66 $exports$$.errors.push($require$$);67 return Promise.resolve(null);68 }) : $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$;69 } catch ($error$$) {70 return $exports$$.errors.push($error$$), null;71 }72 }73 function $getOperationRootType$$($exports$$, $require$$) {74 switch($require$$.operation) {75 case "query":76 $exports$$ = $exports$$.getQueryType();77 if (!$exports$$) {78 throw new $_error$$.GraphQLError("Schema does not define the required query root type.", [$require$$]);79 }80 return $exports$$;81 case "mutation":82 $exports$$ = $exports$$.getMutationType();83 if (!$exports$$) {84 throw new $_error$$.GraphQLError("Schema is not configured for mutations.", [$require$$]);85 }86 return $exports$$;87 case "subscription":88 $exports$$ = $exports$$.getSubscriptionType();89 if (!$exports$$) {90 throw new $_error$$.GraphQLError("Schema is not configured for subscriptions.", [$require$$]);91 }92 return $exports$$;93 default:94 throw new $_error$$.GraphQLError("Can only execute queries, mutations and subscriptions.", [$require$$]);95 }96 }97 function $executeFieldsSerially$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {98 return (0, $_promiseReduce2$$.default)(Object.keys($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$), function($assertValidExecutionArguments$$, $_interopRequireDefault$$) {99 var $buildResponse$$ = $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$[$_interopRequireDefault$$], $responsePathAsArray$$ = $addPath$$($executeOperation$$, $_interopRequireDefault$$);100 $buildResponse$$ = $resolveField$$($exports$$, $require$$, $executeImpl$$, $buildResponse$$, $responsePathAsArray$$);101 if (void 0 === $buildResponse$$) {102 return $assertValidExecutionArguments$$;103 }104 if ((0, $_isPromise2$$.default)($buildResponse$$)) {105 return $buildResponse$$.then(function($exports$$) {106 $assertValidExecutionArguments$$[$_interopRequireDefault$$] = $exports$$;107 return $assertValidExecutionArguments$$;108 });109 }110 $assertValidExecutionArguments$$[$_interopRequireDefault$$] = $buildResponse$$;111 return $assertValidExecutionArguments$$;112 }, Object.create(null));113 }114 function $executeFields$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {115 var $assertValidExecutionArguments$$ = !1, $_interopRequireDefault$$ = Object.keys($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$).reduce(function($_interopRequireDefault$$, $buildResponse$$) {116 var $responsePathAsArray$$ = $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$[$buildResponse$$], $completeListValue$$ = $addPath$$($executeOperation$$, $buildResponse$$);117 $responsePathAsArray$$ = $resolveField$$($exports$$, $require$$, $executeImpl$$, $responsePathAsArray$$, $completeListValue$$);118 if (void 0 === $responsePathAsArray$$) {119 return $_interopRequireDefault$$;120 }121 $_interopRequireDefault$$[$buildResponse$$] = $responsePathAsArray$$;122 !$assertValidExecutionArguments$$ && (0, $_isPromise2$$.default)($responsePathAsArray$$) && ($assertValidExecutionArguments$$ = !0);123 return $_interopRequireDefault$$;124 }, Object.create(null));125 return $assertValidExecutionArguments$$ ? (0, $_promiseForObject2$$.default)($_interopRequireDefault$$) : $_interopRequireDefault$$;126 }127 function $collectFields$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$) {128 for (var $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ = 0; $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ < $executeImpl$$.selections.length; $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$++) {129 var $assertValidExecutionArguments$$ = $executeImpl$$.selections[$_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$];130 switch($assertValidExecutionArguments$$.kind) {131 case $_kinds$$.Kind.FIELD:132 if (!$shouldIncludeNode$$($exports$$, $assertValidExecutionArguments$$)) {133 continue;134 }135 var $_interopRequireDefault$$ = $assertValidExecutionArguments$$.alias ? $assertValidExecutionArguments$$.alias.value : $assertValidExecutionArguments$$.name.value;136 $executeOperation$$[$_interopRequireDefault$$] || ($executeOperation$$[$_interopRequireDefault$$] = []);137 $executeOperation$$[$_interopRequireDefault$$].push($assertValidExecutionArguments$$);138 break;139 case $_kinds$$.Kind.INLINE_FRAGMENT:140 if (!$shouldIncludeNode$$($exports$$, $assertValidExecutionArguments$$) || !$doesFragmentConditionMatch$$($exports$$, $assertValidExecutionArguments$$, $require$$)) {141 continue;142 }143 $collectFields$$($exports$$, $require$$, $assertValidExecutionArguments$$.selectionSet, $executeOperation$$, $addPath$$);144 break;145 case $_kinds$$.Kind.FRAGMENT_SPREAD:146 $_interopRequireDefault$$ = $assertValidExecutionArguments$$.name.value, !$addPath$$[$_interopRequireDefault$$] && $shouldIncludeNode$$($exports$$, $assertValidExecutionArguments$$) && ($addPath$$[$_interopRequireDefault$$] = !0, ($assertValidExecutionArguments$$ = $exports$$.fragments[$_interopRequireDefault$$]) && $doesFragmentConditionMatch$$($exports$$, $assertValidExecutionArguments$$, $require$$) && $collectFields$$($exports$$, $require$$, $assertValidExecutionArguments$$.selectionSet, 147 $executeOperation$$, $addPath$$));148 }149 }150 return $executeOperation$$;151 }152 function $shouldIncludeNode$$($exports$$, $require$$) {153 var $executeImpl$$ = (0, $_values$$.getDirectiveValues)($_directives$$.GraphQLSkipDirective, $require$$, $exports$$.variableValues);154 return $executeImpl$$ && !0 === $executeImpl$$.if ? !1 : ($exports$$ = (0, $_values$$.getDirectiveValues)($_directives$$.GraphQLIncludeDirective, $require$$, $exports$$.variableValues)) && !1 === $exports$$.if ? !1 : !0;155 }156 function $doesFragmentConditionMatch$$($exports$$, $require$$, $executeImpl$$) {157 $require$$ = $require$$.typeCondition;158 if (!$require$$) {159 return !0;160 }161 $require$$ = (0, $_typeFromAST$$.typeFromAST)($exports$$.schema, $require$$);162 return $require$$ === $executeImpl$$ ? !0 : (0, $_definition$$.isAbstractType)($require$$) ? $exports$$.schema.isPossibleType($require$$, $executeImpl$$) : !1;163 }164 function $resolveField$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$) {165 var $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ = $getFieldDef$$($exports$$.schema, $require$$, $executeOperation$$[0].name.value);166 if ($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {167 var $assertValidExecutionArguments$$ = $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$.resolve || $exports$$.fieldResolver;168 $require$$ = $buildResolveInfo$$($exports$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $executeOperation$$, $require$$, $addPath$$);169 $executeImpl$$ = $resolveFieldValueOrError$$($exports$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $executeOperation$$, $assertValidExecutionArguments$$, $executeImpl$$, $require$$);170 return $completeValueCatchingError$$($exports$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$.type, $executeOperation$$, $require$$, $addPath$$, $executeImpl$$);171 }172 }173 function $buildResolveInfo$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$) {174 return {fieldName:$executeImpl$$[0].name.value, fieldNodes:$executeImpl$$, returnType:$require$$.type, parentType:$executeOperation$$, path:$addPath$$, schema:$exports$$.schema, fragments:$exports$$.fragments, rootValue:$exports$$.rootValue, operation:$exports$$.operation, variableValues:$exports$$.variableValues};175 }176 function $resolveFieldValueOrError$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {177 try {178 var $assertValidExecutionArguments$$ = (0, $_values$$.getArgumentValues)($require$$, $executeImpl$$[0], $exports$$.variableValues), $_interopRequireDefault$$ = $executeOperation$$($addPath$$, $assertValidExecutionArguments$$, $exports$$.contextValue, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);179 return (0, $_isPromise2$$.default)($_interopRequireDefault$$) ? $_interopRequireDefault$$.then(void 0, $asErrorInstance$$) : $_interopRequireDefault$$;180 } catch ($error$$) {181 return $asErrorInstance$$($error$$);182 }183 }184 function $asErrorInstance$$($exports$$) {185 return $exports$$ instanceof Error ? $exports$$ : Error($exports$$ || void 0);186 }187 function $completeValueCatchingError$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {188 if ((0, $_definition$$.isNonNullType)($require$$)) {189 return $completeValueWithLocatedError$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);190 }191 try {192 var $assertValidExecutionArguments$$ = $completeValueWithLocatedError$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);193 return (0, $_isPromise2$$.default)($assertValidExecutionArguments$$) ? $assertValidExecutionArguments$$.then(void 0, function($require$$) {194 $exports$$.errors.push($require$$);195 return Promise.resolve(null);196 }) : $assertValidExecutionArguments$$;197 } catch ($error$$) {198 return $exports$$.errors.push($error$$), null;199 }200 }201 function $completeValueWithLocatedError$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {202 try {203 var $assertValidExecutionArguments$$ = $completeValue$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);204 return (0, $_isPromise2$$.default)($assertValidExecutionArguments$$) ? $assertValidExecutionArguments$$.then(void 0, function($exports$$) {205 return Promise.reject((0, $_error$$.locatedError)($asErrorInstance$$($exports$$), $executeImpl$$, $responsePathAsArray$$($addPath$$)));206 }) : $assertValidExecutionArguments$$;207 } catch ($error$$) {208 throw (0, $_error$$.locatedError)($asErrorInstance$$($error$$), $executeImpl$$, $responsePathAsArray$$($addPath$$));209 }210 }211 function $completeValue$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {212 if ((0, $_isPromise2$$.default)($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$)) {213 return $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$.then(function($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {214 return $completeValue$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);215 });216 }217 if ($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ instanceof Error) {218 throw $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$;219 }220 if ((0, $_definition$$.isNonNullType)($require$$)) {221 $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ = $completeValue$$($exports$$, $require$$.ofType, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);222 if (null === $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {223 throw Error("Cannot return null for non-nullable field " + $executeOperation$$.parentType.name + "." + $executeOperation$$.fieldName + ".");224 }225 return $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$;226 }227 if ((0, $_isNullish2$$.default)($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$)) {228 return null;229 }230 if ((0, $_definition$$.isListType)($require$$)) {231 return $completeListValue$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);232 }233 if ((0, $_definition$$.isLeafType)($require$$)) {234 return $completeLeafValue$$($require$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);235 }236 if ((0, $_definition$$.isAbstractType)($require$$)) {237 return $completeAbstractValue$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);238 }239 if ((0, $_definition$$.isObjectType)($require$$)) {240 return $completeObjectValue$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);241 }242 throw Error('Cannot complete value of unexpected type "' + String($require$$) + '".');243 }244 function $completeListValue$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $assertValidExecutionArguments$$) {245 (0, $_iterall$$.isCollection)($assertValidExecutionArguments$$) ? void 0 : (0, $_invariant2$$.default)(0, "Expected Iterable, but did not find one for field " + $executeOperation$$.parentType.name + "." + $executeOperation$$.fieldName + ".");246 var $_interopRequireDefault$$ = $require$$.ofType, $buildResponse$$ = !1, $responsePathAsArray$$ = [];247 (0, $_iterall$$.forEach)($assertValidExecutionArguments$$, function($require$$, $assertValidExecutionArguments$$) {248 $assertValidExecutionArguments$$ = $addPath$$($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $assertValidExecutionArguments$$);249 $require$$ = $completeValueCatchingError$$($exports$$, $_interopRequireDefault$$, $executeImpl$$, $executeOperation$$, $assertValidExecutionArguments$$, $require$$);250 !$buildResponse$$ && (0, $_isPromise2$$.default)($require$$) && ($buildResponse$$ = !0);251 $responsePathAsArray$$.push($require$$);252 });253 return $buildResponse$$ ? Promise.all($responsePathAsArray$$) : $responsePathAsArray$$;254 }255 function $completeLeafValue$$($exports$$, $require$$) {256 $exports$$.serialize ? void 0 : (0, $_invariant2$$.default)(0, "Missing serialize method on type");257 var $executeImpl$$ = $exports$$.serialize($require$$);258 if ((0, $_isInvalid2$$.default)($executeImpl$$)) {259 throw Error('Expected a value of type "' + String($exports$$) + '" but ' + ("received: " + String($require$$)));260 }261 return $executeImpl$$;262 }263 function $completeAbstractValue$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {264 var $assertValidExecutionArguments$$ = $require$$.resolveType ? $require$$.resolveType($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $exports$$.contextValue, $executeOperation$$) : $defaultResolveTypeFn$$($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $exports$$.contextValue, $executeOperation$$, $require$$);265 return (0, $_isPromise2$$.default)($assertValidExecutionArguments$$) ? $assertValidExecutionArguments$$.then(function($assertValidExecutionArguments$$) {266 return $completeObjectValue$$($exports$$, $ensureValidRuntimeType$$($assertValidExecutionArguments$$, $exports$$, $require$$, $executeImpl$$, $executeOperation$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$), $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);267 }) : $completeObjectValue$$($exports$$, $ensureValidRuntimeType$$($assertValidExecutionArguments$$, $exports$$, $require$$, $executeImpl$$, $executeOperation$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$), $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);268 }269 function $ensureValidRuntimeType$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {270 $exports$$ = "string" === typeof $exports$$ ? $require$$.schema.getType($exports$$) : $exports$$;271 if (!(0, $_definition$$.isObjectType)($exports$$)) {272 throw new $_error$$.GraphQLError("Abstract type " + $executeImpl$$.name + " must resolve to an Object type at " + ("runtime for field " + $addPath$$.parentType.name + "." + $addPath$$.fieldName + " with ") + ('value "' + String($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) + '", received "' + String($exports$$) + '". ') + ("Either the " + $executeImpl$$.name + ' type should provide a "resolveType" ') + 'function or each possible types should provide an "isTypeOf" function.', 273 $executeOperation$$);274 }275 if (!$require$$.schema.isPossibleType($executeImpl$$, $exports$$)) {276 throw new $_error$$.GraphQLError('Runtime Object type "' + $exports$$.name + '" is not a possible type ' + ('for "' + $executeImpl$$.name + '".'), $executeOperation$$);277 }278 return $exports$$;279 }280 function $completeObjectValue$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {281 if ($require$$.isTypeOf) {282 var $assertValidExecutionArguments$$ = $require$$.isTypeOf($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $exports$$.contextValue, $executeOperation$$);283 if ((0, $_isPromise2$$.default)($assertValidExecutionArguments$$)) {284 return $assertValidExecutionArguments$$.then(function($assertValidExecutionArguments$$) {285 if (!$assertValidExecutionArguments$$) {286 throw $invalidReturnTypeError$$($require$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $executeImpl$$);287 }288 return $collectAndExecuteSubfields$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);289 });290 }291 if (!$assertValidExecutionArguments$$) {292 throw $invalidReturnTypeError$$($require$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $executeImpl$$);293 }294 }295 return $collectAndExecuteSubfields$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);296 }297 function $invalidReturnTypeError$$($exports$$, $require$$, $executeImpl$$) {298 return new $_error$$.GraphQLError('Expected value of type "' + $exports$$.name + '" but got: ' + String($require$$) + ".", $executeImpl$$);299 }300 function $collectAndExecuteSubfields$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$) {301 $executeImpl$$ = $collectSubfields$$($exports$$, $require$$, $executeImpl$$);302 return $executeFields$$($exports$$, $require$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $addPath$$, $executeImpl$$);303 }304 function $defaultResolveTypeFn$$($exports$$, $require$$, $executeImpl$$, $executeOperation$$) {305 if (null !== $exports$$ && "object" === ("undefined" === typeof $exports$$ ? "undefined" : $_typeof$$($exports$$)) && "string" === typeof $exports$$.__typename) {306 return $exports$$.__typename;307 }308 var $addPath$$ = $executeImpl$$.schema.getPossibleTypes($executeOperation$$);309 $executeOperation$$ = [];310 for (var $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ = 0; $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ < $addPath$$.length; $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$++) {311 var $assertValidExecutionArguments$$ = $addPath$$[$_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$];312 if ($assertValidExecutionArguments$$.isTypeOf) {313 var $_interopRequireDefault$$ = $assertValidExecutionArguments$$.isTypeOf($exports$$, $require$$, $executeImpl$$);314 if ((0, $_isPromise2$$.default)($_interopRequireDefault$$)) {315 $executeOperation$$[$_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$] = $_interopRequireDefault$$;316 } else {317 if ($_interopRequireDefault$$) {318 return $assertValidExecutionArguments$$;319 }320 }321 }322 }323 if ($executeOperation$$.length) {324 return Promise.all($executeOperation$$).then(function($exports$$) {325 for (var $require$$ = 0; $require$$ < $exports$$.length; $require$$++) {326 if ($exports$$[$require$$]) {327 return $addPath$$[$require$$];328 }329 }330 });331 }332 }333 function $getFieldDef$$($exports$$, $require$$, $executeImpl$$) {334 return $executeImpl$$ === $_introspection$$.SchemaMetaFieldDef.name && $exports$$.getQueryType() === $require$$ ? $_introspection$$.SchemaMetaFieldDef : $executeImpl$$ === $_introspection$$.TypeMetaFieldDef.name && $exports$$.getQueryType() === $require$$ ? $_introspection$$.TypeMetaFieldDef : $executeImpl$$ === $_introspection$$.TypeNameMetaFieldDef.name ? $_introspection$$.TypeNameMetaFieldDef : $require$$.getFields()[$executeImpl$$];335 }336 Object.defineProperty($exports$$, "__esModule", {value:!0});337 $exports$$.defaultFieldResolver = void 0;338 var $_typeof$$ = "function" === typeof Symbol && "symbol" === typeof Symbol.iterator ? function($exports$$) {339 return typeof $exports$$;340 } : function($exports$$) {341 return $exports$$ && "function" === typeof Symbol && $exports$$.constructor === Symbol && $exports$$ !== Symbol.prototype ? "symbol" : typeof $exports$$;342 };343 $exports$$.execute = function($exports$$, $require$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $assertValidExecutionArguments$$, $_interopRequireDefault$$) {344 return 1 === arguments.length ? $executeImpl$$($exports$$.schema, $exports$$.document, $exports$$.rootValue, $exports$$.contextValue, $exports$$.variableValues, $exports$$.operationName, $exports$$.fieldResolver) : $executeImpl$$($exports$$, $require$$, $executeOperation$$, $addPath$$, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$, $assertValidExecutionArguments$$, $_interopRequireDefault$$);345 };346 $exports$$.responsePathAsArray = $responsePathAsArray$$;347 $exports$$.addPath = $addPath$$;348 $exports$$.assertValidExecutionArguments = $assertValidExecutionArguments$$;349 $exports$$.buildExecutionContext = $buildExecutionContext$$;350 $exports$$.getOperationRootType = $getOperationRootType$$;351 $exports$$.collectFields = $collectFields$$;352 $exports$$.buildResolveInfo = $buildResolveInfo$$;353 $exports$$.resolveFieldValueOrError = $resolveFieldValueOrError$$;354 $exports$$.getFieldDef = $getFieldDef$$;355 var $_iterall$$ = $require$$("module$node_modules$iterall$index"), $_error$$ = $require$$("module$node_modules$graphql$error$index");356 $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ = $require$$("module$node_modules$graphql$jsutils$invariant");357 var $_invariant2$$ = $_interopRequireDefault$$($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);358 $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ = $require$$("module$node_modules$graphql$jsutils$isInvalid");359 var $_isInvalid2$$ = $_interopRequireDefault$$($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);360 $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ = $require$$("module$node_modules$graphql$jsutils$isNullish");361 var $_isNullish2$$ = $_interopRequireDefault$$($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);362 $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ = $require$$("module$node_modules$graphql$jsutils$isPromise");363 var $_isPromise2$$ = $_interopRequireDefault$$($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);364 $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ = $require$$("module$node_modules$graphql$jsutils$memoize3");365 $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ = $_interopRequireDefault$$($_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$);366 $_promiseForObject__promiseReduce_process$$ = $require$$("module$node_modules$graphql$jsutils$promiseForObject");367 var $_promiseForObject2$$ = $_interopRequireDefault$$($_promiseForObject__promiseReduce_process$$);368 $_promiseForObject__promiseReduce_process$$ = $require$$("module$node_modules$graphql$jsutils$promiseReduce");369 var $_promiseReduce2$$ = $_interopRequireDefault$$($_promiseForObject__promiseReduce_process$$), $_typeFromAST$$ = $require$$("module$node_modules$graphql$utilities$typeFromAST"), $_kinds$$ = $require$$("module$node_modules$graphql$language$kinds"), $_values$$ = $require$$("module$node_modules$graphql$execution$values"), $_definition$$ = $require$$("module$node_modules$graphql$type$definition");370 $require$$("module$node_modules$graphql$type$schema");371 var $_introspection$$ = $require$$("module$node_modules$graphql$type$introspection"), $_directives$$ = $require$$("module$node_modules$graphql$type$directives"), $_validate$$ = $require$$("module$node_modules$graphql$type$validate"), $collectSubfields$$ = (0, $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$.default)(function($exports$$, $require$$, $executeImpl$$) {372 for (var $executeOperation$$ = Object.create(null), $addPath$$ = Object.create(null), $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ = 0; $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$ < $executeImpl$$.length; $_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$++) {373 var $assertValidExecutionArguments$$ = $executeImpl$$[$_invariant$jscomp$8__isInvalid$jscomp$8__isNullish$jscomp$2__isPromise$jscomp$1__memoize__memoize2_global$$].selectionSet;374 $assertValidExecutionArguments$$ && ($executeOperation$$ = $collectFields$$($exports$$, $require$$, $assertValidExecutionArguments$$, $executeOperation$$, $addPath$$));375 }376 return $executeOperation$$;377 }), $defaultFieldResolver$$ = $exports$$.defaultFieldResolver = function($exports$$, $require$$, $executeImpl$$, $executeOperation$$) {378 if ("object" === ("undefined" === typeof $exports$$ ? "undefined" : $_typeof$$($exports$$)) || "function" === typeof $exports$$) {379 var $addPath$$ = $exports$$[$executeOperation$$.fieldName];380 return "function" === typeof $addPath$$ ? $exports$$[$executeOperation$$.fieldName]($require$$, $executeImpl$$, $executeOperation$$) : $addPath$$;381 }382 };...

Full Screen

Full Screen

checkModel.js

Source:checkModel.js Github

copy

Full Screen

1"use strict";2var _interopRequireDefault = require("../../@babel/runtime/helpers/interopRequireDefault.js");3Object.defineProperty(exports, "__esModule", {4 value: true5});6exports.default = checkModel;7var _typeof2 = _interopRequireDefault(require("../../@babel/runtime/helpers/typeof.js"));8var _invariant = _interopRequireDefault(require("../../invariant/invariant.js"));9var _utils = require("./utils.js");10function checkModel(model, existModels) {11 var namespace = model.namespace,12 reducers = model.reducers,13 effects = model.effects,14 subscriptions = model.subscriptions; // namespace 必须被定义15 (0, _invariant.default)(namespace, "[app.model] namespace should be defined"); // 并且是字符串16 (0, _invariant.default)(typeof namespace === 'string', "[app.model] namespace should be string, but got ".concat((0, _typeof2.default)(namespace))); // 并且唯一17 (0, _invariant.default)(!existModels.some(function (model) {18 return model.namespace === namespace;19 }), "[app.model] namespace should be unique"); // state 可以为任意值20 // reducers 可以为空,PlainObject 或者数组21 if (reducers) {22 (0, _invariant.default)((0, _utils.isPlainObject)(reducers) || (0, _utils.isArray)(reducers), "[app.model] reducers should be plain object or array, but got ".concat((0, _typeof2.default)(reducers))); // 数组的 reducers 必须是 [Object, Function] 的格式23 (0, _invariant.default)(!(0, _utils.isArray)(reducers) || (0, _utils.isPlainObject)(reducers[0]) && (0, _utils.isFunction)(reducers[1]), "[app.model] reducers with array should be [Object, Function]");24 } // effects 可以为空,PlainObject25 if (effects) {26 (0, _invariant.default)((0, _utils.isPlainObject)(effects), "[app.model] effects should be plain object, but got ".concat((0, _typeof2.default)(effects)));27 }28 if (subscriptions) {29 // subscriptions 可以为空,PlainObject30 (0, _invariant.default)((0, _utils.isPlainObject)(subscriptions), "[app.model] subscriptions should be plain object, but got ".concat((0, _typeof2.default)(subscriptions))); // subscription 必须为函数31 (0, _invariant.default)(isAllFunction(subscriptions), "[app.model] subscription should be function");32 }33}34function isAllFunction(obj) {35 return Object.keys(obj).every(function (key) {36 return (0, _utils.isFunction)(obj[key]);37 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var _invariant = require('invariant');2var _invariant = require('invariant');3var _invariant = require('invariant');4var _invariant = require('invariant');5var _invariant = require('invariant');6var _invariant = require('invariant');7var _invariant = require('invariant');8var _invariant = require('invariant');9var _invariant = require('invariant');10var _invariant = require('invariant');11var _invariant = require('invariant');12var _invariant = require('invariant');13var _invariant = require('invariant');14var _invariant = require('invariant');15var _invariant = require('invariant');16var _invariant = require('invariant');17var _invariant = require('invariant');18var _invariant = require('invariant');19var _invariant = require('invariant');20var _invariant = require('invariant');21var _invariant = require('invariant');22var _invariant = require('invariant');23var _invariant = require('invariant');24var _invariant = require('invariant');25var _invariant = require('invariant');26var _invariant = require('invariant');27var _invariant = require('invariant');28var _invariant = require('invariant');29var _invariant = require('invariant');30var _invariant = require('invariant');31var _invariant = require('invariant');32var _invariant = require('invariant');33var _invariant = require('invariant');34var _invariant = require('invariant');35var _invariant = require('invariant');36var _invariant = require('invariant');

Full Screen

Using AI Code Generation

copy

Full Screen

1var invariant = require('invariant');2invariant(false, 'This is an error message');3var invariant = require('invariant');4invariant(false, 'This is an error message');5var invariant = require('invariant');6invariant(false, 'This is an error message');7var invariant = require('invariant');8invariant(false, 'This is an error message');9var invariant = require('invariant');10invariant(false, 'This is an error message');11var invariant = require('invariant');12invariant(false, 'This is an error message');13var invariant = require('invariant');14invariant(false, 'This is an error message');15var invariant = require('invariant');16invariant(false, 'This is an error message');17var invariant = require('invariant');18invariant(false, 'This is an error message');19var invariant = require('invariant');20invariant(false, 'This is an error message');21var invariant = require('invariant');22invariant(false, 'This is an error message');23var invariant = require('invariant');24invariant(false, 'This is an error message');25var invariant = require('invariant');26invariant(false, 'This is an error message');27var invariant = require('invariant');28invariant(false, 'This is an error message');29var invariant = require('invariant');30invariant(false, 'This is an error message');

Full Screen

Using AI Code Generation

copy

Full Screen

1var invariant = require('invariant');2invariant(false, 'This is an error message');3var invariant = require('./child').invariant;4invariant(false, 'This is an error message');5var invariant = require('./child').invariant;6invariant(false, 'This is an error message');7var invariant = require('invariant');8invariant(false, 'This is an error message');9React provides a library of components that can be used to build user interfaces. A component is a JavaScript function that returns a React element. A React element is a plain JavaScript object that describes a component instance or DOM node and its desired properties. React elements can be created using JSX or React.createElement() . The following code snippet shows how to create a React element using JSX:10const element = <h1>Hello, world!</h1>;11The following code snippet shows how to create a React element using React.createElement() :12const element = React.createElement(13 {className: 'greeting'},14);

Full Screen

Using AI Code Generation

copy

Full Screen

1module.exports = function invariant(condition, format, a, b, c, d, e, f) {2 if (condition) {3 return;4 }5 throw new Error(6 format.replace(/%s/g, () => arguments[++i])7 );8}9module.exports = function invariant(condition, format, a, b, c, d, e, f) {10 if (condition) {11 return;12 }13 throw new Error(14 format.replace(/%s/g, () => arguments[++i])15 );16}

Full Screen

Using AI Code Generation

copy

Full Screen

1var root = require('root');2root._invariant(true, 'should not throw error');3root._invariant(false, 'should throw error');4var invariant = require('invariant');5invariant(true, 'should not throw error');6invariant(false, 'should throw error');7var invariant = require('invariant');8invariant(true, 'should not throw error');9invariant(false, 'should throw error');10var invariant = require('invariant');11invariant(true, 'should not throw error');12invariant(false, 'should throw error');13var invariant = require('invariant');14invariant(true, 'should not throw error');15invariant(false, 'should throw error');16var invariant = require('invariant');17invariant(true, 'should not throw error');18invariant(false, 'should throw error');19var invariant = require('invariant');20invariant(true, 'should not throw error');21invariant(false, 'should throw error');22var invariant = require('invariant');23invariant(true, 'should not throw error');24invariant(false, 'should throw error');25var invariant = require('invariant');26invariant(true, 'should not throw error');27invariant(false, 'should throw error');28var invariant = require('invariant');29invariant(true, 'should not throw error');30invariant(false, 'should throw error');31var invariant = require('invariant');32invariant(true, 'should not throw error');33invariant(false, 'should throw error');34var invariant = require('invariant');35invariant(true, 'should not throw error');36invariant(false, 'should throw error');37var invariant = require('invariant');38invariant(true, 'should not throw error');39invariant(false, 'should throw error

Full Screen

Using AI Code Generation

copy

Full Screen

1var invariant = require('invariant');2invariant(condition, 'Error message %s', 'myVar');3var myModule = require('./myModule.js');4myModule._invariant(condition, 'Error message %s', 'myVar');5var invariant = function(condition, message) {6 var invariant = require('invariant');7 invariant(condition, message);8};9invariant(condition, 'Error message %s', 'myVar');10var myModule = require('./myModule.js');11myModule._invariant(condition, 'Error message %s', 'myVar');

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run root automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful